NavigationPagePerformancePage.xaml 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. <UserControl xmlns="https://github.com/avaloniaui"
  2. xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  3. x:Class="ControlCatalog.Pages.NavigationPagePerformancePage">
  4. <Grid ColumnDefinitions="*,240">
  5. <!-- Left: NavigationPage + Operation log -->
  6. <DockPanel Grid.Column="0" Margin="12">
  7. <DockPanel DockPanel.Dock="Bottom" Height="130" Margin="0,8,0,0">
  8. <DockPanel DockPanel.Dock="Top" Margin="0,0,0,4">
  9. <TextBlock Text="Operation Log"
  10. FontSize="12" FontWeight="SemiBold"
  11. VerticalAlignment="Center" />
  12. <Button x:Name="ClearLogButton" Content="Clear"
  13. FontSize="11" Padding="8,2"
  14. HorizontalAlignment="Right"
  15. Click="OnClearLog" />
  16. </DockPanel>
  17. <Border BorderBrush="{DynamicResource SystemControlForegroundBaseMediumLowBrush}"
  18. BorderThickness="1" CornerRadius="4" ClipToBounds="True">
  19. <ScrollViewer x:Name="LogScrollViewer">
  20. <StackPanel x:Name="LogPanel" Spacing="0" />
  21. </ScrollViewer>
  22. </Border>
  23. </DockPanel>
  24. <Border BorderBrush="{DynamicResource SystemControlForegroundBaseMediumLowBrush}"
  25. BorderThickness="1" CornerRadius="6" ClipToBounds="True">
  26. <NavigationPage x:Name="DemoNav" />
  27. </Border>
  28. </DockPanel>
  29. <!-- Right: Metrics + Actions -->
  30. <Border Grid.Column="1"
  31. BorderBrush="{DynamicResource SystemControlForegroundBaseMediumLowBrush}"
  32. BorderThickness="1,0,0,0" Padding="12">
  33. <ScrollViewer>
  34. <StackPanel Spacing="8">
  35. <TextBlock Text="Metrics" FontWeight="SemiBold" />
  36. <TextBlock x:Name="StackDepthText" Text="Stack Depth: 0" FontSize="12" />
  37. <TextBlock x:Name="LiveInstancesText" Text="Live Page Instances: 0" FontSize="12" />
  38. <TextBlock x:Name="TotalCreatedText" Text="Total Pages Created: 0" FontSize="12" />
  39. <DockPanel>
  40. <TextBlock x:Name="ManagedMemoryText" Text="Managed Heap: 0.0 MB" FontSize="12" />
  41. <TextBlock x:Name="MemoryDeltaText" Text=""
  42. FontSize="12" FontWeight="SemiBold" Margin="6,0,0,0" />
  43. </DockPanel>
  44. <TextBlock x:Name="LastOpTimeText" Text="Last Op: —" FontSize="12" />
  45. <Separator />
  46. <TextBlock Text="Actions" FontWeight="SemiBold" />
  47. <Button Content="Push Page" HorizontalAlignment="Stretch" Click="OnPush" />
  48. <Button Content="Push 5 Pages" HorizontalAlignment="Stretch" Click="OnPush5" />
  49. <Button Content="Pop Page" HorizontalAlignment="Stretch" Click="OnPop" />
  50. <Button Content="Pop to Root" HorizontalAlignment="Stretch" Click="OnPopToRoot" />
  51. <Separator />
  52. <Button x:Name="ForceGCButton" Content="Force GC + Refresh"
  53. HorizontalAlignment="Stretch"
  54. Click="OnForceGC" />
  55. <CheckBox x:Name="AutoRefreshCheck" Content="Auto-refresh (2s)"
  56. FontSize="12"
  57. IsCheckedChanged="OnAutoRefreshChanged" />
  58. <Separator />
  59. <TextBlock Text="Stack" FontWeight="SemiBold" />
  60. <TextBlock Text="▲ Current (top)" FontSize="10" Opacity="0.45" Margin="0,-2,0,0" />
  61. <StackPanel x:Name="StackItemsPanel" Spacing="4" />
  62. <TextBlock Text="▼ Root (bottom)" FontSize="10" Opacity="0.45" />
  63. </StackPanel>
  64. </ScrollViewer>
  65. </Border>
  66. </Grid>
  67. </UserControl>