NavigationPageCurvedHeaderPage.xaml 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. <UserControl xmlns="https://github.com/avaloniaui"
  2. xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  3. x:Class="ControlCatalog.Pages.NavigationPageCurvedHeaderPage">
  4. <DockPanel>
  5. <ScrollViewer x:Name="InfoPanel" DockPanel.Dock="Right" Width="300">
  6. <StackPanel Margin="16" Spacing="16">
  7. <TextBlock Text="Curved Header Shop App" FontSize="16" FontWeight="SemiBold"
  8. Foreground="{DynamicResource SystemControlHighlightAccentBrush}" />
  9. <TextBlock TextWrapping="Wrap" FontSize="12" Opacity="0.7"
  10. Text="A dome-header pattern using a StreamGeometry clip updated on SizeChanged to give the nav bar area its elliptical bottom curve. The avatar floats at the dome tip, straddling the header/content boundary." />
  11. <Separator />
  12. <TextBlock Text="Key Techniques" FontSize="13" FontWeight="SemiBold" />
  13. <StackPanel Spacing="4">
  14. <TextBlock FontSize="12" TextWrapping="Wrap" Text="• Dome: StreamGeometry ArcTo on SizeChanged" />
  15. <TextBlock FontSize="12" TextWrapping="Wrap" Text="• Avatar: Canvas overlay, centered at dome Y" />
  16. <TextBlock FontSize="12" TextWrapping="Wrap" Text="• Home: SetHasNavigationBar(page, false)" />
  17. <TextBlock FontSize="12" TextWrapping="Wrap" Text="• Profile: BarLayoutBehavior.Overlay (transparent bar)" />
  18. <TextBlock FontSize="12" TextWrapping="Wrap" Text="• Tap a featured card or recommended item to open the profile page" />
  19. </StackPanel>
  20. <Separator />
  21. <TextBlock Text="API Notes" FontSize="13" FontWeight="SemiBold" />
  22. <TextBlock TextWrapping="Wrap" FontSize="12" Opacity="0.7"
  23. Text="The curved shape is achieved entirely in page content: no NavigationPage API changes needed. A future per-page SetBarBackground(page, brush) API would allow the Overlay back-button foreground to be driven by the page theme rather than the global NavigationBarForeground resource." />
  24. </StackPanel>
  25. </ScrollViewer>
  26. <Border BorderBrush="{DynamicResource SystemControlForegroundBaseMediumLowBrush}"
  27. BorderThickness="1" CornerRadius="8" ClipToBounds="True">
  28. <NavigationPage x:Name="NavPage"
  29. Background="#f6f7f8">
  30. <NavigationPage.Resources>
  31. <SolidColorBrush x:Key="NavigationBarBackground" Color="Transparent" />
  32. <SolidColorBrush x:Key="NavigationBarForeground" Color="White" />
  33. </NavigationPage.Resources>
  34. </NavigationPage>
  35. </Border>
  36. </DockPanel>
  37. </UserControl>