OptionSelectorView.axaml 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738
  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:components="using:InABox.Avalonia.Components"
  6. mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450"
  7. x:Class="InABox.Avalonia.Components.OptionSelectorView"
  8. x:DataType="components:OptionSelectorViewModel">
  9. <Grid>
  10. <Grid.RowDefinitions>
  11. <RowDefinition Height="Auto"/>
  12. <RowDefinition Height="Auto"/>
  13. <RowDefinition Height="Auto"/>
  14. </Grid.RowDefinitions>
  15. <Grid.ColumnDefinitions>
  16. <ColumnDefinition Width="*"/>
  17. </Grid.ColumnDefinitions>
  18. <Label Grid.Row="0"
  19. FontSize="{StaticResource PrsFontSizeLarge}"
  20. Content="{Binding Title}"/>
  21. <ItemsControl Grid.Row="1" ItemsSource="{Binding Options}">
  22. <ItemsControl.ItemTemplate>
  23. <DataTemplate>
  24. <Button Classes="Transparent"
  25. Content="{Binding}"
  26. CommandParameter="{Binding}"
  27. Padding="10"
  28. Command="{Binding $parent[components:OptionSelectorView].((components:OptionSelectorViewModel)DataContext).SelectCommand}"
  29. HorizontalContentAlignment="Left"/>
  30. </DataTemplate>
  31. </ItemsControl.ItemTemplate>
  32. </ItemsControl>
  33. <DockPanel Grid.Row="2" LastChildFill="False">
  34. <Button Content="Cancel" DockPanel.Dock="Right" Command="{Binding CancelCommand}"
  35. Classes="Standard"/>
  36. </DockPanel>
  37. </Grid>
  38. </UserControl>