CursorPage.xaml 1.0 KB

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