forked from changbowen/DesktopNote
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Win_Format.xaml
153 lines (146 loc) · 9.68 KB
/
Win_Format.xaml
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
<l:RoundedWindow
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:l="clr-namespace:DesktopNote"
xmlns:wtk="http://schemas.xceed.com/wpf/xaml/toolkit" xmlns:Themes="clr-namespace:Xceed.Wpf.Toolkit.Themes;assembly=Xceed.Wpf.Toolkit" x:Class="DesktopNote.Win_Format" x:Name="FB1"
CloseBehavior="FadeOutAndHide" Focusable="False" SizeToContent="WidthAndHeight"
UseLayoutRounding="True" FontSize="10" ShowInTaskbar="False" ShowActivated="False" ButtonCloseVisible="False"
Topmost="True" ResizeMode="NoResize" FadingIn="FB1_FadingIn" Loaded="FB1_Loaded">
<Grid x:Name="Grid_Controls">
<Grid.Resources>
<Style TargetType="{x:Type Button}" BasedOn="{StaticResource ContentControlBaseStyle}">
<Setter Property="HorizontalAlignment" Value="Center"/>
<Setter Property="VerticalAlignment" Value="Center"/>
<Setter Property="CommandTarget" Value="{Binding RTB_Main, ElementName=FB1, Mode=OneWay}"/>
<Style.Triggers>
<Trigger Property="IsPressed" Value="True">
<Setter Property="Background" Value="{DynamicResource {x:Static SystemColors.ControlDarkBrushKey}}"/>
</Trigger>
</Style.Triggers>
</Style>
<Style TargetType="{x:Type ContentControl}" BasedOn="{StaticResource ContentControlBaseStyle}">
<Setter Property="Padding" Value="0"/>
<Setter Property="HorizontalContentAlignment" Value="Stretch"/>
<Setter Property="VerticalContentAlignment" Value="Center"/>
</Style>
<wtk:ColorPicker x:Key="CP_Main" x:Shared="False" Width="24" Height="24" ColorMode="ColorCanvas" BorderThickness="0"
ShowRecentColors="True" SelectedColorChanged="ColorChange" SelectedColor="Black" ShowDropDownButton="False"
VerticalContentAlignment="Stretch" HorizontalContentAlignment="Stretch">
</wtk:ColorPicker>
</Grid.Resources>
<Grid.ColumnDefinitions>
<ColumnDefinition/>
<ColumnDefinition/>
<ColumnDefinition/>
<ColumnDefinition/>
<ColumnDefinition/>
<ColumnDefinition/>
<ColumnDefinition/>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<ContentControl Grid.Column="0" Grid.Row="0" Grid.ColumnSpan="6">
<wtk:WatermarkTextBox x:Name="WTB_FileName" BorderThickness="0" KeepWatermarkOnGotFocus="True" VerticalContentAlignment="Center"
Height="{Binding ActualHeight, Mode=OneWay, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type ContentControl}}}"
Width="164" TextChanged="WTB_FileName_TextChanged" Watermark="{StaticResource label_filename}">
<wtk:WatermarkTextBox.WatermarkTemplate>
<DataTemplate>
<TextBlock Text="{Binding}" Foreground="Gray"/>
</DataTemplate>
</wtk:WatermarkTextBox.WatermarkTemplate>
</wtk:WatermarkTextBox>
</ContentControl>
<Button Grid.Column="6" Grid.Row="0" ToolTip="{StaticResource tooltip_find}" Click="Find">
<Image Stretch="None" Source="Resources/FindText.ico"/>
</Button>
<Button Grid.Column="0" Grid.Row="1" Command="Undo" ToolTip="{StaticResource tooltip_undo}">
<Image Stretch="None" Source="Resources/Undo.ico"/>
</Button>
<Button Grid.Column="1" Grid.Row="1" Command="Redo" ToolTip="{StaticResource tooltip_redo}">
<Image Stretch="None" Source="Resources/Redo.ico"/>
</Button>
<Button Grid.Column="2" Grid.Row="1" Command="Copy" ToolTip="{StaticResource tooltip_copy}">
<Image Stretch="None" Source="Resources/Copy.ico"/>
</Button>
<Button Grid.Column="3" Grid.Row="1" Command="Cut" ToolTip="{StaticResource tooltip_cut}">
<Image Stretch="None" Source="Resources/Cut.ico"/>
</Button>
<Button Grid.Column="4" Grid.Row="1" Command="Paste" ToolTip="{StaticResource tooltip_paste}">
<Image Stretch="None" Source="Resources/Paste.ico"/>
</Button>
<Button Grid.Column="5" Grid.Row="1" ToolTip="{StaticResource tooltip_paste_text}" Click="PasteAsText">
<Image Stretch="None" Source="Resources/PasteTextOnly.ico"/>
</Button>
<Button Grid.Column="6" Grid.Row="1" Click="ToggleHighlight" ToolTip="{StaticResource tooltip_highlight}">
<Image Stretch="None" Source="Resources/TextHighlightColorPicker.ico"/>
</Button>
<Button Grid.Column="0" Grid.Row="2" Command="ToggleBold" ToolTip="{StaticResource tooltip_bold}">
<Image Stretch="None" Source="Resources/Bold.ico"/>
</Button>
<Button Grid.Column="1" Grid.Row="2" Command="ToggleItalic" ToolTip="{StaticResource tooltip_italic}">
<Image Stretch="None" Source="Resources/Italic.ico"/>
</Button>
<Button Grid.Column="2" Grid.Row="2" Command="ToggleUnderline" ToolTip="{StaticResource tooltip_underline}">
<Image Stretch="None" Source="Resources/Underline.ico"/>
</Button>
<Button Grid.Column="3" Grid.Row="2" Click="ToggleStrike" ToolTip="{StaticResource tooltip_strikethrough}">
<Image Stretch="None" Source="Resources/Strikethrough.ico"/>
</Button>
<ContentControl Grid.Column="4" Grid.Row="2" x:Name="CP_Font" Content="{StaticResource CP_Main}" ToolTip="{StaticResource tooltip_font_color}"/>
<ContentControl Grid.Column="5" Grid.Row="2" x:Name="CP_Back" Content="{StaticResource CP_Main}" ToolTip="{StaticResource tooltip_back_color}"/>
<ContentControl Grid.Column="6" Grid.Row="2" x:Name="CP_Paper" Content="{StaticResource CP_Main}" ToolTip="{StaticResource tooltip_paper_color}"/>
<ContentControl Grid.Column="0" Grid.Row="3" Grid.ColumnSpan="4" Width="108">
<ComboBox x:Name="CB_Font" IsEditable="True" SelectedValuePath="Content" BorderThickness="0"
Height="{Binding ActualHeight, Mode=OneWay, RelativeSource={RelativeSource AncestorType={x:Type ContentControl}}}"
VerticalContentAlignment="Center" SelectionChanged="CB_Font_SelectionChanged"/>
</ContentControl>
<Button Grid.Column="6" Grid.Row="3" Click="IncreaseSize" ToolTip="{StaticResource tooltip_increase_size}">
<Image Stretch="None" Source="Resources/SizeIncrease.ico"/>
</Button>
<Button Grid.Column="4" Grid.Row="3" Command="IncreaseIndentation" ToolTip="{StaticResource tooltip_increase_indent}">
<Image Stretch="None" Source="Resources/IndentIncrease.ico"/>
</Button>
<Button Grid.Column="5" Grid.Row="3" Command="DecreaseIndentation" ToolTip="{StaticResource tooltip_decrease_indent}">
<Image Stretch="None" Source="Resources/IndentDecrease.ico"/>
</Button>
<Button Grid.Column="6" Grid.Row="4" Click="DecreaseSize" ToolTip="{StaticResource tooltip_decrease_size}">
<Image Stretch="None" Source="Resources/SizeDecrease.ico"/>
</Button>
<Button Grid.Column="0" Grid.Row="4" Command="ToggleBullets" ToolTip="{StaticResource tooltip_bullets}">
<Image Stretch="None" Source="Resources/Bullets.ico"/>
</Button>
<Button Grid.Column="1" Grid.Row="4" Command="ToggleNumbering" ToolTip="{StaticResource tooltip_numbering}">
<Image Stretch="None" Source="Resources/Numbering.ico"/>
</Button>
<Button Grid.Column="2" Grid.Row="4" Command="AlignLeft" ToolTip="{StaticResource tooltip_align_left}">
<Image Stretch="None" Source="Resources/AlignLeft.ico"/>
</Button>
<Button Grid.Column="3" Grid.Row="4" Command="AlignCenter" ToolTip="{StaticResource tooltip_align_center}">
<Image Stretch="None" Source="Resources/AlignCenter.ico"/>
</Button>
<Button Grid.Column="4" Grid.Row="4" Command="AlignRight" ToolTip="{StaticResource tooltip_align_right}">
<Image Stretch="None" Source="Resources/AlignRight.ico"/>
</Button>
<Button Grid.Column="5" Grid.Row="4" Command="AlignJustify" ToolTip="{StaticResource tooltip_align_justify}">
<Image Stretch="None" Source="Resources/AlignJustify.ico"/>
</Button>
<UniformGrid Grid.Column="0" Grid.Row="5" Grid.ColumnSpan="7" Grid.RowSpan="1" Rows="1">
<Button Content="{StaticResource menu_newnote}" Click="Button_NewNote_Click" HorizontalAlignment="Stretch"/>
<Button Content="{StaticResource menu_opennote}" Click="Button_OpenNote_Click" HorizontalAlignment="Stretch"/>
<Button Content="{StaticResource menu_close}" Click="Button_Close_Click" HorizontalAlignment="Stretch"/>
</UniformGrid>
<UniformGrid Grid.Column="0" Grid.Row="6" Grid.ColumnSpan="7" Grid.RowSpan="1" Rows="1">
<Button Content="{StaticResource menu_options}" Click="Button_Options_Click" HorizontalAlignment="Stretch"/>
<Button Content="{StaticResource menu_exit}" Click="Button_Exit_Click" HorizontalAlignment="Stretch"/>
</UniformGrid>
</Grid>
</l:RoundedWindow>