DecoratedWindow.xaml 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. <Window xmlns="https://github.com/avaloniaui" MinWidth="500" MinHeight="300"
  2. xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  3. x:Class="ControlCatalog.DecoratedWindow"
  4. Title="Avalonia Control Gallery"
  5. SystemDecorations="None" Name="Window">
  6. <NativeMenu.Menu>
  7. <NativeMenu>
  8. <NativeMenuItem Header="Decorated">
  9. <NativeMenu>
  10. <NativeMenuItem Header="Open"/>
  11. <NativeMenuItem Header="Recent">
  12. <NativeMenuItem.Menu>
  13. <NativeMenu/>
  14. </NativeMenuItem.Menu>
  15. </NativeMenuItem>
  16. <NativeMenuItem Header="Quit Avalonia" Gesture="CMD+Q"/>
  17. </NativeMenu>
  18. </NativeMenuItem>
  19. <NativeMenuItem Header="Edit">
  20. <NativeMenu>
  21. <NativeMenuItem Header="Copy"/>
  22. <NativeMenuItem Header="Paste"/>
  23. </NativeMenu>
  24. </NativeMenuItem>
  25. </NativeMenu>
  26. </NativeMenu.Menu>
  27. <Grid RowDefinitions="5,*,5" ColumnDefinitions="5,*,5">
  28. <DockPanel Grid.Column="1" Grid.Row="1" >
  29. <Grid Name="TitleBar" Background="LightBlue" DockPanel.Dock="Top" ColumnDefinitions="Auto,*,Auto">
  30. <TextBlock VerticalAlignment="Center" Margin="5,0,0,0">Title</TextBlock>
  31. <StackPanel Grid.Column="2" Orientation="Horizontal">
  32. <StackPanel.Styles>
  33. <Style Selector="Button">
  34. <Setter Property="Margin" Value="2"/>
  35. </Style>
  36. </StackPanel.Styles>
  37. <Button Name="MinimizeButton">_</Button>
  38. <Button Name="MaximizeButton">[ ]</Button>
  39. <Button Name="CloseButton">X</Button>
  40. </StackPanel>
  41. </Grid>
  42. <Border Background="White" Margin="5">
  43. <StackPanel>
  44. <TextBlock>Hello world!</TextBlock>
  45. <ComboBox SelectedItem="{Binding ElementName=Window, Path=SystemDecorations}">
  46. <ComboBox.Items>
  47. <SystemDecorations>None</SystemDecorations>
  48. <SystemDecorations>BorderOnly</SystemDecorations>
  49. <SystemDecorations>Full</SystemDecorations>
  50. </ComboBox.Items>
  51. </ComboBox>
  52. <CheckBox IsChecked="{Binding ElementName=Window, Path=CanResize}">CanResize</CheckBox>
  53. </StackPanel>
  54. </Border>
  55. </DockPanel>
  56. <Border Name="TopLeft" Background="Red"/>
  57. <Border Name="TopRight" Background="Red" Grid.Column="2" />
  58. <Border Name="BottomLeft" Background="Red" Grid.Row="2" />
  59. <Border Name="BottomRight" Background="Red" Grid.Row="2" Grid.Column="2"/>
  60. <Border Name="Top" Background="Blue" Grid.Column="1" />
  61. <Border Name="Right" Background="Blue" Grid.Row="1" Grid.Column="2" />
  62. <Border Name="Bottom" Background="Blue" Grid.Row="2" Grid.Column="1" />
  63. <Border Name="Left" Background="Blue" Grid.Row="1" />
  64. </Grid>
  65. </Window>