|
4 | 4 | xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
5 | 5 | xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
6 | 6 | xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
|
| 7 | + xmlns:codeDisplayer="clr-namespace:CodeDisplayer;assembly=CodeDisplayer" |
7 | 8 | mc:Ignorable="d"
|
8 | 9 | d:DesignHeight="300" d:DesignWidth="300">
|
9 |
| - <DockPanel> |
10 |
| - <Menu IsMainMenu="True" DockPanel.Dock="Top"> |
11 |
| - <MenuItem Header="_File"> |
12 |
| - <MenuItem Header="Save"> |
13 |
| - <MenuItem.Icon> |
14 |
| - <materialDesign:PackIcon Kind="ContentSave" /> |
15 |
| - </MenuItem.Icon> |
16 |
| - </MenuItem> |
17 |
| - <MenuItem Header="Save As.." /> |
18 |
| - <MenuItem Header="Exit" InputGestureText="Ctrl+E"> |
19 |
| - <MenuItem.Icon> |
20 |
| - <materialDesign:PackIcon Kind="ExitToApp" /> |
21 |
| - </MenuItem.Icon> |
22 |
| - </MenuItem> |
23 |
| - <Separator /> |
24 |
| - <MenuItem Header="Excellent" IsCheckable="True" IsChecked="True" /> |
25 |
| - <MenuItem Header="Rubbish" IsCheckable="True" /> |
26 |
| - <MenuItem Header="Dig Deeper" InputGestureText="Ctrl+D"> |
27 |
| - <MenuItem Header="Enlightenment?" IsCheckable="True" /> |
28 |
| - <MenuItem Header="Disappointment" IsCheckable="True" /> |
| 10 | + <ScrollViewer> |
| 11 | + <codeDisplayer:XamlDisplayerPanel x:Name="XamlDisplayerPanel"> |
| 12 | + <Menu IsMainMenu="True"> |
| 13 | + <MenuItem Header="_File"> |
| 14 | + <MenuItem Header="Save"> |
| 15 | + <MenuItem.Icon> |
| 16 | + <materialDesign:PackIcon Kind="ContentSave" /> |
| 17 | + </MenuItem.Icon> |
| 18 | + </MenuItem> |
| 19 | + <MenuItem Header="Save As.." /> |
| 20 | + <MenuItem Header="Exit" InputGestureText="Ctrl+E"> |
| 21 | + <MenuItem.Icon> |
| 22 | + <materialDesign:PackIcon Kind="ExitToApp" /> |
| 23 | + </MenuItem.Icon> |
| 24 | + </MenuItem> |
| 25 | + <Separator /> |
| 26 | + <MenuItem Header="Excellent" IsCheckable="True" IsChecked="True" /> |
| 27 | + <MenuItem Header="Rubbish" IsCheckable="True" /> |
| 28 | + <MenuItem Header="Dig Deeper" InputGestureText="Ctrl+D"> |
| 29 | + <MenuItem Header="Enlightenment?" IsCheckable="True" /> |
| 30 | + <MenuItem Header="Disappointment" IsCheckable="True" /> |
| 31 | + </MenuItem> |
| 32 | + <MenuItem Header="Look Deeper" InputGestureText="Ctrl+D"> |
| 33 | + <MenuItem Header="Plain" /> |
| 34 | + <MenuItem Header="Ice Cream" /> |
| 35 | + </MenuItem> |
29 | 36 | </MenuItem>
|
30 |
| - <MenuItem Header="Look Deeper" InputGestureText="Ctrl+D"> |
31 |
| - <MenuItem Header="Plain" /> |
32 |
| - <MenuItem Header="Ice Cream" /> |
| 37 | + <MenuItem Header="_Edit"> |
| 38 | + <MenuItem Header="_Cut" Command="Cut"> |
| 39 | + <MenuItem.Icon> |
| 40 | + <materialDesign:PackIcon Kind="ContentCut" /> |
| 41 | + </MenuItem.Icon> |
| 42 | + </MenuItem> |
| 43 | + <MenuItem Header="_Copy" Command="Copy"> |
| 44 | + <MenuItem.Icon> |
| 45 | + <materialDesign:PackIcon Kind="ContentCopy" /> |
| 46 | + </MenuItem.Icon> |
| 47 | + </MenuItem> |
| 48 | + <MenuItem Header="_Paste" Command="Paste"> |
| 49 | + <MenuItem.Icon> |
| 50 | + <materialDesign:PackIcon Kind="ContentPaste" /> |
| 51 | + </MenuItem.Icon> |
| 52 | + </MenuItem> |
33 | 53 | </MenuItem>
|
34 |
| - </MenuItem> |
35 |
| - <MenuItem Header="_Edit"> |
36 |
| - <MenuItem Header="_Cut" Command="Cut"> |
37 |
| - <MenuItem.Icon> |
| 54 | + </Menu> |
| 55 | + <ToolBarTray> |
| 56 | + <ToolBar Style="{DynamicResource MaterialDesignToolBar}" ClipToBounds="False"> |
| 57 | + <Button ToolTip="Follow me on Twitter" Click="TwitterButton_OnClick"> |
| 58 | + <materialDesign:PackIcon Kind="TwitterBox" /> |
| 59 | + </Button> |
| 60 | + <Button ToolTip="Save"> |
| 61 | + <materialDesign:PackIcon Kind="ContentSave" /> |
| 62 | + </Button> |
| 63 | + <Separator /> |
| 64 | + <Button Command="Cut" ToolTip="Cut" ToolBar.OverflowMode="AsNeeded"> |
38 | 65 | <materialDesign:PackIcon Kind="ContentCut" />
|
39 |
| - </MenuItem.Icon> |
40 |
| - </MenuItem> |
41 |
| - <MenuItem Header="_Copy" Command="Copy"> |
42 |
| - <MenuItem.Icon> |
| 66 | + </Button> |
| 67 | + <Button Command="Copy" ToolTip="Copy that stuff" ToolBar.OverflowMode="AsNeeded"> |
43 | 68 | <materialDesign:PackIcon Kind="ContentCopy" />
|
44 |
| - </MenuItem.Icon> |
45 |
| - </MenuItem> |
46 |
| - <MenuItem Header="_Paste" Command="Paste"> |
47 |
| - <MenuItem.Icon> |
| 69 | + </Button> |
| 70 | + <Button Command="Paste" ToolTip="Paste some stuff" ToolBar.OverflowMode="AsNeeded"> |
48 | 71 | <materialDesign:PackIcon Kind="ContentPaste" />
|
49 |
| - </MenuItem.Icon> |
50 |
| - </MenuItem> |
51 |
| - </MenuItem> |
52 |
| - </Menu> |
53 |
| - <ToolBarTray DockPanel.Dock="Top"> |
54 |
| - <ToolBar Style="{DynamicResource MaterialDesignToolBar}" ClipToBounds="False"> |
55 |
| - <Button ToolTip="Follow me on Twitter" Click="TwitterButton_OnClick"> |
56 |
| - <materialDesign:PackIcon Kind="TwitterBox" /> |
57 |
| - </Button> |
58 |
| - <Button ToolTip="Save"> |
59 |
| - <materialDesign:PackIcon Kind="ContentSave" /> |
60 |
| - </Button> |
61 |
| - <Separator /> |
62 |
| - <Button Command="Cut" ToolTip="Cut" ToolBar.OverflowMode="AsNeeded"> |
63 |
| - <materialDesign:PackIcon Kind="ContentCut" /> |
64 |
| - </Button> |
65 |
| - <Button Command="Copy" ToolTip="Copy that stuff" ToolBar.OverflowMode="AsNeeded"> |
66 |
| - <materialDesign:PackIcon Kind="ContentCopy" /> |
67 |
| - </Button> |
68 |
| - <Separator /> |
69 |
| - <Button Command="Paste" ToolTip="Paste some stuff" ToolBar.OverflowMode="AsNeeded"> |
70 |
| - <materialDesign:PackIcon Kind="ContentPaste" /> |
71 |
| - </Button> |
72 |
| - <!-- when badging in a toolbar, make sure the parent ToolBar.ClipToBounds="False", and |
| 72 | + </Button> |
| 73 | + </ToolBar> |
| 74 | + </ToolBarTray> |
| 75 | + <ToolBarTray> |
| 76 | + <ToolBar ClipToBounds="False"> |
| 77 | + <!-- when badging in a toolbar, make sure the parent ToolBar.ClipToBounds="False", and |
73 | 78 | manually apply the button style -->
|
74 |
| - <materialDesign:Badged ToolBar.OverflowMode="AsNeeded" Badge="{materialDesign:PackIcon Alert}"> |
75 |
| - <Button ToolTip="Badge it up!" Style="{StaticResource {x:Static ToolBar.ButtonStyleKey}}"> |
76 |
| - <materialDesign:PackIcon Kind="AirplaneTakeoff" /> |
| 79 | + <materialDesign:Badged ToolBar.OverflowMode="AsNeeded" Badge="{materialDesign:PackIcon Alert}"> |
| 80 | + <Button ToolTip="Badge it up!" Style="{StaticResource {x:Static ToolBar.ButtonStyleKey}}"> |
| 81 | + <materialDesign:PackIcon Kind="AirplaneTakeoff" /> |
| 82 | + </Button> |
| 83 | + </materialDesign:Badged> |
| 84 | + <Separator/> |
| 85 | + <ListBox> |
| 86 | + <ListBoxItem ToolTip="This is a lonley toggle with TextBlock instead of icon"> |
| 87 | + <TextBlock>W</TextBlock> |
| 88 | + </ListBoxItem> |
| 89 | + </ListBox> |
| 90 | + <Separator /> |
| 91 | + <ListBox SelectedIndex="0"> |
| 92 | + <ListBox.ToolTip> |
| 93 | + <StackPanel> |
| 94 | + <TextBlock Text="MaterialDesignToolToggleFlatListBox" /> |
| 95 | + <TextBlock Text="Exclusive selection" /> |
| 96 | + <TextBlock Text="ListBoxAssist.IsToggle allows more natural toggle behaviour" /> |
| 97 | + </StackPanel> |
| 98 | + </ListBox.ToolTip> |
| 99 | + <ListBoxItem > |
| 100 | + <materialDesign:PackIcon Kind="FormatAlignLeft"/> |
| 101 | + </ListBoxItem> |
| 102 | + <ListBoxItem> |
| 103 | + <materialDesign:PackIcon Kind="FormatAlignCenter"/> |
| 104 | + </ListBoxItem> |
| 105 | + <ListBoxItem> |
| 106 | + <materialDesign:PackIcon Kind="FormatAlignRight"/> |
| 107 | + </ListBoxItem> |
| 108 | + <ListBoxItem> |
| 109 | + <materialDesign:PackIcon Kind="FormatAlignJustify"/> |
| 110 | + </ListBoxItem> |
| 111 | + </ListBox> |
| 112 | + |
| 113 | + </ToolBar> |
| 114 | + </ToolBarTray> |
| 115 | + <ToolBarTray> |
| 116 | + <ToolBar> |
| 117 | + <Separator/> |
| 118 | + <ListBox SelectionMode="Extended"> |
| 119 | + <ListBox.ToolTip> |
| 120 | + <StackPanel> |
| 121 | + <TextBlock Text="MaterialDesignToolToggleListBox" /> |
| 122 | + <TextBlock Text="Multiple selection" /> |
| 123 | + <TextBlock Text="ListBoxAssist.IsToggle allows more natural toggle behaviour" /> |
| 124 | + </StackPanel> |
| 125 | + </ListBox.ToolTip> |
| 126 | + <ListBoxItem> |
| 127 | + <materialDesign:PackIcon Kind="FormatBold"/> |
| 128 | + </ListBoxItem> |
| 129 | + <ListBoxItem> |
| 130 | + <materialDesign:PackIcon Kind="FormatItalic"/> |
| 131 | + </ListBoxItem> |
| 132 | + <ListBoxItem x:Name="UnderlineCheckbox"> |
| 133 | + <materialDesign:PackIcon Kind="FormatUnderline"/> |
| 134 | + </ListBoxItem> |
| 135 | + </ListBox> |
| 136 | + <Separator/> |
| 137 | + <Label Content="Font size:" VerticalAlignment="Center"/> |
| 138 | + <ComboBox> |
| 139 | + <ComboBoxItem Content="10"/> |
| 140 | + <ComboBoxItem IsSelected="True" Content="12"/> |
| 141 | + <ComboBoxItem Content="14"/> |
| 142 | + <ComboBoxItem Content="16"/> |
| 143 | + </ComboBox> |
| 144 | + <CheckBox> |
| 145 | + Check |
| 146 | + </CheckBox> |
| 147 | + <Button ToolTip="Take a nap" ToolBar.OverflowMode="Always"> |
| 148 | + <materialDesign:PackIcon Kind="Hotel" /> |
77 | 149 | </Button>
|
78 |
| - </materialDesign:Badged> |
79 |
| - <Separator/> |
80 |
| - <ListBox> |
81 |
| - <ListBoxItem ToolTip="This is a lonley toggle with TextBlock instead of icon"> |
82 |
| - <TextBlock>W</TextBlock> |
83 |
| - </ListBoxItem> |
84 |
| - </ListBox> |
85 |
| - <Separator/> |
86 |
| - <ListBox SelectedIndex="0"> |
87 |
| - <ListBox.ToolTip> |
88 |
| - <StackPanel> |
89 |
| - <TextBlock Text="MaterialDesignToolToggleFlatListBox" /> |
90 |
| - <TextBlock Text="Exclusive selection" /> |
91 |
| - <TextBlock Text="ListBoxAssist.IsToggle allows more natural toggle behaviour" /> |
92 |
| - </StackPanel> |
93 |
| - </ListBox.ToolTip> |
94 |
| - <ListBoxItem > |
95 |
| - <materialDesign:PackIcon Kind="FormatAlignLeft"/> |
96 |
| - </ListBoxItem> |
97 |
| - <ListBoxItem> |
98 |
| - <materialDesign:PackIcon Kind="FormatAlignCenter"/> |
99 |
| - </ListBoxItem> |
100 |
| - <ListBoxItem> |
101 |
| - <materialDesign:PackIcon Kind="FormatAlignRight"/> |
102 |
| - </ListBoxItem> |
103 |
| - <ListBoxItem> |
104 |
| - <materialDesign:PackIcon Kind="FormatAlignJustify"/> |
105 |
| - </ListBoxItem> |
106 |
| - </ListBox> |
107 |
| - <Separator/> |
108 |
| - <ListBox SelectionMode="Extended"> |
109 |
| - <ListBox.ToolTip> |
110 |
| - <StackPanel> |
111 |
| - <TextBlock Text="MaterialDesignToolToggleListBox" /> |
112 |
| - <TextBlock Text="Multiple selection" /> |
113 |
| - <TextBlock Text="ListBoxAssist.IsToggle allows more natural toggle behaviour" /> |
114 |
| - </StackPanel> |
115 |
| - </ListBox.ToolTip> |
116 |
| - <ListBoxItem> |
117 |
| - <materialDesign:PackIcon Kind="FormatBold"/> |
118 |
| - </ListBoxItem> |
119 |
| - <ListBoxItem> |
120 |
| - <materialDesign:PackIcon Kind="FormatItalic"/> |
121 |
| - </ListBoxItem> |
122 |
| - <ListBoxItem x:Name="UnderlineCheckbox"> |
123 |
| - <materialDesign:PackIcon Kind="FormatUnderline"/> |
124 |
| - </ListBoxItem> |
125 |
| - </ListBox> |
126 |
| - <Separator/> |
127 |
| - <Label Content="Font size:" VerticalAlignment="Center"/> |
128 |
| - <ComboBox> |
129 |
| - <ComboBoxItem Content="10"/> |
130 |
| - <ComboBoxItem IsSelected="True" Content="12"/> |
131 |
| - <ComboBoxItem Content="14"/> |
132 |
| - <ComboBoxItem Content="16"/> |
133 |
| - </ComboBox> |
134 |
| - <CheckBox> |
135 |
| - Check |
136 |
| - </CheckBox> |
137 |
| - <Button ToolTip="Take a nap" ToolBar.OverflowMode="Always"> |
138 |
| - <materialDesign:PackIcon Kind="Hotel" /> |
139 |
| - </Button> |
140 |
| - <RadioButton GroupName="XXX" Content="Radio" /> |
141 |
| - <RadioButton GroupName="XXX" Content="Ga Ga" /> |
142 |
| - <ToggleButton/> |
143 |
| - </ToolBar> |
144 |
| - </ToolBarTray> |
145 |
| - |
146 |
| - <TextBox Margin="16" VerticalAlignment="Top" HorizontalAlignment="Left"> |
147 |
| - With Default Context Menu |
148 |
| - </TextBox> |
| 150 | + <RadioButton GroupName="XXX" Content="Radio" /> |
| 151 | + <RadioButton GroupName="XXX" Content="Ga Ga" /> |
| 152 | + <ToggleButton/> |
| 153 | + </ToolBar> |
| 154 | + </ToolBarTray> |
149 | 155 |
|
150 |
| - <TextBox Margin="16" VerticalAlignment="Top" HorizontalAlignment="Left"> |
151 |
| - <TextBox.ContextMenu> |
152 |
| - <ContextMenu> |
153 |
| - <MenuItem Header="Hello World" /> |
154 |
| - <MenuItem Header="Clickety Click"> |
155 |
| - <MenuItem Header="Clackety Clack" /> |
156 |
| - </MenuItem> |
157 |
| - </ContextMenu> |
158 |
| - </TextBox.ContextMenu> |
159 |
| - With Custom Context Menu |
160 |
| - </TextBox> |
| 156 | + <TextBox Margin="16" VerticalAlignment="Top" HorizontalAlignment="Left"> |
| 157 | + With Default Context Menu (Right click me!) |
| 158 | + </TextBox> |
161 | 159 |
|
162 |
| - </DockPanel> |
| 160 | + <TextBox Margin="16" VerticalAlignment="Top" HorizontalAlignment="Left"> |
| 161 | + <TextBox.ContextMenu> |
| 162 | + <ContextMenu> |
| 163 | + <MenuItem Header="Hello World" /> |
| 164 | + <MenuItem Header="Clickety Click"> |
| 165 | + <MenuItem Header="Clackety Clack" /> |
| 166 | + </MenuItem> |
| 167 | + </ContextMenu> |
| 168 | + </TextBox.ContextMenu> |
| 169 | + With Custom Context Menu (Right click me!) |
| 170 | + </TextBox> |
| 171 | + |
| 172 | + </codeDisplayer:XamlDisplayerPanel> |
| 173 | + </ScrollViewer> |
163 | 174 | </UserControl>
|
| 175 | + |
0 commit comments