Repository navigation
Expand file tree
/
Copy pathMainWindow.xaml
More file actions
193 lines (193 loc) · 11 KB
/
Copy pathMainWindow.xaml
File metadata and controls
193 lines (193 loc) · 11 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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
<Window x:Class="QuickNoteWidget.MainWindow"
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:local="clr-namespace:QuickNoteWidget"
xmlns:tb="http://www.hardcodet.net/taskbar"
xmlns:converter="clr-namespace:QuickNoteWidget.Converter"
xmlns:mahapps="http://metro.mahapps.com/winfx/xaml/controls"
xmlns:avalonedit="http://icsharpcode.net/sharpdevelop/avalonedit"
mc:Ignorable="d"
KeyDown="Window_KeyDown"
WindowStyle="None"
Title="MainWindow"
Height="350"
Width="650"
MinHeight="200"
MinWidth="200"
ResizeMode="CanResize"
Topmost="{Binding OnTop}"
ShowInTaskbar="{Binding ShowInTaskbar}"
AllowsTransparency="True"
Opacity="{Binding TransparencyValue, UpdateSourceTrigger=PropertyChanged, Mode=TwoWay}"
ContextMenu="{DynamicResource contextMenu}"
PreviewMouseWheel="Window_PreviewMouseWheel">
<Window.Resources>
<converter:AccentToColorConverter x:Key="AccentToColorConverter" />
<converter:StringToFontStyleConverter x:Key="fontStyle" />
<converter:StringToTextDecorationConverter x:Key="textDeco" />
<converter:StringToTextDocumentConverter x:Key="StringToTextDocumentConverter" />
<converter:BoolToVisibilityCollapsedConverter x:Key="BoolToVisibilityCollapsedConverter" />
<Style TargetType="TextBlock">
<Setter Property="Foreground"
Value="{Binding SelectedAccent, UpdateSourceTrigger=PropertyChanged, Mode=TwoWay, Converter={StaticResource AccentToColorConverter}}" />
</Style>
<ContextMenu x:Key="contextMenu">
<MenuItem Header="Select All (Ctrl + A)"
Click="contextSelect_Click" />
<MenuItem Header="Paste (Ctrl + V)"
Click="contextAdd_Click" />
<MenuItem Header="Copy (Ctrl + C)"
Click="contextCopy_Click" />
<MenuItem Header="Save To File (Ctrl + S)"
Click="contextSave_Click" />
<Separator />
<MenuItem Header="Minimize"
Click="contextMinimize_Click" />
<MenuItem Header="Restore"
Click="contextMaximize_Click" />
<MenuItem Header="Exit"
Click="contextClose_Click" />
<Separator />
<MenuItem Header="Settings">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="40" />
<RowDefinition Height="40" />
<RowDefinition Height="40" />
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="13*" />
<ColumnDefinition Width="42*" />
</Grid.ColumnDefinitions>
<TextBlock Text="Theme:"
VerticalAlignment="Center"
Grid.Row="0" />
<ComboBox mahapps:TextBoxHelper.Watermark="Theme"
ItemsSource="{Binding Themes}"
SelectedItem="{Binding SelectedTheme, UpdateSourceTrigger=PropertyChanged, Mode=TwoWay}"
HorizontalAlignment="Stretch"
Height="23"
Margin="5,0,5,0"
Grid.Column="1"
Grid.Row="0" />
<TextBlock Text="Accent:"
VerticalAlignment="Center"
Grid.Row="1" />
<ComboBox mahapps:TextBoxHelper.Watermark="Accent"
ItemsSource="{Binding Accents}"
SelectedItem="{Binding SelectedAccent, UpdateSourceTrigger=PropertyChanged, Mode=TwoWay}"
HorizontalAlignment="Stretch"
Height="23"
Margin="5,0,5,0"
Grid.Column="1"
Grid.Row="1" />
<TextBlock Text="Font: "
Grid.Row="2"
VerticalAlignment="Center" />
<ComboBox Width="140"
mahapps:TextBoxHelper.Watermark="Fonts"
Grid.Row="2"
Grid.Column="1"
VerticalAlignment="Center"
Margin="5,0,5,0"
Height="23"
ItemsSource="{Binding Fonts, UpdateSourceTrigger=PropertyChanged, Mode=TwoWay}"
SelectedItem="{Binding CurrentFont, UpdateSourceTrigger=PropertyChanged, Mode=TwoWay}" />
</Grid>
<CheckBox Content="On Top"
IsChecked="{Binding OnTop}" />
<CheckBox Content="Display Details"
IsChecked="{Binding DisplayDetails}" />
<CheckBox Content="Show in Taskbar"
IsChecked="{Binding ShowInTaskbar}" />
<CheckBox Content="Display Window Resize"
ToolTip="Alt + H(eight) or Alt + W(idth) with Mouse Scrolling for more precise resizing."
IsChecked="{Binding IsWindowResizeBarVisible, UpdateSourceTrigger=PropertyChanged, Mode=TwoWay}" />
</MenuItem>
<MenuItem Header="Reset Settings"
Command="{Binding ResetViewCommand}" />
<MenuItem Header="Info"
Click="Info_Click" />
</ContextMenu>
</Window.Resources>
<Grid Background="{Binding DragAreaColor, UpdateSourceTrigger=PropertyChanged, Mode=TwoWay}">
<DockPanel LastChildFill="True">
<StatusBar Height="32"
Style="{DynamicResource MahApps.Styles.StatusBar}"
DockPanel.Dock="Bottom"
Visibility="{Binding DisplayDetails, Converter={StaticResource BoolToVisibilityCollapsedConverter}}"
VerticalAlignment="Bottom"
Margin="12,6,12,10"
Background="{Binding StatusBarBackground, UpdateSourceTrigger=PropertyChanged, Mode=TwoWay}">
<StatusBarItem VerticalAlignment="Center">
<StackPanel Orientation="Horizontal">
<TextBlock Text="Character Count: " />
<TextBlock Text="{Binding CharacterCount, UpdateSourceTrigger=PropertyChanged}" />
</StackPanel>
</StatusBarItem>
<Separator Margin="10,0,10,0"
HorizontalAlignment="Left" />
<StatusBarItem VerticalAlignment="Center">
<StackPanel Orientation="Horizontal">
<TextBlock Text="Transparency"
VerticalAlignment="Center"
Margin="0,0,10,0" />
<Slider Width="100"
VerticalAlignment="Center"
Minimum="0.3"
Maximum="1"
Value="{Binding TransparencyValue, UpdateSourceTrigger=PropertyChanged, Mode=TwoWay}" />
<TextBlock Margin="10,0,0,0"
VerticalAlignment="Center">
<TextBlock.Inlines>
<Run Text="{Binding TransparencyInPercent, UpdateSourceTrigger=PropertyChanged, Mode=TwoWay}" />
<Run Text="%" />
</TextBlock.Inlines></TextBlock>
</StackPanel>
</StatusBarItem>
<Separator Margin="10,0,10,0"
HorizontalAlignment="Left" />
<StatusBarItem Visibility="{Binding IsWindowResizeBarVisible, UpdateSourceTrigger=PropertyChanged, Mode=TwoWay, Converter={StaticResource BoolToVisibilityCollapsedConverter}}">
<StackPanel Orientation="Horizontal"
ToolTip="Alt + H(eight) or Alt + W(idth) with Mouse Scrolling for more precise resizing.">
<TextBlock Text="Window Size"
VerticalAlignment="Center"
Margin="0,0,5,0" />
<StackPanel Orientation="Horizontal">
<Button Content="-"
x:Name="btnReduceWindowSize"
Width="20"
Click="btnReduceWindowSize_Click" />
<Button Content="+"
x:Name="btnIncreaseWindowSize"
Width="20"
Click="btnIncreaseWindowSize_Click" />
</StackPanel>
</StackPanel>
</StatusBarItem>
</StatusBar>
<avalonedit:TextEditor x:Name="tbxMultiLine"
DockPanel.Dock="Top"
Margin="12,12,12,6"
AllowDrop="True"
mahapps:TextBoxHelper.ClearTextButton="True"
mahapps:TextBoxHelper.SelectAllOnFocus="True"
TextChanged="TbxMultiLine_TextChanged"
Document="{Binding MultiLine, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged, Converter={StaticResource StringToTextDocumentConverter}}"
LineNumbersForeground="{Binding SelectedAccent, UpdateSourceTrigger=PropertyChanged, Mode=TwoWay, Converter={StaticResource AccentToColorConverter}}"
Foreground="{Binding MultiLineTextForegroundColor, UpdateSourceTrigger=PropertyChanged, Mode=TwoWay}"
ShowLineNumbers="True"
WordWrap="True"
FontSize="15"
FontFamily="{Binding CurrentFont, UpdateSourceTrigger=PropertyChanged, Mode=TwoWay}"
PreviewMouseWheel="tbxMultiLine_PreviewMouseWheel" />
</DockPanel>
<tb:TaskbarIcon IconSource=".\Clipboard.ico"
x:Name="TaskbarIcon"
Grid.RowSpan="2"
Grid.ColumnSpan="4" Width="0.5" Height="0.5" VerticalAlignment="Bottom" HorizontalAlignment="Right"
ContextMenu="{DynamicResource contextMenu}" />
</Grid>
</Window>