How to move a scroller using commands?

A place for App developers to hang out / post
Post Reply
MrNorth

Posts: 60
Joined: Sat May 18, 2013 9:46 am
Location:

HTPC Specs: Show details

How to move a scroller using commands?

#1

Post by MrNorth » Sun Feb 09, 2014 8:15 am

Hi!

I have spent countless hours trying something that should be simple.

I have two commands Left and Right. I have hooked these up to a keyhandler on my UI. When invoked, I want them to move the scroller one step to the left/right, by using the scrollerdata commands. The problem is that nothing is happening. The keys are trapped and the command is invoked (I have verified with a messagebox), but the scroller is not moving. It seems as if when the scroller is not in focus, I can't manipulate it like that.I ahve set the scroller UI not to accept any kind of focus, mouse, keyfocus. And it is this that appears to prevent the command from happening. How can I "disable" a scrollker from any user interaction, but still be able to "remote control" it using commands?

Is something like this possible? I ahve checked lots of mcml and have seen this behaviour at numerous apps, but I cant make it work. Is there some property i have to set on the scrollerdata, scroller to make this possible?

Any ideas?

MrNorth

Posts: 60
Joined: Sat May 18, 2013 9:46 am
Location:

HTPC Specs: Show details

#2

Post by MrNorth » Tue Feb 11, 2014 12:41 am

Hi!

My app is starting ti look really good. Just finishing the async stuff, and polishing the UI.

This topic is still of great concern to me. As my sidedeck works now, I have to navigate up to the pivot to give it focus, then I can change active deck using arrow buttons (normal pivot behaviour). Preferrably I am looking for a way to make the slidedeck pivot not focusable, but instead, making the sole function of the left/right buttons just to move the pivot left, right... like standard WMC behaviour.

Any MCML-expert out there... this issue is very easy to set up. Just make a blank UI, add a child UI and in that child UI, add the mcmllookalike pivot and pivotitem. And then, add two buttons on the "root" UI, one that says left and another right. Then add two commands for the buttons, and when pressing them, try to make the pivot change. SOunds pretty simple, but it isn't... Or there is something reli strange with my markup that I cant see.

regards
H

MrNorth

Posts: 60
Joined: Sat May 18, 2013 9:46 am
Location:

HTPC Specs: Show details

#3

Post by MrNorth » Wed Feb 12, 2014 9:02 am

Lol, after a few more hours of reading and googling, I found an old thread:

http://discuss.mediacentersandbox.com/f ... /3165.aspx

In this thread they are trying to solve two problems, one is the one I am facing, how to scroll an item to first position without giving it focus. Anf everyone of the gurus (Niall et al) tried the same crap I am trying now (timers, jump to focus and back etc etc), but sadly Charlie suggested that another thread is to be created for this particuar issue, and I can't find it!!!!

Does anyone know, or has a sample? It would solve 2 of my biggest problems!!!!!!!

/H

3rob3

Posts: 548
Joined: Sun Aug 28, 2011 8:48 pm
Location:

HTPC Specs: Show details

#4

Post by 3rob3 » Wed Feb 12, 2014 5:15 pm

I wish I could help you with these programming questions, but I can't. You have piqued my curiosity though.....what is this app you are writing?

MrNorth

Posts: 60
Joined: Sat May 18, 2013 9:46 am
Location:

HTPC Specs: Show details

#5

Post by MrNorth » Thu Feb 13, 2014 7:24 pm

Hey!

First, I did manage to solve this, so it now works correctly according to standard WMC details slide deck. The solution was a LOT of MCML code with panels, commands, parameters and timers that controlled the movement of the focus and prevented navigation that would break the flow.

To be honest, this kind of "hacking" would not be allowed in my daily work as a developer, but in the world of MCML, anything goes. The final thing I ahve to solve is how to disable animations when the scroller "accidentialy" get focus when moving position. I guess more mumbo jumbo control flags, but to be honest, I am not sure it is worth the time. THe gallery, for example, has a focusoff and focuson animation that dim it slightly. I only want to run this animation when it is the USER that put focus, not the Repeater.NavigateIntoIndex. But so far, no solution is in sight, the normal bool flags that I tried to set when invoking commands didn't work as expected, I guess it depends on where in the call chain the animations actually run. I tried to set a flag FocusVisuals to false when I invoked a command that navigated the index, but the this was false no matter what I tried. THere might be some solution to this, or maybe I was just tired, but I couldn't make it work... maybe some other day.

The app is a video browser for swedish public service tv (streamed rtmpe). The app itself is fairly basic, browse catregories, select show, select episode, play, add show to favorites etc. The thing that has taken 80 5 of the time is to make it WMC lookalike (I don't care what the MSFT people says, WMC users want a unified user inteface) and it is looking good right now, some minor UI polishing left to do. I also ahve to write a better cache manager for the metadata, and an installation program is needed too. I guess maybe 30 hours of dev time left.

I will publish some screenies here when I am confident it actually works as intended...

Scroller problem SOLVED!

/H

Post Reply