|
18 | 18 | <vc:BooleanToStringConverter x:Key="BooleanToStringConverter" /> |
19 | 19 | </Page.Resources> |
20 | 20 |
|
21 | | - <Grid Background="{ThemeResource ApplicationPageBackgroundThemeBrush}"> |
| 21 | + <Grid> |
22 | 22 | <Grid.RowDefinitions> |
23 | 23 | <RowDefinition Height="Auto" /> |
24 | 24 | <RowDefinition /> |
|
35 | 35 | x:FieldModifier="public" /> |
36 | 36 |
|
37 | 37 | <!-- Main Content --> |
38 | | - <NavigationView |
39 | | - x:Name="Sidebar" |
40 | | - Grid.Row="1" |
41 | | - IsBackButtonVisible="Collapsed" |
42 | | - IsPaneToggleButtonVisible="True" |
43 | | - IsSettingsVisible="False" |
44 | | - MenuItemsSource="{x:Bind ViewModel.SidebarViewModel.SidebarItems}" |
45 | | - PaneTitle="{x:Bind Sidebar.IsPaneOpen, Mode=OneWay, Converter={StaticResource BooleanToStringConverter}, ConverterParameter='false:STANDARD|:true:LOCALIZE|My vaults'}" |
46 | | - SelectionChanged="Sidebar_SelectionChanged"> |
47 | | - |
48 | | - <uc:NavigationControl PageViewModel="{x:Bind ViewModel.ActivePageViewModel, Mode=TwoWay}" /> |
49 | | - |
50 | | - <NavigationView.AutoSuggestBox> |
51 | | - <AutoSuggestBox |
52 | | - PlaceholderText="Search" |
53 | | - QueryIcon="Find" |
54 | | - Text="{x:Bind ViewModel.SidebarViewModel.SearchQuery, Mode=TwoWay}" /> |
55 | | - </NavigationView.AutoSuggestBox> |
56 | | - |
57 | | - <NavigationView.PaneCustomContent> |
58 | | - <Grid> |
59 | | - <Grid x:Name="CustomContent" x:Load="{x:Bind ViewModel.SidebarViewModel.NoItemsFoundLoad, Mode=OneWay}"> |
60 | | - <TextBlock |
61 | | - HorizontalAlignment="Center" |
| 38 | + <Grid Grid.Row="1" Background="{ThemeResource ApplicationPageBackgroundThemeBrush}"> |
| 39 | + <NavigationView |
| 40 | + x:Name="Sidebar" |
| 41 | + Grid.Row="1" |
| 42 | + IsBackButtonVisible="Collapsed" |
| 43 | + IsPaneToggleButtonVisible="True" |
| 44 | + IsSettingsVisible="False" |
| 45 | + MenuItemsSource="{x:Bind ViewModel.SidebarViewModel.SidebarItems}" |
| 46 | + PaneTitle="{x:Bind Sidebar.IsPaneOpen, Mode=OneWay, Converter={StaticResource BooleanToStringConverter}, ConverterParameter='false:STANDARD|:true:LOCALIZE|My vaults'}" |
| 47 | + SelectionChanged="Sidebar_SelectionChanged"> |
| 48 | + |
| 49 | + <uc:NavigationControl PageViewModel="{x:Bind ViewModel.ActivePageViewModel, Mode=TwoWay}" /> |
| 50 | + |
| 51 | + <NavigationView.AutoSuggestBox> |
| 52 | + <AutoSuggestBox |
| 53 | + PlaceholderText="Search" |
| 54 | + QueryIcon="Find" |
| 55 | + Text="{x:Bind ViewModel.SidebarViewModel.SearchQuery, Mode=TwoWay}" /> |
| 56 | + </NavigationView.AutoSuggestBox> |
| 57 | + |
| 58 | + <NavigationView.PaneCustomContent> |
| 59 | + <Grid> |
| 60 | + <Grid x:Name="CustomContent" x:Load="{x:Bind ViewModel.SidebarViewModel.NoItemsFoundLoad, Mode=OneWay}"> |
| 61 | + <TextBlock |
| 62 | + HorizontalAlignment="Center" |
| 63 | + VerticalAlignment="Center" |
| 64 | + Text="No vaults found" /> |
| 65 | + </Grid> |
| 66 | + </Grid> |
| 67 | + </NavigationView.PaneCustomContent> |
| 68 | + |
| 69 | + <NavigationView.PaneFooter> |
| 70 | + <Grid |
| 71 | + Width="{Binding Path=OpenPaneLength, ElementName=Sidebar}" |
| 72 | + Padding="20,0,20,12" |
| 73 | + HorizontalAlignment="Stretch"> |
| 74 | + <Grid.ColumnDefinitions> |
| 75 | + <ColumnDefinition Width="Auto" /> |
| 76 | + <ColumnDefinition /> |
| 77 | + </Grid.ColumnDefinitions> |
| 78 | + |
| 79 | + <Button |
| 80 | + Grid.Column="0" |
| 81 | + HorizontalAlignment="Left" |
62 | 82 | VerticalAlignment="Center" |
63 | | - Text="No vaults found" /> |
| 83 | + HorizontalContentAlignment="Center" |
| 84 | + VerticalContentAlignment="Center" |
| 85 | + Command="{x:Bind ViewModel.SidebarViewModel.CreateNewVaultCommand}" |
| 86 | + Style="{ThemeResource AccentButtonStyle}" |
| 87 | + Visibility="{x:Bind Sidebar.IsPaneOpen, Mode=OneWay}"> |
| 88 | + <StackPanel Orientation="Horizontal" Spacing="8"> |
| 89 | + <FontIcon |
| 90 | + Margin="0,0,0,-2" |
| 91 | + FontSize="16" |
| 92 | + Glyph="" /> |
| 93 | + <TextBlock Text="New vault" /> |
| 94 | + </StackPanel> |
| 95 | + </Button> |
| 96 | + <Button |
| 97 | + Grid.Column="0" |
| 98 | + Height="36" |
| 99 | + Margin="-16,16,0,0" |
| 100 | + HorizontalAlignment="Left" |
| 101 | + VerticalAlignment="Center" |
| 102 | + HorizontalContentAlignment="Center" |
| 103 | + VerticalContentAlignment="Center" |
| 104 | + Command="{x:Bind ViewModel.SidebarViewModel.CreateNewVaultCommand}" |
| 105 | + Style="{ThemeResource AccentButtonStyle}" |
| 106 | + Visibility="{x:Bind Sidebar.IsPaneOpen, Mode=OneWay, Converter={StaticResource BooleanToVisibilityConverter}, ConverterParameter='invert'}"> |
| 107 | + <FontIcon FontSize="16" Glyph="" /> |
| 108 | + </Button> |
| 109 | + |
| 110 | + <Button |
| 111 | + Grid.Column="1" |
| 112 | + Width="36" |
| 113 | + Height="36" |
| 114 | + Padding="8" |
| 115 | + HorizontalAlignment="Right" |
| 116 | + VerticalAlignment="Center" |
| 117 | + HorizontalContentAlignment="Center" |
| 118 | + VerticalContentAlignment="Center" |
| 119 | + Background="Transparent" |
| 120 | + BorderThickness="0" |
| 121 | + Command="{x:Bind ViewModel.SidebarViewModel.OpenSettingsCommand}" |
| 122 | + IsEnabled="False" |
| 123 | + Visibility="{x:Bind Sidebar.IsPaneOpen, Mode=OneWay}"> |
| 124 | + <AnimatedIcon> |
| 125 | + <AnimatedIcon.Source> |
| 126 | + <animvis:AnimatedSettingsVisualSource /> |
| 127 | + </AnimatedIcon.Source> |
| 128 | + <AnimatedIcon.FallbackIconSource> |
| 129 | + <SymbolIconSource Symbol="Setting" /> |
| 130 | + </AnimatedIcon.FallbackIconSource> |
| 131 | + </AnimatedIcon> |
| 132 | + </Button> |
64 | 133 | </Grid> |
65 | | - </Grid> |
66 | | - </NavigationView.PaneCustomContent> |
67 | | - |
68 | | - <NavigationView.PaneFooter> |
69 | | - <Grid |
70 | | - Width="{Binding Path=OpenPaneLength, ElementName=Sidebar}" |
71 | | - Padding="20,0,20,12" |
72 | | - HorizontalAlignment="Stretch"> |
73 | | - <Grid.ColumnDefinitions> |
74 | | - <ColumnDefinition Width="Auto" /> |
75 | | - <ColumnDefinition /> |
76 | | - </Grid.ColumnDefinitions> |
77 | | - |
78 | | - <Button |
79 | | - Grid.Column="0" |
80 | | - HorizontalAlignment="Left" |
81 | | - VerticalAlignment="Center" |
82 | | - HorizontalContentAlignment="Center" |
83 | | - VerticalContentAlignment="Center" |
84 | | - Command="{x:Bind ViewModel.SidebarViewModel.CreateNewVaultCommand}" |
85 | | - Style="{ThemeResource AccentButtonStyle}" |
86 | | - Visibility="{x:Bind Sidebar.IsPaneOpen, Mode=OneWay}"> |
87 | | - <StackPanel Orientation="Horizontal" Spacing="8"> |
88 | | - <FontIcon |
89 | | - Margin="0,0,0,-2" |
90 | | - FontSize="16" |
91 | | - Glyph="" /> |
92 | | - <TextBlock Text="New vault" /> |
93 | | - </StackPanel> |
94 | | - </Button> |
95 | | - <Button |
96 | | - Grid.Column="0" |
97 | | - Height="36" |
98 | | - Margin="-16,16,0,0" |
99 | | - HorizontalAlignment="Left" |
100 | | - VerticalAlignment="Center" |
101 | | - HorizontalContentAlignment="Center" |
102 | | - VerticalContentAlignment="Center" |
103 | | - Command="{x:Bind ViewModel.SidebarViewModel.CreateNewVaultCommand}" |
104 | | - Style="{ThemeResource AccentButtonStyle}" |
105 | | - Visibility="{x:Bind Sidebar.IsPaneOpen, Mode=OneWay, Converter={StaticResource BooleanToVisibilityConverter}, ConverterParameter='invert'}"> |
106 | | - <FontIcon FontSize="16" Glyph="" /> |
107 | | - </Button> |
108 | | - |
109 | | - <Button |
110 | | - Grid.Column="1" |
111 | | - Width="36" |
112 | | - Height="36" |
113 | | - Padding="8" |
114 | | - HorizontalAlignment="Right" |
115 | | - VerticalAlignment="Center" |
116 | | - HorizontalContentAlignment="Center" |
117 | | - VerticalContentAlignment="Center" |
118 | | - Background="Transparent" |
119 | | - BorderThickness="0" |
120 | | - Command="{x:Bind ViewModel.SidebarViewModel.OpenSettingsCommand}" |
121 | | - IsEnabled="False" |
122 | | - Visibility="{x:Bind Sidebar.IsPaneOpen, Mode=OneWay}"> |
123 | | - <AnimatedIcon> |
124 | | - <AnimatedIcon.Source> |
125 | | - <animvis:AnimatedSettingsVisualSource /> |
126 | | - </AnimatedIcon.Source> |
127 | | - <AnimatedIcon.FallbackIconSource> |
128 | | - <SymbolIconSource Symbol="Setting" /> |
129 | | - </AnimatedIcon.FallbackIconSource> |
130 | | - </AnimatedIcon> |
131 | | - </Button> |
132 | | - </Grid> |
133 | | - </NavigationView.PaneFooter> |
134 | | - |
135 | | - <NavigationView.MenuItemTemplate> |
136 | | - <DataTemplate x:DataType="vm:SidebarItemViewModel"> |
137 | | - <NavigationViewItem |
138 | | - Height="64" |
139 | | - AutomationProperties.Name="{x:Bind VaultName, Mode=OneWay}" |
140 | | - ToolTipService.ToolTip="{x:Bind VaultName, Mode=OneWay}"> |
141 | | - <NavigationViewItem.Icon> |
142 | | - <FontIcon Glyph="" /> |
143 | | - </NavigationViewItem.Icon> |
144 | | - <NavigationViewItem.Content> |
145 | | - <Grid> |
146 | | - <Grid.RowDefinitions> |
147 | | - <RowDefinition /> |
148 | | - <RowDefinition /> |
149 | | - </Grid.RowDefinitions> |
150 | | - <Grid.ColumnDefinitions> |
151 | | - <ColumnDefinition Width="Auto" /> |
152 | | - <ColumnDefinition /> |
153 | | - </Grid.ColumnDefinitions> |
154 | | - |
155 | | - <!-- Vault name --> |
156 | | - <TextBlock |
157 | | - Grid.Row="0" |
158 | | - Grid.Column="0" |
159 | | - FontWeight="SemiBold" |
160 | | - Text="{x:Bind VaultName, Mode=OneWay}" /> |
161 | | - |
162 | | - <!-- Last opened --> |
163 | | - <TextBlock |
164 | | - Grid.Row="1" |
165 | | - Grid.Column="0" |
166 | | - FontSize="14" |
167 | | - Opacity="0.8" |
168 | | - Text="{x:Bind VaultViewModel.VaultModel.LastOpened, Mode=OneWay, Converter={StaticResource DateTimeToStringConverter}}" /> |
169 | | - </Grid> |
170 | | - </NavigationViewItem.Content> |
171 | | - <NavigationViewItem.ContextFlyout> |
172 | | - <MenuFlyout> |
173 | | - <!-- TODO: Determine the description and icon and update the item: "Show in Files" --> |
174 | | - <MenuFlyoutItem Command="{x:Bind ShowInFileExplorerCommand}" Text="Show encrypted vault in File Explorer"> |
175 | | - <MenuFlyoutItem.Icon> |
176 | | - <FontIcon Glyph="" /> |
177 | | - </MenuFlyoutItem.Icon> |
178 | | - </MenuFlyoutItem> |
179 | | - |
180 | | - <MenuFlyoutItem Command="{x:Bind RemoveVaultCommand}" Text="Remove vault from the list"> |
181 | | - <MenuFlyoutItem.Icon> |
182 | | - <FontIcon Glyph="" /> |
183 | | - </MenuFlyoutItem.Icon> |
184 | | - </MenuFlyoutItem> |
185 | | - </MenuFlyout> |
186 | | - </NavigationViewItem.ContextFlyout> |
187 | | - </NavigationViewItem> |
188 | | - </DataTemplate> |
189 | | - </NavigationView.MenuItemTemplate> |
190 | | - </NavigationView> |
191 | | - |
192 | | - |
| 134 | + </NavigationView.PaneFooter> |
| 135 | + |
| 136 | + <NavigationView.MenuItemTemplate> |
| 137 | + <DataTemplate x:DataType="vm:SidebarItemViewModel"> |
| 138 | + <NavigationViewItem |
| 139 | + Height="64" |
| 140 | + AutomationProperties.Name="{x:Bind VaultName, Mode=OneWay}" |
| 141 | + ToolTipService.ToolTip="{x:Bind VaultName, Mode=OneWay}"> |
| 142 | + <NavigationViewItem.Icon> |
| 143 | + <FontIcon Glyph="" /> |
| 144 | + </NavigationViewItem.Icon> |
| 145 | + <NavigationViewItem.Content> |
| 146 | + <Grid> |
| 147 | + <Grid.RowDefinitions> |
| 148 | + <RowDefinition /> |
| 149 | + <RowDefinition /> |
| 150 | + </Grid.RowDefinitions> |
| 151 | + <Grid.ColumnDefinitions> |
| 152 | + <ColumnDefinition Width="Auto" /> |
| 153 | + <ColumnDefinition /> |
| 154 | + </Grid.ColumnDefinitions> |
| 155 | + |
| 156 | + <!-- Vault name --> |
| 157 | + <TextBlock |
| 158 | + Grid.Row="0" |
| 159 | + Grid.Column="0" |
| 160 | + FontWeight="SemiBold" |
| 161 | + Text="{x:Bind VaultName, Mode=OneWay}" /> |
| 162 | + |
| 163 | + <!-- Last opened --> |
| 164 | + <TextBlock |
| 165 | + Grid.Row="1" |
| 166 | + Grid.Column="0" |
| 167 | + FontSize="14" |
| 168 | + Opacity="0.8" |
| 169 | + Text="{x:Bind VaultViewModel.VaultModel.LastOpened, Mode=OneWay, Converter={StaticResource DateTimeToStringConverter}}" /> |
| 170 | + </Grid> |
| 171 | + </NavigationViewItem.Content> |
| 172 | + <NavigationViewItem.ContextFlyout> |
| 173 | + <MenuFlyout> |
| 174 | + <!-- TODO: Determine the description and icon and update the item: "Show in Files" --> |
| 175 | + <MenuFlyoutItem Command="{x:Bind ShowInFileExplorerCommand}" Text="Show encrypted vault in File Explorer"> |
| 176 | + <MenuFlyoutItem.Icon> |
| 177 | + <FontIcon Glyph="" /> |
| 178 | + </MenuFlyoutItem.Icon> |
| 179 | + </MenuFlyoutItem> |
| 180 | + |
| 181 | + <MenuFlyoutItem Command="{x:Bind RemoveVaultCommand}" Text="Remove vault from the list"> |
| 182 | + <MenuFlyoutItem.Icon> |
| 183 | + <FontIcon Glyph="" /> |
| 184 | + </MenuFlyoutItem.Icon> |
| 185 | + </MenuFlyoutItem> |
| 186 | + </MenuFlyout> |
| 187 | + </NavigationViewItem.ContextFlyout> |
| 188 | + </NavigationViewItem> |
| 189 | + </DataTemplate> |
| 190 | + </NavigationView.MenuItemTemplate> |
| 191 | + </NavigationView> |
| 192 | + </Grid> |
193 | 193 | </Grid> |
194 | 194 | </Page> |
0 commit comments