NavigationPageEventsPage.xaml 3.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. <UserControl xmlns="https://github.com/avaloniaui"
  2. xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  3. x:Class="ControlCatalog.Pages.NavigationPageEventsPage">
  4. <DockPanel>
  5. <ScrollViewer DockPanel.Dock="Right" Width="280">
  6. <StackPanel Margin="12" Spacing="16">
  7. <TextBlock Text="Configuration" FontSize="16" FontWeight="SemiBold"
  8. Foreground="{DynamicResource SystemControlHighlightAccentBrush}" />
  9. <TextBlock Text="Navigation" FontSize="13" FontWeight="SemiBold" />
  10. <StackPanel Spacing="6">
  11. <Button Content="Push Page"
  12. HorizontalAlignment="Stretch"
  13. Click="OnPush" />
  14. <Button Content="Pop"
  15. HorizontalAlignment="Stretch"
  16. Click="OnPop" />
  17. <Button Content="Pop to Root"
  18. HorizontalAlignment="Stretch"
  19. Click="OnPopToRoot" />
  20. <Button Content="Insert Page"
  21. HorizontalAlignment="Stretch"
  22. Click="OnInsertPage" />
  23. <Button Content="Remove Page"
  24. HorizontalAlignment="Stretch"
  25. Click="OnRemovePage" />
  26. </StackPanel>
  27. <TextBlock Text="Modal" FontSize="13" FontWeight="SemiBold" />
  28. <StackPanel Spacing="6">
  29. <Button Content="Push Modal"
  30. HorizontalAlignment="Stretch"
  31. Click="OnPushModal" />
  32. <Button Content="Pop Modal"
  33. HorizontalAlignment="Stretch"
  34. Click="OnPopModal" />
  35. </StackPanel>
  36. <Separator />
  37. <!-- Event Log -->
  38. <DockPanel>
  39. <TextBlock DockPanel.Dock="Left" Text="Event Log" FontSize="13" FontWeight="SemiBold"
  40. VerticalAlignment="Center" />
  41. <Button DockPanel.Dock="Right" Content="Clear" Click="OnClearLog"
  42. HorizontalAlignment="Right" Padding="8,2" FontSize="11" />
  43. </DockPanel>
  44. <Border Background="{DynamicResource SystemControlBackgroundBaseLowBrush}"
  45. CornerRadius="4" Padding="8" MinHeight="120" MaxHeight="250">
  46. <ScrollViewer VerticalScrollBarVisibility="Auto">
  47. <StackPanel x:Name="LogPanel" Spacing="1" />
  48. </ScrollViewer>
  49. </Border>
  50. <Separator />
  51. <!-- IsNavigating indicator -->
  52. <TextBlock Text="Status" FontSize="13" FontWeight="SemiBold" />
  53. <TextBlock Text="{Binding IsNavigating, ElementName=DemoNav, StringFormat='IsNavigating: {0}'}"
  54. FontSize="12" />
  55. <Separator />
  56. <TextBlock Text="NavigationPage exposes events for push, pop, insert, remove, and modal operations. Pages also fire NavigatedTo and NavigatedFrom on each navigation."
  57. TextWrapping="Wrap" FontSize="12" Opacity="0.7" />
  58. </StackPanel>
  59. </ScrollViewer>
  60. <Border DockPanel.Dock="Right" Width="1" Background="{DynamicResource SystemControlForegroundBaseMediumLowBrush}" />
  61. <Border Margin="12"
  62. BorderBrush="{DynamicResource SystemControlForegroundBaseMediumLowBrush}"
  63. BorderThickness="1"
  64. CornerRadius="6"
  65. ClipToBounds="True">
  66. <NavigationPage x:Name="DemoNav" />
  67. </Border>
  68. </DockPanel>
  69. </UserControl>