|
| 1 | +<App Theme="Basic"> |
| 2 | + <DockPanel> |
| 3 | + <TopFrameBackground Dock="Top" /> |
| 4 | + <Panel> |
| 5 | + <Rectangle ux:Name="newLayoutMaster" Width="50" Height="50" Color="#8889" Alignment="TopLeft" Margin="20,50"/> |
| 6 | + <StackPanel Alignment="Top"> |
| 7 | + <TextInput PlaceholderText="Click me to show the keyboard" Alignment="Center"> |
| 8 | + <WhileKeyboardVisible> |
| 9 | + <Move Target="rect3" RelativeTo="Keyboard" Y="-1" Duration="0.5" /> |
| 10 | + </WhileKeyboardVisible> |
| 11 | + </TextInput> |
| 12 | + <Button Text="Click me" Alignment="Center"> |
| 13 | + <WhilePressed> |
| 14 | + <Move Target="rect1" RelativeTo="Size" Y="-1" Duration="0.5" /> |
| 15 | + <Move Target="rect2" RelativeTo="ParentSize" Y="-1" Duration="0.5" /> |
| 16 | + <Move Target="rect5" RelativeTo="Size" RelativeNode="relativeNode" Y="-1" Duration="0.5" /> |
| 17 | + </WhilePressed> |
| 18 | + </Button> |
| 19 | + <Switch> |
| 20 | + <WhileTrue> |
| 21 | + <Change rect4.LayoutMaster="newLayoutMaster" /> |
| 22 | + </WhileTrue> |
| 23 | + </Switch> |
| 24 | + </StackPanel> |
| 25 | + <Rectangle ux:Name="relativeNode" Height="400" Width="50" Color="#bbf" Alignment="BottomRight"> |
| 26 | + <VerticalText Alignment="Center" Width="200">relativeNode</VerticalText> |
| 27 | + </Rectangle> |
| 28 | + |
| 29 | + <Text ux:Class="VerticalText" TransformOrigin="Center" Alignment="Bottom" TextColor="#000"> |
| 30 | + <Rotation Degrees="-90" /> |
| 31 | + </Text> |
| 32 | + |
| 33 | + <Grid ColumnCount="5" Rows="3*,1*" Color="#ddd" Width="80%" Height="100%" Alignment="BottomLeft"> |
| 34 | + <VerticalText Width="200">RelativeTo="Size"</VerticalText> |
| 35 | + <VerticalText Width="200">RelativeTo="ParentSize"</VerticalText> |
| 36 | + <VerticalText Width="200">RelativeTo="Keyboard"</VerticalText> |
| 37 | + <VerticalText Width="200">RelativeTo="PositionChange"</VerticalText> |
| 38 | + <VerticalText Width="200">RelativeNode="relativeNode"</VerticalText> |
| 39 | + |
| 40 | + |
| 41 | + |
| 42 | + <Rectangle ux:Name="rect1" Width="50" Height="50" Color="#f00" Alignment="Bottom"/> |
| 43 | + <Rectangle ux:Name="rect2" Width="50" Height="50" Color="#0f0" Alignment="Bottom"/> |
| 44 | + <Rectangle ux:Name="rect3" Width="50" Height="50" Color="#00f" Alignment="Bottom"/> |
| 45 | + <Panel Alignment="Bottom" Width="50" Height="50"> |
| 46 | + <Rectangle ux:Name="rect4" Width="50" Height="50" Color="#0ff" LayoutMaster="layoutMaster"> |
| 47 | + <LayoutAnimation> |
| 48 | + <Move RelativeTo="PositionChange" X="1" Y="1" Duration="0.5" /> |
| 49 | + </LayoutAnimation> |
| 50 | + </Rectangle> |
| 51 | + <Rectangle ux:Name="layoutMaster" Width="50" Height="50"/> |
| 52 | + </Panel> |
| 53 | + <Rectangle ux:Name="rect5" Width="50" Height="50" Color="#f0f" Alignment="Bottom"/> |
| 54 | + </Grid> |
| 55 | + </Panel> |
| 56 | + </DockPanel> |
| 57 | +</App> |
0 commit comments