|
4 | 4 | xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" |
5 | 5 | xmlns:d="http://schemas.microsoft.com/expression/blend/2008" |
6 | 6 | xmlns:ext="using:Richasy.Bili.App.Resources.Extension" |
| 7 | + xmlns:icons="using:Richasy.FluentIcon.Uwp" |
7 | 8 | xmlns:loc="using:Richasy.Bili.Locator.Uwp" |
8 | 9 | xmlns:local="using:Richasy.Bili.App.Controls" |
9 | 10 | xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" |
10 | | - xmlns:muxc="using:Microsoft.UI.Xaml.Controls" xmlns:icons="using:Richasy.FluentIcon.Uwp" |
| 11 | + xmlns:muxc="using:Microsoft.UI.Xaml.Controls" |
11 | 12 | d:DesignHeight="300" |
12 | 13 | d:DesignWidth="400" |
13 | 14 | mc:Ignorable="d"> |
14 | 15 |
|
15 | 16 | <UserControl.Resources> |
16 | | - <muxc:CommandBarFlyout x:Key="AvatarFlyout" Placement="Bottom"> |
17 | | - <muxc:CommandBarFlyout.SecondaryCommands> |
18 | | - <AppBarElementContainer> |
19 | | - <Grid |
20 | | - MinWidth="260" |
21 | | - MaxWidth="320" |
22 | | - Padding="12,8" |
23 | | - ColumnSpacing="12"> |
24 | | - <Grid.ColumnDefinitions> |
25 | | - <ColumnDefinition Width="Auto" /> |
26 | | - <ColumnDefinition Width="*" /> |
27 | | - </Grid.ColumnDefinitions> |
28 | | - <local:UserAvatar |
29 | | - Width="40" |
30 | | - Height="40" |
31 | | - Avatar="{x:Bind ViewModel.Avatar, Mode=OneWay}" |
32 | | - DecodeSize="80" |
33 | | - UserName="{x:Bind ViewModel.DisplayName, Mode=OneWay}" /> |
34 | | - <StackPanel |
35 | | - Grid.Column="1" |
36 | | - VerticalAlignment="Center" |
37 | | - Spacing="4"> |
38 | | - <TextBlock |
39 | | - Style="{StaticResource BodyTextBlockStyle}" |
40 | | - HorizontalAlignment="Left" |
41 | | - Text="{x:Bind ViewModel.DisplayName, Mode=OneWay}" |
42 | | - TextTrimming="CharacterEllipsis" /> |
43 | | - <Image |
44 | | - Height="10" |
45 | | - HorizontalAlignment="Left" |
46 | | - Source="{x:Bind ViewModel.Level, Mode=OneWay, Converter={StaticResource UserLevelConverter}}" /> |
47 | | - </StackPanel> |
48 | | - </Grid> |
49 | | - </AppBarElementContainer> |
50 | | - <AppBarSeparator /> |
51 | | - <AppBarButton Click="OnNavigateToMyHomePageButtonClickAsync" Label="{loc:LocaleLocator Name=MyWebPage}"> |
52 | | - <AppBarButton.Icon> |
53 | | - <icons:RegularFluentIcon Symbol="Globe16" /> |
54 | | - </AppBarButton.Icon> |
55 | | - </AppBarButton> |
56 | | - <AppBarButton |
57 | | - ext:NavigationExtension.PageId="DynamicFeed" |
58 | | - Click="OnNavigateButtonClick" |
59 | | - Label="{loc:LocaleLocator Name=DynamicFeed}"> |
60 | | - <AppBarButton.Icon> |
61 | | - <icons:RegularFluentIcon Symbol="DesignIdeas16" /> |
62 | | - </AppBarButton.Icon> |
63 | | - </AppBarButton> |
64 | | - <AppBarButton |
65 | | - ext:NavigationExtension.PageId="Message" |
66 | | - Click="OnNavigateButtonClick" |
67 | | - Label="{loc:LocaleLocator Name=Message}"> |
68 | | - <AppBarButton.Icon> |
69 | | - <icons:RegularFluentIcon Symbol="Chat16" /> |
70 | | - </AppBarButton.Icon> |
71 | | - </AppBarButton> |
72 | | - <AppBarButton |
73 | | - ext:NavigationExtension.PageId="MyFavorite" |
74 | | - Click="OnNavigateButtonClick" |
75 | | - Label="{loc:LocaleLocator Name=MyFavorite}"> |
76 | | - <AppBarButton.Icon> |
77 | | - <icons:RegularFluentIcon Symbol="StarLineHorizontal320" /> |
78 | | - </AppBarButton.Icon> |
79 | | - </AppBarButton> |
80 | | - <AppBarButton |
81 | | - ext:NavigationExtension.PageId="SeeLater" |
82 | | - Click="OnNavigateButtonClick" |
83 | | - Label="{loc:LocaleLocator Name=SeeLater}"> |
84 | | - <AppBarButton.Icon> |
85 | | - <icons:RegularFluentIcon Symbol="CalendarClock16" /> |
86 | | - </AppBarButton.Icon> |
87 | | - </AppBarButton> |
88 | | - <AppBarButton |
89 | | - ext:NavigationExtension.PageId="ViewHistory" |
90 | | - Click="OnNavigateButtonClick" |
91 | | - Label="{loc:LocaleLocator Name=ViewHistory}"> |
92 | | - <AppBarButton.Icon> |
93 | | - <icons:RegularFluentIcon Symbol="History20" /> |
94 | | - </AppBarButton.Icon> |
95 | | - </AppBarButton> |
96 | | - <AppBarSeparator /> |
97 | | - <AppBarButton Click="OnSignOutButtonClickAsync" Label="{loc:LocaleLocator Name=SignOut}"> |
98 | | - <AppBarButton.Icon> |
99 | | - <icons:RegularFluentIcon Foreground="{ThemeResource SystemFillColorCriticalBrush}" Symbol="SignOut20" /> |
100 | | - </AppBarButton.Icon> |
101 | | - </AppBarButton> |
102 | | - </muxc:CommandBarFlyout.SecondaryCommands> |
103 | | - </muxc:CommandBarFlyout> |
| 17 | + <Flyout |
| 18 | + x:Key="AvatarFlyout" |
| 19 | + FlyoutPresenterStyle="{StaticResource ThinPaddingFlyoutPresenterStyle}" |
| 20 | + Placement="Bottom"> |
| 21 | + <Grid> |
| 22 | + <Grid.RowDefinitions> |
| 23 | + <RowDefinition Height="Auto" /> |
| 24 | + <RowDefinition Height="Auto" /> |
| 25 | + </Grid.RowDefinitions> |
| 26 | + <local:AccountPanel MinWidth="280" RequestCloseFlyout="OnRequestCloseFlyout" /> |
| 27 | + <StackPanel Grid.Row="1" Spacing="4"> |
| 28 | + <StackPanel.Resources> |
| 29 | + <Style BasedOn="{StaticResource DefaultButtonStyle}" TargetType="Button"> |
| 30 | + <Setter Property="HorizontalAlignment" Value="Stretch" /> |
| 31 | + <Setter Property="HorizontalContentAlignment" Value="Left" /> |
| 32 | + <Setter Property="Background" Value="Transparent" /> |
| 33 | + <Setter Property="BorderThickness" Value="0" /> |
| 34 | + <Setter Property="Padding" Value="12,8" /> |
| 35 | + </Style> |
| 36 | + </StackPanel.Resources> |
| 37 | + <Button Click="OnNavigateToMyHomePageButtonClickAsync"> |
| 38 | + <local:IconTextBlock Symbol="Globe16" Text="{loc:LocaleLocator Name=MyWebPage}" /> |
| 39 | + </Button> |
| 40 | + <Button ext:NavigationExtension.PageId="DynamicFeed" Click="OnNavigateButtonClick"> |
| 41 | + <local:IconTextBlock Symbol="DesignIdeas16" Text="{loc:LocaleLocator Name=DynamicFeed}" /> |
| 42 | + </Button> |
| 43 | + <Button ext:NavigationExtension.PageId="Message" Click="OnNavigateButtonClick"> |
| 44 | + <local:IconTextBlock Symbol="Chat16" Text="{loc:LocaleLocator Name=Message}" /> |
| 45 | + </Button> |
| 46 | + <Button ext:NavigationExtension.PageId="MyFavorite" Click="OnNavigateButtonClick"> |
| 47 | + <local:IconTextBlock Symbol="StarLineHorizontal320" Text="{loc:LocaleLocator Name=MyFavorite}" /> |
| 48 | + </Button> |
| 49 | + <Button ext:NavigationExtension.PageId="SeeLater" Click="OnNavigateButtonClick"> |
| 50 | + <local:IconTextBlock Symbol="CalendarClock16" Text="{loc:LocaleLocator Name=SeeLater}" /> |
| 51 | + </Button> |
| 52 | + <Button ext:NavigationExtension.PageId="ViewHistory" Click="OnNavigateButtonClick"> |
| 53 | + <local:IconTextBlock Symbol="History20" Text="{loc:LocaleLocator Name=ViewHistory}" /> |
| 54 | + </Button> |
| 55 | + <StackPanel |
| 56 | + Height="1" |
| 57 | + HorizontalAlignment="Stretch" |
| 58 | + Background="{ThemeResource ControlStrokeColorDefaultBrush}" /> |
| 59 | + <Button Click="OnSignOutButtonClickAsync"> |
| 60 | + <local:IconTextBlock |
| 61 | + Foreground="{ThemeResource SystemFillColorCriticalBrush}" |
| 62 | + Symbol="SignOut20" |
| 63 | + Text="{loc:LocaleLocator Name=SignOut}" /> |
| 64 | + </Button> |
| 65 | + </StackPanel> |
| 66 | + </Grid> |
| 67 | + </Flyout> |
104 | 68 | </UserControl.Resources> |
105 | 69 |
|
106 | 70 | <Grid ToolTipService.ToolTip="{x:Bind ViewModel.TipText, Mode=OneWay}"> |
|
0 commit comments