The Media Center Sandbox

Resources and discussion for developing experiences in the Windows Media Center platform.
Welcome to The Media Center Sandbox Sign in | Join | Help
in Search

How can you change the item in focus in a repeater without giving the focus to the repeater?

Last post 07-17-2010, 12:34 AM by AndyC. 5 replies.
Sort Posts: Previous Next
  •  07-14-2010, 11:39 PM 9714

    How can you change the item in focus in a repeater without giving the focus to the repeater?

    Hi

    How can you change the item in focus in a repeater without giving the focus to the repeater?

    I tried using the NavigateIntoIndex in a rule. This works almost, however the focus changes to the repeater item. Sure this is the intention by that method, but is there some other way to change the currently selected item of a repeater without having focus on the item in the repeater?

    An example of what I am trying to do could be this:

    You have a list of items and above a button called “move to next item”. Then clicking on the button will move the repeater one step down, without removing the focus of the button. If you continue to press the button the repeater will end up scrolling to the end.

    Is this possible?

    Thanks

    Kim
  •  07-15-2010, 10:38 AM 9715 in reply to 9714

    Re: How can you change the item in focus in a repeater without giving the focus to the repeater?

    Hi Kim,

    The way you are trying to do this deviates from the way that Media Center does things... if you look at how the up/down buttons work in Media Center, they are not focusable with the keyboard, only the mouse, and the mouse click doesn't affect the focus which is on the item selected in the list. Clicking on the up/down button moves to the previous/next item in the list, with the focus.

    Your options are to use NavigateIntoIndex to set the focus, and then use NavigateInto to get back to the button, or alternatively there is a private API that would be able to do this for you - search this forum for AreaOfInterestLayout. Bear in mind that this is an internal API call, may change without notice via a Windows update (though not very likely I think), and may change with new versions of Windows.

    Given the above, I'd recomend using the same approach Media Center uses itself (mouse focusable up/down buttons, with the key focus on the item in the list) rather than invent a new UI approach.

    Cheers,
    Andrew
  •  07-15-2010, 1:17 PM 9716 in reply to 9715

    Re: How can you change the item in focus in a repeater without giving the focus to the repeater?

    Okay, thanks

    Perhaps I am getting this wrong, but is it not how WMC works in the music libaray, where you select the different headlines and the content area below shifts right and left.

    If the content area is not a repeater, how is it then made?

    Thanks

    Kim
  •  07-15-2010, 11:59 PM 9717 in reply to 9716

    Re: How can you change the item in focus in a repeater without giving the focus to the repeater?

    What you're describing there is a pivot menu. Selecting a different pivot item initiates an action that is either to replace the current repeater source content with new content (e.g. when you change from "albums" to "artists"), or to sort the repeater source (e.g. when you change from "by title" to "by date").

    You don't need to NavigateIntoIndex to do either of these things - you just change the repeater contents.

    Cheers,
    Andrew
  •  07-16-2010, 1:00 AM 9718 in reply to 9717

    Re: How can you change the item in focus in a repeater without giving the focus to the repeater?

    Ok, I see

    Just thought it was the repeater that did the sliding to the right and left when the menu changed.

    But thanks for pointing this out
  •  07-17-2010, 12:34 AM 9719 in reply to 9718

    Re: How can you change the item in focus in a repeater without giving the focus to the repeater?

    The actual sliding is done with Show and Hide animations attached when you navigate left/right.

    The pivot menu is one of the hardest controls in Media Center to emulate well - it uses some quite involved techniques to get the effect you see.

    Cheers,
    Andrew
View as RSS news feed in XML
Powered by Community Server, by Telligent Systems