MainWindow.xaml 1.6 KB

123456789101112131415161718192021222324252627282930313233343536
  1. <Window xmlns="https://github.com/avaloniaui"
  2. Title="Avalonia Virtualization Test">
  3. <DockPanel LastChildFill="True" Margin="16">
  4. <StackPanel DockPanel.Dock="Right"
  5. Margin="16 0 0 0"
  6. MinWidth="150"
  7. Gap="4">
  8. <TextBox Watermark="Item Count"
  9. UseFloatingWatermark="True"
  10. Text="{Binding ItemCount}"/>
  11. <TextBox Watermark="Extent"
  12. UseFloatingWatermark="True"
  13. Text="{Binding #listBox.Scroll.Extent, Mode=OneWay}"/>
  14. <TextBox Watermark="Offset"
  15. UseFloatingWatermark="True"
  16. Text="{Binding #listBox.Scroll.Offset, Mode=OneWay}"/>
  17. <TextBox Watermark="Viewport"
  18. UseFloatingWatermark="True"
  19. Text="{Binding #listBox.Scroll.Viewport, Mode=OneWay}"/>
  20. <TextBox Watermark="Item to Create"
  21. UseFloatingWatermark="True"
  22. Text="{Binding NewItemString}"/>
  23. <Button Command="{Binding AddItemCommand}">Add Item</Button>
  24. <Button Command="{Binding RemoveItemCommand}">Remove Item</Button>
  25. <Button Command="{Binding RecreateCommand}">Recreate</Button>
  26. </StackPanel>
  27. <ListBox Name="listBox" Items="{Binding Items}" SelectedItem="{Binding SelectedItem}">
  28. <ListBox.ItemTemplate>
  29. <DataTemplate>
  30. <TextBlock Text="{Binding Header}"/>
  31. </DataTemplate>
  32. </ListBox.ItemTemplate>
  33. </ListBox>
  34. </DockPanel>
  35. </Window>