1
0

CursorPage.xaml 1.2 KB

123456789101112131415161718192021222324252627282930
  1. <UserControl xmlns="https://github.com/avaloniaui"
  2. xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  3. xmlns:viewModels="using:ControlCatalog.ViewModels"
  4. x:Class="ControlCatalog.Pages.CursorPage"
  5. x:DataType="viewModels:CursorPageViewModel">
  6. <Grid ColumnDefinitions="*,*" RowDefinitions="Auto,*">
  7. <StackPanel Grid.ColumnSpan="2" Orientation="Vertical" Spacing="4">
  8. <TextBlock Classes="h2">Defines a cursor (mouse pointer)</TextBlock>
  9. </StackPanel>
  10. <ListBox Grid.Row="1" Items="{Binding StandardCursors}" Margin="0 8 8 8">
  11. <ListBox.Styles>
  12. <Style Selector="ListBoxItem">
  13. <Setter Property="Cursor" Value="{Binding Cursor}" x:DataType="viewModels:StandardCursorModel"/>
  14. </Style>
  15. </ListBox.Styles>
  16. <ListBox.ItemTemplate>
  17. <DataTemplate>
  18. <TextBlock Text="{Binding Type}"/>
  19. </DataTemplate>
  20. </ListBox.ItemTemplate>
  21. </ListBox>
  22. <StackPanel Grid.Column="1" Grid.Row="1" Margin="8 8 0 8">
  23. <Button Cursor="{Binding CustomCursor}" Margin="0 8" Padding="16">
  24. <TextBlock>Custom Cursor</TextBlock>
  25. </Button>
  26. </StackPanel>
  27. </Grid>
  28. </UserControl>