MainView.xaml 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. <UserControl xmlns="https://github.com/avaloniaui"
  2. xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  3. xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
  4. xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
  5. xmlns:vm="clr-namespace:SafeAreaDemo.ViewModels"
  6. mc:Ignorable="d"
  7. d:DesignWidth="800"
  8. d:DesignHeight="450"
  9. x:Class="SafeAreaDemo.Views.MainView"
  10. x:DataType="vm:MainViewModel">
  11. <Grid HorizontalAlignment="Stretch"
  12. VerticalAlignment="Stretch">
  13. <Border BorderBrush="Red"
  14. Margin="{Binding ViewPadding}"
  15. BorderThickness="1">
  16. <Grid>
  17. <Label Margin="5"
  18. Foreground="Red"
  19. HorizontalAlignment="Stretch"
  20. HorizontalContentAlignment="Right">View Bounds</Label>
  21. <Label Margin="5"
  22. Foreground="Red"
  23. VerticalAlignment="Bottom"
  24. HorizontalContentAlignment="Right">View Bounds</Label>
  25. </Grid>
  26. </Border>
  27. <Border BorderBrush="LimeGreen"
  28. Margin="{Binding SafeAreaPadding}"
  29. BorderThickness="1">
  30. <DockPanel>
  31. <Label Margin="5"
  32. Foreground="LimeGreen"
  33. DockPanel.Dock="Bottom"
  34. HorizontalAlignment="Stretch"
  35. HorizontalContentAlignment="Left" >Safe Area</Label>
  36. <Grid DockPanel.Dock="Bottom"
  37. HorizontalAlignment="Stretch"
  38. VerticalAlignment="Stretch">
  39. <StackPanel Orientation="Vertical"
  40. HorizontalAlignment="Center"
  41. VerticalAlignment="Center">
  42. <Label HorizontalAlignment="Left">Options:</Label>
  43. <CheckBox IsChecked="{Binding Fullscreen}">Fullscreen</CheckBox>
  44. <CheckBox IsChecked="{Binding UseSafeArea}">Use Safe Area</CheckBox>
  45. <CheckBox IsChecked="{Binding HideSystemBars}">Hide System Bars</CheckBox>
  46. <TextBox Width="200" Watermark="Tap to Show Keyboard"/>
  47. </StackPanel>
  48. </Grid>
  49. </DockPanel>
  50. </Border>
  51. </Grid>
  52. </UserControl>