NavigationPageInteractiveHeaderPage.xaml 1.7 KB

1234567891011121314151617181920212223242526
  1. <UserControl xmlns="https://github.com/avaloniaui"
  2. xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  3. x:Class="ControlCatalog.Pages.NavigationPageInteractiveHeaderPage">
  4. <DockPanel>
  5. <ScrollViewer DockPanel.Dock="Right" Width="260">
  6. <StackPanel Margin="12" Spacing="8">
  7. <TextBlock Text="How It Works" FontSize="16" FontWeight="SemiBold"
  8. Foreground="{DynamicResource SystemControlHighlightAccentBrush}" />
  9. <TextBlock TextWrapping="Wrap" Opacity="0.7" FontSize="12"
  10. Text="Page.Header accepts any Control, not just strings. A Grid in the header divides the nav bar: the page title stretches on the left, and a search box sits on the right. Both share the same data so typing immediately filters the contact list." />
  11. <Separator />
  12. <TextBlock Text="Key Points" FontWeight="SemiBold" />
  13. <TextBlock FontSize="11" TextWrapping="Wrap" Text="• Header = any Control, not just a string" />
  14. <TextBlock FontSize="11" TextWrapping="Wrap" Text="• Grid: title (*) + search box (Auto)" />
  15. <TextBlock FontSize="11" TextWrapping="Wrap" Text="• One ViewModel shared by header and content" />
  16. <TextBlock FontSize="11" TextWrapping="Wrap" Text="• Typing instantly filters via ObservableCollection" />
  17. </StackPanel>
  18. </ScrollViewer>
  19. <Border DockPanel.Dock="Right" Width="1" Background="{DynamicResource SystemControlForegroundBaseMediumLowBrush}" />
  20. <Border Margin="12"
  21. BorderBrush="{DynamicResource SystemControlForegroundBaseMediumLowBrush}"
  22. BorderThickness="1" CornerRadius="6" ClipToBounds="True">
  23. <NavigationPage x:Name="DemoNav" />
  24. </Border>
  25. </DockPanel>
  26. </UserControl>