|
2 | 2 | x:Class="ContosoNotes.Views.MainPage"
|
3 | 3 | xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
4 | 4 | xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
5 |
| - xmlns:converters="using:Microsoft.Toolkit.Uwp.UI.Converters" |
6 | 5 | xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
7 | 6 | xmlns:graphcontrols="using:CommunityToolkit.Uwp.Graph.Controls"
|
8 | 7 | xmlns:local="using:ContosoNotes.Views"
|
9 | 8 | xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
10 | 9 | xmlns:models="using:ContosoNotes.Models"
|
11 |
| - xmlns:ui="using:ContosoNotes.UI" xmlns:controls="using:Microsoft.Toolkit.Uwp.UI.Controls" |
| 10 | + xmlns:ui="using:ContosoNotes.UI" |
| 11 | + xmlns:controls="using:Microsoft.Toolkit.Uwp.UI.Controls" |
12 | 12 | d:DataContext="{d:DesignInstance Type=local:MainViewModel}"
|
13 | 13 | Background="{ThemeResource ApplicationPageBackgroundThemeBrush}"
|
14 | 14 | mc:Ignorable="d">
|
15 | 15 |
|
16 | 16 | <Page.Resources>
|
17 | 17 | <x:Boolean x:Key="Boolean_True">True</x:Boolean>
|
18 | 18 | <x:Boolean x:Key="Boolean_False">False</x:Boolean>
|
19 |
| - |
| 19 | + |
20 | 20 | <ui:LastSyncDateTimeConverter x:Key="LastSyncDateTimeConverter" />
|
21 | 21 |
|
22 | 22 | <Style x:Key="CustomButtonStyle" TargetType="Button">
|
|
64 | 64 | </controls:SwitchPresenter>
|
65 | 65 | </Button>
|
66 | 66 |
|
67 |
| - |
68 | 67 | <StackPanel Grid.Column="1" Orientation="Horizontal">
|
69 | 68 | <!--<Button Style="{StaticResource CustomButtonStyle}">
|
70 | 69 | <Image Source="ms-appx:///Assets/Translate.png" />
|
71 | 70 | </Button>
|
72 | 71 | <Button Style="{StaticResource CustomButtonStyle}">
|
73 | 72 | <Image Source="ms-appx:///Assets/Font.png" />
|
74 |
| - </Button> |
75 |
| - <Button Style="{StaticResource CustomButtonStyle}"> |
| 73 | + </Button>--> |
| 74 | + <Button |
| 75 | + Command="{x:Bind ViewModel.DeleteCurrentNotePageCommand}" |
| 76 | + Style="{StaticResource CustomButtonStyle}"> |
76 | 77 | <Image Source="ms-appx:///Assets/Discard.png" />
|
77 | 78 | </Button>
|
78 |
| - <Button Style="{StaticResource CustomButtonStyle}"> |
| 79 | + <!--<Button Style="{StaticResource CustomButtonStyle}"> |
79 | 80 | <Image Source="ms-appx:///Assets/Attach.png" />
|
80 | 81 | </Button>
|
81 | 82 | <Button Style="{StaticResource CustomButtonStyle}">
|
|
103 | 104 | <!-- Notes list -->
|
104 | 105 | <Grid
|
105 | 106 | Grid.Row="1"
|
106 |
| - Padding="20,0,0,12" |
| 107 | + Padding="24,0,0,24" |
107 | 108 | BorderBrush="#717171"
|
108 | 109 | BorderThickness="0,0,1,0"
|
109 | 110 | Visibility="{x:Bind ViewModel.IsPaneOpen, Mode=OneWay}"
|
|
115 | 116 |
|
116 | 117 | <!-- List of notes -->
|
117 | 118 | <ListView
|
118 |
| - Margin="0, 0, 4, 0" |
| 119 | + SelectedIndex="{x:Bind ViewModel.CurrentNotesListItemIndex, Mode=TwoWay}" |
119 | 120 | ItemsSource="{x:Bind ViewModel.NotesList.Items, Mode=OneWay}">
|
120 | 121 | <ListView.ItemTemplate>
|
121 | 122 | <DataTemplate x:DataType="models:NotesListItemModel">
|
|
131 | 132 |
|
132 | 133 | <!-- Notes list footer panel -->
|
133 | 134 | <StackPanel Grid.Row="1" Orientation="Horizontal">
|
134 |
| - <!--<Button Style="{StaticResource CustomButtonStyle}"> |
135 |
| - <Image Source="ms-appx:///Assets/NewNote.png" /> |
136 |
| - </Button>--> |
| 135 | + <controls:SwitchPresenter |
| 136 | + VerticalAlignment="Bottom" |
| 137 | + Value="{x:Bind ViewModel.IsPaneOpen, Mode=OneWay}"> |
| 138 | + <controls:Case Value="{StaticResource Boolean_True}"> |
| 139 | + <Button |
| 140 | + Style="{StaticResource CustomButtonStyle}" |
| 141 | + Command="{x:Bind ViewModel.CreateNotePageCommand}"> |
| 142 | + <Image Source="ms-appx:///Assets/NewNote.png" /> |
| 143 | + </Button> |
| 144 | + </controls:Case> |
| 145 | + </controls:SwitchPresenter> |
137 | 146 | </StackPanel>
|
138 | 147 | </Grid>
|
139 | 148 |
|
|
160 | 169 | </Grid.ColumnDefinitions>
|
161 | 170 |
|
162 | 171 | <StackPanel Orientation="Horizontal">
|
163 |
| - <!--<Button Style="{StaticResource CustomButtonStyle}" Visibility="{x:Bind ViewModel.IsPaneOpen, Converter={StaticResource InverseBoolToVisibilityConverter}, Mode=OneWay}"> |
164 |
| - <Image Source="ms-appx:///Assets/NewNote.png" /> |
165 |
| - </Button> |
166 |
| - <Button Style="{StaticResource CustomButtonStyle}"> |
| 172 | + <controls:SwitchPresenter |
| 173 | + VerticalAlignment="Bottom" |
| 174 | + Value="{x:Bind ViewModel.IsPaneOpen, Mode=OneWay}"> |
| 175 | + <controls:Case Value="{StaticResource Boolean_False}"> |
| 176 | + <Button |
| 177 | + Style="{StaticResource CustomButtonStyle}" |
| 178 | + Command="{x:Bind ViewModel.CreateNotePageCommand}"> |
| 179 | + <Image Source="ms-appx:///Assets/NewNote.png" /> |
| 180 | + </Button> |
| 181 | + </controls:Case> |
| 182 | + </controls:SwitchPresenter> |
| 183 | + <!--<Button Style="{StaticResource CustomButtonStyle}"> |
167 | 184 | <Image Source="ms-appx:///Assets/Undo.png" />
|
168 | 185 | </Button>
|
169 | 186 | <Button Style="{StaticResource CustomButtonStyle}">
|
|
0 commit comments