LabelsPage.axaml 2.6 KB

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