-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMainWindow.xaml
144 lines (128 loc) · 8.06 KB
/
MainWindow.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
<Window x:Class="Google_Bookmarks_Manager_for_GPOs.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
xmlns:local="clr-namespace:Google_Bookmarks_Manager_for_GPOs"
Title="Google Bookmarks for GPO" Height="500" Width="850"
Icon="/book.png"
PreviewKeyDown="Window_PreviewKeyDown"
TextElement.Foreground="{DynamicResource MaterialDesign.Brush.Foreground}"
Background="{DynamicResource MaterialDesign.Brush.Background}"
TextElement.FontWeight="Regular"
TextElement.FontSize="12"
FontFamily="{materialDesign:MaterialDesignFont}"
TextOptions.TextFormattingMode="Ideal"
TextOptions.TextRenderingMode="Auto">
<Window.Resources>
<local:FolderIconConverter x:Key="FolderIconConverter" />
<local:BooleanToVisibilityConverter x:Key="BooleanToVisibilityConverter" />
</Window.Resources>
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="2*" />
<!-- TreeView Panel -->
<ColumnDefinition Width="3*" />
<!-- Details Panel -->
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="*" />
<!-- Main Content (TreeView + Details) -->
<RowDefinition Height="Auto" />
<!-- Buttons -->
<RowDefinition Height="Auto" />
<!-- Browser Import Controls -->
</Grid.RowDefinitions>
<!-- TreeView Panel -->
<Border Grid.Row="0" Grid.Column="0" BorderThickness="1" Margin="5" Style="{DynamicResource MaterialDesignToolBarMainPanelBorderStyle}">
<TreeView x:Name="BookmarksTreeView" ItemsSource="{Binding Bookmarks}"
Style="{DynamicResource MaterialDesignTreeView}"
SelectedItemChanged="BookmarksTreeView_SelectedItemChanged"
AllowDrop="True"
DragOver="BookmarksTreeView_DragOver"
Drop="BookmarksTreeView_Drop"
PreviewMouseRightButtonDown="BookmarksTreeView_PreviewMouseRightButtonDown"
PreviewMouseLeftButtonDown="BookmarksTreeView_PreviewMouseLeftButtonDown"
PreviewMouseMove="BookmarksTreeView_PreviewMouseMove"
KeyDown="TreeView_KeyDown"
>
<TreeView.ItemTemplate>
<HierarchicalDataTemplate ItemsSource="{Binding Children}">
<StackPanel Orientation="Horizontal">
<TextBlock Text="{Binding Name}" Margin="5,0,0,0"
Foreground="{DynamicResource MaterialDesign.Brush.Foreground}"
Style="{DynamicResource MaterialDesignBody1TextBlock}" />
</StackPanel>
</HierarchicalDataTemplate>
</TreeView.ItemTemplate>
<TreeView.Resources>
<ContextMenu x:Key="TreeViewContextMenu" Style="{DynamicResource MaterialDesignContextMenu}">
<MenuItem Header="Add Top-Level Folder" Click="AddTopLevelFolder_Click" />
<MenuItem Header="Add Nested Folder" Click="AddNestedFolder_Click"
CommandParameter="{Binding}" />
<MenuItem Header="Sort Alphabetically" Click="SortAlphabetically_Click" CommandParameter="{Binding}" />
<MenuItem Header="Add Nested Bookmark" Click="AddNestedBookmark_Click"
CommandParameter="{Binding}" />
<Separator />
<MenuItem Header="Delete" Click="DeleteBookmark_Click"
CommandParameter="{Binding}" />
</ContextMenu>
</TreeView.Resources>
<TreeView.ItemContainerStyle>
<Style TargetType="TreeViewItem">
<Setter Property="ContextMenu" Value="{StaticResource TreeViewContextMenu}" />
</Style>
</TreeView.ItemContainerStyle>
</TreeView>
</Border>
<!-- Details Panel -->
<StackPanel Grid.Row="0" Grid.Column="1" Margin="10">
<!-- Main Folder Name Field -->
<Grid Margin="0,5" />
<!-- Section Title -->
<Label Content="Bookmark Details" FontWeight="Bold" FontSize="16" Margin="0,20,0,10" Style="{DynamicResource MaterialDesignLabel}" />
<!-- Name Field -->
<Grid Margin="0,5">
<TextBox x:Name="bookmarkNameTextBox"
Text="{Binding SelectedBookmark.Name, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
materialDesign:HintAssist.Hint="Enter Bookmark Name"
Style="{DynamicResource MaterialDesignTextBox}"
Margin="0,5,0,5" />
</Grid>
<!-- URL Field -->
<Grid Margin="0,5">
<TextBox x:Name="bookmarkUrlTextBox"
Text="{Binding SelectedBookmark.Url, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
materialDesign:HintAssist.Hint="Enter URL"
Style="{DynamicResource MaterialDesignTextBox}"
Margin="0,5,0,5" />
</Grid>
<!-- Save and Delete Buttons -->
<StackPanel Orientation="Horizontal" HorizontalAlignment="Left" Margin="0,20,0,0">
<Button Content="Save" Click="SaveBookmark_Click" Width="100" Margin="0,0,10,0" Style="{DynamicResource MaterialDesignRaisedButton}" />
<Button Content="Delete" Click="DeleteBookmark_Click" Width="100" Style="{DynamicResource MaterialDesignRaisedButton}" />
</StackPanel>
<StackPanel Orientation="Horizontal" HorizontalAlignment="Left" Margin="0,20,0,0">
<TextBox Width="200" Margin="10" Text="{Binding SearchQuery, UpdateSourceTrigger=PropertyChanged}"
materialDesign:HintAssist.Hint="Search Bookmarks" Style="{DynamicResource MaterialDesignTextBox}" />
</StackPanel>
</StackPanel>
<!-- Action Buttons -->
<StackPanel Grid.Row="1" Grid.Column="0" Grid.ColumnSpan="2" Orientation="Horizontal" HorizontalAlignment="Center" Margin="0,10">
<Button x:Name="exportToBrowserButton" Content="Export to Browser" Click="ExportToBrowser_Click" Width="150" Margin="5" Style="{DynamicResource MaterialDesignRaisedButton}" />
<Button x:Name="importBookmarksButton" Content="Import Clipboard" Click="importBookmarksButton_Click" Width="150" Margin="5" Style="{DynamicResource MaterialDesignRaisedButton}" />
<Button x:Name="clearFormButton" Content="Clear Form" Click="clearFormButton_Click" Width="100" Margin="5" Style="{DynamicResource MaterialDesignRaisedButton}" />
<Button x:Name="exportClipboardButton" Content="Export JSON" Click="exportBookmarksButton_Click_1" Width="155" Margin="5" Style="{DynamicResource MaterialDesignRaisedButton}" />
<Button x:Name="exportXMLformatted" Content="Export Plist" Click="exportxml_Click" Width="120" Margin="5" Style="{DynamicResource MaterialDesignRaisedButton}" />
<CheckBox x:Name="darkModeCheckBox" Content="Dark Mode" Checked="CheckBox_Checked" Unchecked="CheckBox_Unchecked" Margin="5" Style="{DynamicResource MaterialDesignCheckBox}" />
</StackPanel>
<StackPanel Grid.Row="2" Grid.Column="0" Grid.ColumnSpan="2" Orientation="Horizontal" HorizontalAlignment="Center" Margin="0,10">
<ComboBox x:Name="browserSelectionComboBox" Width="200" Margin="5"
materialDesign:HintAssist.Hint="Select Browser"
Style="{DynamicResource MaterialDesignComboBox}">
<ComboBoxItem Content="Google Chrome" />
<ComboBoxItem Content="Microsoft Edge" />
</ComboBox>
<Button Content="Import from Browser" Click="ImportFromBrowser_Click" Width="200" Margin="5" Style="{DynamicResource MaterialDesignRaisedButton}" />
</StackPanel>
</Grid>
</Window>