-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathMainWindow.xaml
More file actions
184 lines (178 loc) · 9.54 KB
/
Copy pathMainWindow.xaml
File metadata and controls
184 lines (178 loc) · 9.54 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
<Window x:Class="SylverInk.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:SylverInk"
mc:Ignorable="d"
d:DataContext="{d:DesignInstance Type=local:ContextSettings}"
Background="{Binding MenuBackground}" Closing="MainWindow_Closing" Foreground="{Binding MenuForeground}" Height="625" MinHeight="450" MinWidth="400" MouseLeftButtonDown="Drag" ResizeMode="NoResize" SizeChanged="MainWindow_SizeChanged" Title="Sylver Ink" Width="450">
<Window.Resources>
<ResourceDictionary>
<Style BasedOn="{StaticResource LBIStyle}" TargetType="{x:Type ListBoxItem}">
<EventSetter Event="MouseUp" Handler="MenuSublistChanged" />
</Style>
<DataTemplate x:Key="DatabaseContentTemplate">
<TabControl Background="{Binding MenuBackground}" BorderBrush="{Binding AccentBackground}" BorderThickness="2" Foreground="{Binding MenuForeground}" Grid.Row="1" Margin="-3,0" SelectedIndex="0" SelectionChanged="MenuTabChanged" x:Name="NotesPanel">
<TabItem>
<TabItem.Header>
<Grid>
<Label Content="+"/>
</Grid>
</TabItem.Header>
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="*"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<Grid Margin="10">
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="*"/>
</Grid.RowDefinitions>
<StackPanel HorizontalAlignment="Right" Orientation="Horizontal" VerticalAlignment="Bottom">
<Label Content="Recent notes" FontStyle="Italic"/>
<Label Content="(?)" Foreground="{Binding AccentForeground}" ToolTip="You can press Ctrl+L to re-open the note you most recently closed."/>
</StackPanel>
<Border Grid.Row="1" BorderBrush="{Binding AccentBackground}" BorderThickness="1">
<Grid Background="{Binding AccentBackground}">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions>
<ListBox AlternationCount="2" BorderThickness="0" ItemsSource="{Binding RecentNotes}" Margin="0,0,1,0" ClipToBounds="True" MinWidth="60"
ScrollViewer.HorizontalScrollBarVisibility="Disabled"
ScrollViewer.VerticalScrollBarVisibility="Disabled"
x:Name="ShortChanges">
<ListBox.ItemTemplate>
<DataTemplate>
<TextBlock HorizontalAlignment="Right" Text="{Binding ShortChange}" ToolTip="{Binding FullDateChange}" ToolTipService.InitialShowDelay="250"/>
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
<ListBox AlternationCount="2" BorderThickness="0" Grid.Column="1" ItemsSource="{Binding RecentNotes}" Margin="1,0,0,0" ClipToBounds="True"
ScrollViewer.HorizontalScrollBarVisibility="Disabled"
ScrollViewer.VerticalScrollBarVisibility="Disabled"
x:Name="RecentNotes">
<ListBox.ItemTemplate>
<DataTemplate>
<TextBlock ClipToBounds="True" HorizontalAlignment="Right" Text="{Binding Preview}" TextTrimming="CharacterEllipsis"/>
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
</Grid>
</Border>
</Grid>
<StackPanel HorizontalAlignment="Right" Orientation="Horizontal" Grid.Row="1" VerticalAlignment="Bottom">
<Label Content="New note" FontStyle="Italic"/>
<Label Content="(?)" Foreground="{Binding AccentForeground}" ToolTip="Write a line of text and press Enter to create a new note. You can also press Ctrl+N to open a sticky note at any time."/>
</StackPanel>
<TextBox KeyDown="NewNote_Keydown" Margin="5" Grid.Row="2" VerticalAlignment="Top"/>
<Grid Margin="0,10" Grid.Row="3">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="*"/>
<RowDefinition Height="*"/>
<RowDefinition Height="*"/>
</Grid.RowDefinitions>
<Button Click="Button_Click" Grid.Column="1" Content="Search"/>
<Button Click="Button_Click" Grid.Column="3" Content="Replace" Grid.Row="2" x:Name="ReplaceButton"/>
<Button Click="Button_Click" Grid.Column="3" Content="Import"/>
<Button Click="Button_Click" Grid.Column="1" Content="Settings" Grid.Row="2"/>
<Button Background="{Binding AccentBackground}" Click="Button_Click" Grid.Column="2" Content="Exit" Foreground="{Binding AccentForeground}" Grid.Row="1"/>
</Grid>
</Grid>
</TabItem>
</TabControl>
</DataTemplate>
</ResourceDictionary>
</Window.Resources>
<Grid Background="{Binding AccentBackground}" x:Name="MainGrid">
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="*"/>
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<Popup Closed="PopupRenameClosed" Height="75" IsOpen="False" KeyDown="PopupRenameKeyDown" Placement="Mouse" PopupAnimation="Fade" StaysOpen="False" Width="275" x:Name="RenameDatabase">
<Border BorderBrush="{Binding MenuForeground}" BorderThickness="1">
<Grid Background="{Binding MenuBackground}">
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<TextBox Width="250" Margin="0,10" x:Name="DatabaseNameBox"/>
<Button Click="PopupRenameClosed" Content="Save" Margin="0,5" Grid.Row="1"/>
</Grid>
</Border>
</Popup>
<Popup Height="75" IsOpen="False" KeyDown="PopupAddressKeyDown" Placement="Mouse" PopupAnimation="Fade" StaysOpen="False" Width="275" x:Name="ConnectAddress">
<Border BorderBrush="{Binding MenuForeground}" BorderThickness="1">
<Grid Background="{Binding MenuBackground}">
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<StackPanel HorizontalAlignment="Center" Orientation="Horizontal" VerticalAlignment="Center">
<Label Content="Address Code:"/>
<TextBox Width="75" Margin="0,10" x:Name="AddressBox"/>
<Label Content="(?)" Foreground="{Binding AccentForeground}" ToolTip="Enter a code generated by the Sylver Ink server."/>
</StackPanel>
<Button Click="PopupSaveAddress" Content="Connect" Margin="0,5" Grid.Row="1"/>
</Grid>
</Border>
</Popup>
<Popup Closed="PopupCodeClosed" Height="75" IsOpen="False" Placement="Mouse" PopupAnimation="Fade" StaysOpen="False" Width="275" x:Name="CodePopup">
<Border BorderBrush="{Binding MenuForeground}" BorderThickness="1">
<Grid Background="{Binding MenuBackground}">
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<StackPanel HorizontalAlignment="Center" Orientation="Horizontal" VerticalAlignment="Center">
<Label Content="Address Code:"/>
<TextBox Margin="0,10" IsReadOnly="True" Width="75" x:Name="CodeBox"/>
<Label Content="(?)" Foreground="{Binding AccentForeground}" ToolTip="Enter this code in another Sylver Ink installation to connect to the database."/>
</StackPanel>
<Button Click="PopupCodeClosed" Content="Copy" Margin="0,5" Grid.Row="1"/>
</Grid>
</Border>
</Popup>
<Menu x:Name="DatabaseMenu">
<MenuItem Header="File" Height="25">
<MenuItem Click="MenuCreate" Header="New" Tag="Always"/>
<MenuItem Click="MenuOpen" Header="Open..." Tag="Always"/>
<MenuItem Click="MenuSaveAs" Header="Save as..." Tag="Always"/>
<MenuItem Click="MenuSaveLocal" Header="Save to Documents" Tag="Always"/>
<MenuItem Click="MenuDelete" Header="Delete" IsEnabled="False"/>
</MenuItem>
<MenuItem Header="Database" Height="25">
<MenuItem Click="MenuClose" Header="Close" IsEnabled="False"/>
<MenuItem Click="MenuBackup" Header="Backup..." Tag="Always"/>
<MenuItem Click="MenuRename" Header="Rename" Tag="Always"/>
<MenuItem Click="MenuProperties" Header="Properties" Tag="Always"/>
</MenuItem>
<MenuItem Header="Network" Height="25">
<MenuItem Click="MenuUnserve" Header="Close to Network" IsEnabled="False" Tag="Serving"/>
<MenuItem Click="MenuConnect" Header="Connect" Tag="NotConnected"/>
<MenuItem Click="MenuDisconnect" Header="Disconnect" IsEnabled="False" Tag="Connected"/>
<MenuItem Click="MenuServe" Header="Open to Network" Tag="NotServing"/>
<MenuItem Click="MenuCopyCode" Header="Copy Address Code" IsEnabled="False" Tag="Serving"/>
</MenuItem>
<MenuItem Header="Help" Height="25">
<MenuItem Click="MenuShowAbout" Header="About..." Tag="Always"/>
</MenuItem>
</Menu>
<Label Content="Sylver Ink" FontSize="16" FontStyle="Italic" FontWeight="Light" Grid.Row="1" HorizontalAlignment="Center" Margin="0,15" VerticalAlignment="Top"/>
<TabControl Background="{Binding MenuBackground}" BorderThickness="0" Foreground="{Binding MenuForeground}" Grid.Row="2" SelectionChanged="MenuTabChanged" x:Name="DatabasesPanel"/>
<Label Content="{Binding VersionString}" FontSize="9" FontStyle="Italic" FontWeight="Light" HorizontalAlignment="Right" Margin="0,5" Grid.Row="3" VerticalAlignment="Bottom"/>
</Grid>
</Window>