|
9 | 9 | <Design.DataContext>
|
10 | 10 | <vm:MainWindowViewModel />
|
11 | 11 | </Design.DataContext>
|
12 |
| - <Grid RowDefinitions="Auto,Auto,*" ColumnDefinitions="30*,5,30*,5,30*"> |
| 12 | + <Grid RowDefinitions="Auto,Auto,Auto,*" ColumnDefinitions="30*,5,30*,5,30*"> |
| 13 | + <!-- MenuItem Behaviors --> |
13 | 14 | <Menu Grid.Row="0" Grid.Column="0" Grid.ColumnSpan="5">
|
14 | 15 | <MenuItem Header="File">
|
15 | 16 | <MenuItem Header="Open Files">
|
|
23 | 24 | </MenuItem>
|
24 | 25 | <MenuItem Header="Open Folders">
|
25 | 26 | <Interaction.Behaviors>
|
26 |
| - <MenuItemOpenFolderBehavior Command="{Binding OpenFoldersCommand}" |
27 |
| - Title="Open Folders" |
28 |
| - AllowMultiple="True" /> |
| 27 | + <MenuItemOpenFolderPickerBehavior Command="{Binding OpenFoldersCommand}" |
| 28 | + Title="Open Folders" |
| 29 | + AllowMultiple="True" /> |
29 | 30 | </Interaction.Behaviors>
|
30 | 31 | </MenuItem>
|
31 | 32 | <MenuItem Header="Save File">
|
|
40 | 41 | </MenuItem>
|
41 | 42 | </MenuItem>
|
42 | 43 | </Menu>
|
| 44 | + <!-- Generic Actions --> |
43 | 45 | <Button x:Name="OpenFilesButton" Content="Open Files" Grid.Row="1" Grid.Column="0" Margin="5,5,0,5">
|
44 | 46 | <Interaction.Behaviors>
|
45 | 47 | <EventTriggerBehavior EventName="Click">
|
|
56 | 58 | <EventTriggerBehavior EventName="Click">
|
57 | 59 | <OpenFolderPickerAction Command="{Binding OpenFoldersCommand}"
|
58 | 60 | Title="Open Folders"
|
59 |
| - AllowMultiple="True"/> |
| 61 | + AllowMultiple="True" /> |
60 | 62 | </EventTriggerBehavior>
|
61 | 63 | </Interaction.Behaviors>
|
62 | 64 | </Button>
|
|
68 | 70 | Title="Save Files"
|
69 | 71 | SuggestedFileName="MyFile"
|
70 | 72 | DefaultExtension="txt"
|
71 |
| - FileTypeChoices="Text Files (*.txt)|*.txt|Markdown Files (*.md)|*.md|All Files (*.*)|*.*" /> |
| 73 | + FileTypeChoices="Text Files (*.txt)|*.txt|Markdown Files (*.md)|*.md|All Files (*.*)|*.*" /> |
72 | 74 | </EventTriggerBehavior>
|
73 | 75 | </Interaction.Behaviors>
|
74 | 76 | </Button>
|
75 |
| - <ListBox Grid.Row="2" Grid.Column="0" Grid.ColumnSpan="5" |
| 77 | + <!-- Button Behaviors --> |
| 78 | + <Button Content="Open Files" Grid.Row="2" Grid.Column="0" Margin="5,5,0,5"> |
| 79 | + <Interaction.Behaviors> |
| 80 | + <ButtonOpenFilePickerBehavior Command="{Binding OpenFilesCommand}" |
| 81 | + Title="Open Files" |
| 82 | + SuggestedFileName="MyFile" |
| 83 | + AllowMultiple="True" |
| 84 | + FileTypeFilter="Text Files|*.txt|Markdown Files|*.md|All Files|*.*" /> |
| 85 | + </Interaction.Behaviors> |
| 86 | + </Button> |
| 87 | + <Button Content="Open Folders" Grid.Row="2" Grid.Column="2" Margin="0,5,0,5"> |
| 88 | + <Interaction.Behaviors> |
| 89 | + <ButtonOpenFolderPickerBehavior Command="{Binding OpenFoldersCommand}" |
| 90 | + Title="Open Folders" |
| 91 | + AllowMultiple="True" /> |
| 92 | + </Interaction.Behaviors> |
| 93 | + </Button> |
| 94 | + <Button Content="Save File" Grid.Row="2" Grid.Column="4" Margin="0,5,5,5"> |
| 95 | + <Interaction.Behaviors> |
| 96 | + <ButtonSaveFilePickerBehavior Command="{Binding SaveFileCommand}" |
| 97 | + InputConverter="{x:Static StorageItemToPathConverter.Instance}" |
| 98 | + Title="Save Files" |
| 99 | + SuggestedFileName="MyFile" |
| 100 | + DefaultExtension="txt" |
| 101 | + FileTypeChoices="Text Files (*.txt)|*.txt|Markdown Files (*.md)|*.md|All Files (*.*)|*.*" /> |
| 102 | + </Interaction.Behaviors> |
| 103 | + </Button> |
| 104 | + <ListBox Grid.Row="3" Grid.Column="0" Grid.ColumnSpan="5" |
76 | 105 | ItemsSource="{Binding FileItems}" />
|
77 | 106 | </Grid>
|
78 | 107 | </UserControl>
|
0 commit comments