NavigationPageModalPage.xaml 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. <UserControl xmlns="https://github.com/avaloniaui"
  2. xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  3. x:Class="ControlCatalog.Pages.NavigationPageModalPage">
  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. <!-- Modal Actions -->
  10. <TextBlock Text="Modal Actions" FontSize="13" FontWeight="SemiBold" />
  11. <StackPanel Spacing="6">
  12. <Button x:Name="PushModalButton"
  13. Content="Push Modal"
  14. HorizontalAlignment="Stretch"
  15. Click="OnPushModal" />
  16. <Button x:Name="PopModalButton"
  17. Content="Pop Modal"
  18. HorizontalAlignment="Stretch"
  19. Click="OnPopModal" />
  20. <Button x:Name="PopAllModalsButton"
  21. Content="Pop All Modals"
  22. HorizontalAlignment="Stretch"
  23. Click="OnPopAllModals" />
  24. </StackPanel>
  25. <Separator />
  26. <!-- Modal Transition -->
  27. <TextBlock Text="Modal Transition" FontSize="13" FontWeight="SemiBold" />
  28. <ComboBox x:Name="TransitionCombo"
  29. SelectedIndex="0"
  30. HorizontalAlignment="Stretch"
  31. SelectionChanged="OnTransitionChanged">
  32. <ComboBoxItem Content="Slide from Bottom" />
  33. <ComboBoxItem Content="CrossFade" />
  34. <ComboBoxItem Content="None" />
  35. </ComboBox>
  36. <Separator />
  37. <TextBlock Text="Modal pages slide up from the bottom and dismiss by sliding back down. The ModalTransition property controls this animation independently from the stack PageTransition."
  38. TextWrapping="Wrap" FontSize="12" Opacity="0.7" />
  39. <Separator />
  40. <TextBlock Text="Status" FontWeight="SemiBold" FontSize="13" />
  41. <TextBlock x:Name="StatusText"
  42. Text="Modals: 0"
  43. Opacity="0.7"
  44. TextWrapping="Wrap" />
  45. </StackPanel>
  46. </ScrollViewer>
  47. <Border DockPanel.Dock="Right" Width="1" Background="{DynamicResource SystemControlForegroundBaseMediumLowBrush}" />
  48. <Border Margin="12"
  49. BorderBrush="{DynamicResource SystemControlForegroundBaseMediumLowBrush}"
  50. BorderThickness="1"
  51. CornerRadius="6"
  52. ClipToBounds="True">
  53. <NavigationPage x:Name="DemoNav" />
  54. </Border>
  55. </DockPanel>
  56. </UserControl>