Move panel to the top of the screen


i would like to move a panel to the top of the screen when the keyboard is visible but i don’t know how to do it. Not relative to Keyboard or “Size”.



You can try something along the lines of:

    <Change myPanel.Alignment="Top" />

You can do arbitrary things in the WhileKeyboardVisible-trigger.


thnx for ur answer but that does not solve my problem as even if u align the panel Top that won’t work if the panel is inside an StackPanel.

I am looking for something similar to:

<Move Y="-1" Duration="1" Easing="CircularOut" RelativeTo="ParentSize"/>

but i would like to say something like: “relative to StatusBar” o “relative to TopOfTheScreen”


You can Move relative to any node using the RelativeNode property:

<Move Target="yourElement" Y="-1" RelativeTo="Size" RelativeNode="yourBottomBar"/>

That’s way closer to what i was looking for :slight_smile:

but i still have a problem… maybe i should change the layout:

        <Panel ux:Name="Header" Dock="Top">

        <Panel ux:Name="Login" Dock="Top">
            <Text> .. <TextInput> .. <Button>

when i move the Login Panel up it dissapears under the header panel is there a “bring to front” atribute? should i change the Header opacity?

There is a <BringToFront /> trigger that you can use, at the same time as your Move


just one final question:

if i am not wrong:

<Move Target="yourElement" Y="-1" RelativeTo="Size" RelativeNode="yourBottomBar"/>

means: yourElement.Y = yourElement.Y + (yourBottomBar.Y * -1)

i would like to move it where “yourBottomBar” is:

yourElement.Y = yourBottomBar.Y

is that possible?