NavigationPageTransitionsPage.xaml 2.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. <UserControl xmlns="https://github.com/avaloniaui"
  2. xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  3. x:Class="ControlCatalog.Pages.NavigationPageTransitionsPage">
  4. <DockPanel>
  5. <ScrollViewer DockPanel.Dock="Right" Width="260">
  6. <StackPanel Margin="12" Spacing="8">
  7. <TextBlock Text="Page Transition" />
  8. <ComboBox x:Name="TransitionCombo"
  9. SelectedIndex="1"
  10. HorizontalAlignment="Stretch"
  11. SelectionChanged="OnTransitionChanged">
  12. <ComboBoxItem Content="— Default —" IsEnabled="False" FontWeight="SemiBold" />
  13. <ComboBoxItem Content="Page Slide" />
  14. <ComboBoxItem Content="— Custom —" IsEnabled="False" FontWeight="SemiBold" />
  15. <ComboBoxItem Content="Parallax Slide" />
  16. <ComboBoxItem Content="Cross Fade" />
  17. <ComboBoxItem Content="Fade Through" />
  18. <ComboBoxItem Content="Page Slide (Horizontal)" />
  19. <ComboBoxItem Content="Page Slide (Vertical)" />
  20. <ComboBoxItem Content="Composite (Slide + Fade)" />
  21. <ComboBoxItem Content="None" />
  22. </ComboBox>
  23. <TextBlock Text="Duration (ms)" />
  24. <Slider x:Name="DurationSlider"
  25. Minimum="100"
  26. Maximum="1000"
  27. Value="300"
  28. TickFrequency="100"
  29. IsSnapToTickEnabled="True"
  30. ValueChanged="OnDurationChanged" />
  31. <TextBlock x:Name="DurationLabel"
  32. Text="300 ms"
  33. HorizontalAlignment="Center"
  34. Opacity="0.7" />
  35. <Separator />
  36. <Button Content="Push Page"
  37. HorizontalAlignment="Stretch"
  38. Click="OnPush" />
  39. <Button Content="Pop"
  40. HorizontalAlignment="Stretch"
  41. Click="OnPop" />
  42. <Separator />
  43. <TextBlock Text="Custom transitions"
  44. FontWeight="SemiBold" />
  45. <TextBlock TextWrapping="Wrap"
  46. Opacity="0.7"
  47. FontSize="11"
  48. Text="The Custom group shows IPageTransition implementations included in this sample. Use them as starting points for building your own transitions." />
  49. </StackPanel>
  50. </ScrollViewer>
  51. <Border DockPanel.Dock="Right" Width="1" Background="{DynamicResource SystemControlForegroundBaseMediumLowBrush}" />
  52. <Border Margin="12"
  53. BorderBrush="{DynamicResource SystemControlForegroundBaseMediumLowBrush}"
  54. BorderThickness="1"
  55. CornerRadius="6"
  56. ClipToBounds="True">
  57. <NavigationPage x:Name="DemoNav" />
  58. </Border>
  59. </DockPanel>
  60. </UserControl>