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

PgUp and PgDown on non-scroller

Last post 09-15-2011, 2:24 PM by joocer. 2 replies.
Sort Posts: Previous Next
  •  07-19-2011, 1:59 PM 10123

    PgUp and PgDown on non-scroller

    I have a panel with a set of buttons, it responds as expected to the up and down keys but I also want it to respond to Page Up and Page Down keys as well.

    <Panel Navigation="ContainAll">
    <Layout>
    <FlowLayout Orientation="Vertical" ItemAlignment="Near"/>
    </Layout>
    <Children>
    <me:buttonImage Command="[CmdPlayAll]" Name="cmdPlay" />
    <me:buttonImage Command="[CmdAddToQueue]" Name="cmdQueue" />
    <me:buttonImage Command="[CmdShuffle]" Name="cmdShuffle" />
    <me:buttonImage Command="[CmdResume]" Name="cmdResume"/>
    <me:buttonImage Command="[CmdPause]" Name="cmdPause" />
    <me:buttonImage Command="[CmdClose]" Name="cmdClose" />
    </Children>
    </Panel>

    I've tried a shortcut handler for the keys and then this:

    <Changed Source="[CmdPgUp.Invoked]">
    <Actions>
    <Invoke Target="[cmdPlay.NavigateInto]"/>
    </Actions>
    </Changed>

    but nothing happens. NavigateIntoIndex, Home, Scroll all fail to compile as it's not a valid for a Panel. Am I missing a command or method that would allow me to do this.
  •  07-20-2011, 11:15 PM 10124 in reply to 10123

    Re: PgUp and PgDown on non-scroller

    If you put the items into a repeater and put that inside a scroller (even if they aren't scrolling), then you can wire up the keys correctly in the same way as the "ScrollingData - Repeater" samples in the SDK.

    Cheers,
    Andrew
  •  09-15-2011, 2:24 PM 10133 in reply to 10124

    Re: PgUp and PgDown on non-scroller

    Thanks Andy, if I do that I appear to lose the ability to hide specific buttons (e.g. if nothing is playing then the "Pause" button would be hidden). I could do this if I put that logic into the building of the button list or built a ModelItem to sit behind them to fire a trigger for the Visible attribute to change. I was thinking there must be a simpler way to get either automatically handle PageUp and PageDown or for me to set focus to a specific control within MCML.
View as RSS news feed in XML
Powered by Community Server, by Telligent Systems