LabelsPage.axaml 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  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. mc:Ignorable="d" d:DesignWidth="400" d:DesignHeight="250"
  6. x:Class="ControlCatalog.Pages.LabelsPage"
  7. x:Name="_labelsPage">
  8. <UserControl.Styles>
  9. <Style Selector="Label">
  10. <Setter Property="VerticalAlignment" Value="Center"/>
  11. <Setter Property="Margin" Value="6,3,0,3"/>
  12. </Style>
  13. <Style Selector="TextBox">
  14. <Setter Property="VerticalAlignment" Value="Center"/>
  15. <Setter Property="Margin" Value="0,3,6,3"/>
  16. </Style>
  17. <Style Selector="CheckBox">
  18. <Setter Property="VerticalAlignment" Value="Center"/>
  19. <Setter Property="Margin" Value="0,3,6,3"/>
  20. </Style>
  21. <Style Selector="Button[IsDefault=true]">
  22. <Setter Property="Background" Value="{DynamicResource HighlightBrush}"/>
  23. </Style>
  24. </UserControl.Styles>
  25. <ScrollViewer VerticalScrollBarVisibility="Auto"
  26. HorizontalScrollBarVisibility="Hidden">
  27. <Grid HorizontalAlignment="Left" VerticalAlignment="Top" RowDefinitions="Auto,Auto,Auto,Auto,Auto,*" ColumnDefinitions="Auto,6,*" Width="246">
  28. <Label Target="firstNameEdit" Grid.Row="0" Grid.Column="0">_First name</Label>
  29. <TextBox Name="firstNameEdit" Grid.Column="2" Grid.Row="0" Text="{Binding FirstName}"></TextBox>
  30. <Label Target="lastNameEdit" Grid.Row="1" Grid.Column="0">_Last name</Label>
  31. <TextBox Name="lastNameEdit" Grid.Column="2" Grid.Row="1" Text="{Binding LastName}"></TextBox>
  32. <Label Target="bannedCheck" Grid.Row="2" Grid.Column="0">_Banned</Label>
  33. <CheckBox Name="bannedCheck" Grid.Column="2" Grid.Row="2" IsChecked="{Binding IsBanned}"></CheckBox>
  34. <GridSplitter Grid.Column="1" VerticalAlignment="Stretch" HorizontalAlignment="Stretch" Grid.RowSpan="3" >
  35. </GridSplitter>
  36. <StackPanel Grid.Column="0" Grid.Row="4" Grid.ColumnSpan="3" Orientation="Horizontal" HorizontalAlignment="Right">
  37. <Button IsCancel="True" Command="{Binding #_labelsPage.DoCancel}">Cancel</Button>
  38. <Button IsDefault="True" Command="{Binding #_labelsPage.DoSave}">Save</Button>
  39. </StackPanel>
  40. </Grid>
  41. </ScrollViewer>
  42. </UserControl>