-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMainPage.xaml
More file actions
74 lines (73 loc) · 4.57 KB
/
MainPage.xaml
File metadata and controls
74 lines (73 loc) · 4.57 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
<Page
x:Class="MyScript.InteractiveInk.Views.MainPage"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:viewModels="using:MyScript.InteractiveInk.ViewModels"
xmlns:winui="using:Microsoft.Toolkit.Uwp.UI.Controls"
xmlns:iink="using:MyScript.InteractiveInk.UI.Xaml.Controls"
xmlns:controls="using:MyScript.InteractiveInk.Views.Controls"
xmlns:enumerations="using:MyScript.InteractiveInk.Common.Enumerations"
mc:Ignorable="d"
Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">
<Page.Resources>
<viewModels:MainViewModel x:Name="ViewModel" />
</Page.Resources>
<winui:HeaderedContentControl HorizontalContentAlignment="Stretch"
VerticalContentAlignment="Stretch">
<winui:HeaderedContentControl.Header>
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition />
<ColumnDefinition />
<ColumnDefinition />
</Grid.ColumnDefinitions>
<controls:MainMenuBar Grid.Column="0"
DataContext="{x:Bind ViewModel.Commands, Mode=OneWay}"
Margin="{StaticResource SmallRightMargin}" />
<iink:InteractiveInkToolbar Grid.Column="1" HorizontalAlignment="Center" VerticalAlignment="Stretch"
TargetInkCanvas="{x:Bind InteractiveInkCanvas}" />
<controls:MainCommandBar Grid.Column="2"
DataContext="{x:Bind ViewModel.Commands, Mode=OneWay}"
Margin="{StaticResource SmallLeftMargin}" />
</Grid>
</winui:HeaderedContentControl.Header>
<Grid Background="White">
<iink:InteractiveInkCanvas x:Name="InteractiveInkCanvas"
Editor="{x:Bind ViewModel.Editor, Mode=OneWay}"
Holding="OnHolding">
<iink:InteractiveInkCanvas.ContextFlyout>
<MenuFlyout>
<MenuFlyoutSubItem x:Uid="ContextMenuAdd"
IsEnabled="{x:Bind ViewModel.Commands.ContentCommands.CanAddBlock, Mode=OneWay}">
<MenuFlyoutItem x:Uid="ContextMenuAddDiagram"
Command="{x:Bind ViewModel.Commands.ContentCommands.CommandAddContent}">
<MenuFlyoutItem.CommandParameter>
<enumerations:ContentType>Diagram</enumerations:ContentType>
</MenuFlyoutItem.CommandParameter>
</MenuFlyoutItem>
<MenuFlyoutItem x:Uid="ContextMenuAddImage"
Command="{x:Bind ViewModel.Commands.ContentCommands.CommandAddImage}" />
<MenuFlyoutItem x:Uid="ContextMenuAddMath"
Command="{x:Bind ViewModel.Commands.ContentCommands.CommandAddContent}">
<MenuFlyoutItem.CommandParameter>
<enumerations:ContentType>Math</enumerations:ContentType>
</MenuFlyoutItem.CommandParameter>
</MenuFlyoutItem>
<MenuFlyoutItem x:Uid="ContextMenuAddRawContent"
Command="{x:Bind ViewModel.Commands.ContentCommands.CommandAddContent}">
<MenuFlyoutItem.CommandParameter>
<enumerations:ContentType>RawContent</enumerations:ContentType>
</MenuFlyoutItem.CommandParameter>
</MenuFlyoutItem>
</MenuFlyoutSubItem>
<MenuFlyoutItem x:Uid="ContextMenuRemove"
Command="{x:Bind ViewModel.Commands.ContentCommands.CommandRemoveContent}"
IsEnabled="{x:Bind ViewModel.Commands.ContentCommands.CanRemoveBlock, Mode=OneWay}" />
</MenuFlyout>
</iink:InteractiveInkCanvas.ContextFlyout>
</iink:InteractiveInkCanvas>
</Grid>
</winui:HeaderedContentControl>
</Page>