ModernAppPage.xaml 9.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176
  1. <UserControl xmlns="https://github.com/avaloniaui"
  2. xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  3. x:Class="ControlCatalog.Pages.ModernAppPage">
  4. <UserControl.Resources>
  5. <!-- Color tokens -->
  6. <SolidColorBrush x:Key="ModernPrimary" Color="#0dccf2"/>
  7. <SolidColorBrush x:Key="ModernBg" Color="#f5f8f8"/>
  8. <SolidColorBrush x:Key="ModernDark" Color="#101f22"/>
  9. <SolidColorBrush x:Key="ModernSurface" Color="#1a2e33"/>
  10. <SolidColorBrush x:Key="ModernMuted" Color="#8a9ba3"/>
  11. <SolidColorBrush x:Key="ModernBorder" Color="#dde6e9"/>
  12. </UserControl.Resources>
  13. <DockPanel>
  14. <!-- Info panel (desktop only, >= 640 px) -->
  15. <ScrollViewer x:Name="InfoPanel" DockPanel.Dock="Right" Width="290" IsVisible="False">
  16. <StackPanel Margin="16" Spacing="16">
  17. <TextBlock Text="ModernApp" FontSize="16" FontWeight="SemiBold"
  18. Foreground="{DynamicResource SystemControlHighlightAccentBrush}"/>
  19. <TextBlock TextWrapping="Wrap" FontSize="12" Opacity="0.7"
  20. Text="Travel social app using a top-placement DrawerPage. A slide-down nav pane gives access to Discover, My Trips, Profile, and Settings. Features destination cards, story circles, an experience feed, a stats profile, and a travel gallery." />
  21. <Separator/>
  22. <TextBlock Text="Navigation Flow" FontSize="13" FontWeight="SemiBold"/>
  23. <StackPanel Spacing="4">
  24. <TextBlock FontSize="12" TextWrapping="Wrap" Text="1. DrawerPage: root, placement=Top"/>
  25. <TextBlock FontSize="12" TextWrapping="Wrap" Text="2. Hamburger opens slide-down pane (260 px)"/>
  26. <TextBlock FontSize="12" TextWrapping="Wrap" Text="3. Pane items navigate NavigationPage sections"/>
  27. <TextBlock FontSize="12" TextWrapping="Wrap" Text="4. Discover has full-width destination cards"/>
  28. <TextBlock FontSize="12" TextWrapping="Wrap" Text="5. Profile shows stats and a travel gallery"/>
  29. </StackPanel>
  30. <Separator/>
  31. <TextBlock Text="Key Code" FontSize="13" FontWeight="SemiBold"/>
  32. <Border Background="{DynamicResource SystemControlBackgroundBaseLowBrush}"
  33. CornerRadius="4" Padding="8">
  34. <TextBlock FontFamily="Cascadia Code,Consolas,Menlo,monospace"
  35. FontSize="10" TextWrapping="Wrap"
  36. Text="&lt;DrawerPage&#xA; DrawerPlacement=&quot;Top&quot;&#xA; DrawerLength=&quot;260&quot;&#xA; DrawerLayoutBehavior=&quot;Overlay&quot;&gt;&#xA; &lt;DrawerPage.Drawer&gt;&#xA; &lt;!-- nav items --&gt;&#xA; &lt;/DrawerPage.Drawer&gt;&#xA; &lt;NavigationPage .../&gt;&#xA;&lt;/DrawerPage&gt;"/>
  37. </Border>
  38. </StackPanel>
  39. </ScrollViewer>
  40. <Border BorderBrush="{DynamicResource SystemControlForegroundBaseMediumLowBrush}"
  41. BorderThickness="1" CornerRadius="8" ClipToBounds="True">
  42. <DrawerPage x:Name="DrawerPageControl"
  43. DrawerPlacement="Top"
  44. DrawerLength="260"
  45. DrawerLayoutBehavior="Overlay"
  46. Background="{StaticResource ModernBg}"
  47. DrawerBackground="White">
  48. <DrawerPage.Resources>
  49. <SolidColorBrush x:Key="NavigationControlNavBarBackground" Color="#ffffff"/>
  50. </DrawerPage.Resources>
  51. <!-- Header shown in PART_TopBar alongside the hamburger -->
  52. <DrawerPage.Header>
  53. <DockPanel>
  54. <PathIcon x:Name="PageActionIcon"
  55. Width="20" Height="20"
  56. DockPanel.Dock="Right"
  57. VerticalAlignment="Center"
  58. Foreground="#0d1f22"
  59. Data="M15.5 14h-.79l-.28-.27A6.471 6.471 0 0 0 16 9.5 6.5 6.5 0 1 0 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14z"/>
  60. <TextBlock x:Name="PageTitle"
  61. Text="Discover"
  62. FontSize="18" FontWeight="Bold"
  63. Foreground="#0d1f22"
  64. VerticalAlignment="Center"
  65. HorizontalAlignment="Center"/>
  66. </DockPanel>
  67. </DrawerPage.Header>
  68. <!-- Drawer header strip -->
  69. <DrawerPage.DrawerHeader>
  70. <Border Background="White" Padding="8,8,16,8"
  71. BorderBrush="#dde6e9" BorderThickness="0,0,0,1">
  72. <DockPanel>
  73. <Button x:Name="BtnCloseDrawer" Click="OnCloseDrawer"
  74. DockPanel.Dock="Left"
  75. Background="Transparent" BorderThickness="0"
  76. Padding="8,4" VerticalAlignment="Center">
  77. <PathIcon Width="18" Height="18" Foreground="#0d1f22"
  78. Data="M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"/>
  79. </Button>
  80. <TextBlock Text="Menu Open"
  81. FontSize="16" FontWeight="Bold"
  82. Foreground="#0d1f22"
  83. VerticalAlignment="Center"
  84. HorizontalAlignment="Center"/>
  85. </DockPanel>
  86. </Border>
  87. </DrawerPage.DrawerHeader>
  88. <DrawerPage.Drawer>
  89. <StackPanel>
  90. <Border Height="1" Background="#dde6e9" Margin="0,0,0,4"/>
  91. <Button x:Name="BtnDiscover" Tag="Discover" Click="OnNavClick"
  92. HorizontalAlignment="Stretch" HorizontalContentAlignment="Left"
  93. Background="Transparent" BorderThickness="0"
  94. Padding="20,14" CornerRadius="0">
  95. <StackPanel Orientation="Horizontal" Spacing="16">
  96. <PathIcon Width="20" Height="20" Foreground="#0d1f22"
  97. Data="M12 2C8.13 2 5 5.13 5 9c0 5.25 7 13 7 13s7-7.75 7-13c0-3.87-3.13-7-7-7zm0 9.5c-1.38 0-2.5-1.12-2.5-2.5s1.12-2.5 2.5-2.5 2.5 1.12 2.5 2.5-1.12 2.5-2.5 2.5z"/>
  98. <TextBlock Text="Discover" Foreground="#0d1f22" FontSize="15"
  99. VerticalAlignment="Center"/>
  100. </StackPanel>
  101. </Button>
  102. <Border Height="1" Background="#f0f4f5" Margin="20,0"/>
  103. <Button x:Name="BtnMyTrips" Tag="MyTrips" Click="OnNavClick"
  104. HorizontalAlignment="Stretch" HorizontalContentAlignment="Left"
  105. Background="Transparent" BorderThickness="0"
  106. Padding="20,14" CornerRadius="0">
  107. <StackPanel Orientation="Horizontal" Spacing="16">
  108. <PathIcon Width="20" Height="20" Foreground="#0d1f22"
  109. Data="M17 3H7c-1.1 0-1.99.9-1.99 2L5 21l7-3 7 3V5c0-1.1-.9-2-2-2zm0 15l-5-2.18L7 18V5h10v13z"/>
  110. <TextBlock Text="My Trips" Foreground="#0d1f22" FontSize="15"
  111. VerticalAlignment="Center"/>
  112. </StackPanel>
  113. </Button>
  114. <Border Height="1" Background="#f0f4f5" Margin="20,0"/>
  115. <Button x:Name="BtnProfile" Tag="Profile" Click="OnNavClick"
  116. HorizontalAlignment="Stretch" HorizontalContentAlignment="Left"
  117. Background="Transparent" BorderThickness="0"
  118. Padding="20,14" CornerRadius="0">
  119. <StackPanel Orientation="Horizontal" Spacing="16">
  120. <PathIcon Width="20" Height="20" Foreground="#0d1f22"
  121. Data="M12 12c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm0 2c-2.67 0-8 1.34-8 4v2h16v-2c0-2.66-5.33-4-8-4z"/>
  122. <TextBlock Text="Profile" Foreground="#0d1f22" FontSize="15"
  123. VerticalAlignment="Center"/>
  124. </StackPanel>
  125. </Button>
  126. <Border Height="1" Background="#f0f4f5" Margin="20,0"/>
  127. <Button x:Name="BtnSettings" Tag="Settings" Click="OnNavClick"
  128. HorizontalAlignment="Stretch" HorizontalContentAlignment="Left"
  129. Background="Transparent" BorderThickness="0"
  130. Padding="20,14" CornerRadius="0">
  131. <StackPanel Orientation="Horizontal" Spacing="16">
  132. <PathIcon Width="20" Height="20" Foreground="#0d1f22"
  133. Data="M19.14 12.94c.04-.3.06-.61.06-.94 0-.32-.02-.64-.07-.94l2.03-1.58c.18-.14.23-.41.12-.61l-1.92-3.32c-.12-.22-.37-.29-.59-.22l-2.39.96c-.5-.38-1.03-.7-1.62-.94l-.36-2.54c-.04-.24-.24-.41-.48-.41h-3.84c-.24 0-.43.17-.47.41l-.36 2.54c-.59.24-1.13.57-1.62.94l-2.39-.96c-.22-.08-.47 0-.59.22L2.74 8.87c-.12.21-.08.47.12.61l2.03 1.58c-.05.3-.09.63-.09.94s.02.64.07.94l-2.03 1.58c-.18.14-.23.4-.12.61l1.92 3.32c.12.22.37.29.59.22l2.39-.96c.5.38 1.03.7 1.62.94l.36 2.54c.05.24.24.41.48.41h3.84c.24 0 .44-.17.47-.41l.36-2.54c.59-.24 1.13-.57 1.62-.94l2.39.96c.22.08.47 0 .59-.22l1.92-3.32c.12-.22.07-.47-.12-.61l-2.01-1.58zM12 15.6c-1.98 0-3.6-1.62-3.6-3.6s1.62-3.6 3.6-3.6 3.6 1.62 3.6 3.6-1.62 3.6-3.6 3.6z"/>
  134. <TextBlock Text="Settings" Foreground="#0d1f22" FontSize="15"
  135. VerticalAlignment="Center"/>
  136. </StackPanel>
  137. </Button>
  138. <!-- Bottom accent line -->
  139. <Border Height="3" Background="#0dccf2" Margin="0,8,0,0"/>
  140. </StackPanel>
  141. </DrawerPage.Drawer>
  142. <NavigationPage x:Name="NavPage">
  143. <NavigationPage.Resources>
  144. <SolidColorBrush x:Key="NavigationBarBackground" Color="Transparent" />
  145. </NavigationPage.Resources>
  146. </NavigationPage>
  147. </DrawerPage>
  148. </Border>
  149. </DockPanel>
  150. </UserControl>