-
Notifications
You must be signed in to change notification settings - Fork 119
/
Copy pathMainWindow.xaml
1517 lines (1500 loc) · 98.1 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
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
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<Controls:MetroWindow
x:Class="ChoEazyCopy.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:Controls="clr-namespace:MahApps.Metro.Controls;assembly=MahApps.Metro"
xmlns:Properties="clr-namespace:ChoEazyCopy.Properties"
xmlns:iconPacks="http://metro.mahapps.com/winfx/xaml/iconpacks"
xmlns:local="clr-namespace:ChoEazyCopy"
xmlns:sfw="clr-namespace:SoftFluent.Windows;assembly=SoftFluent.Windows"
xmlns:sys="clr-namespace:System;assembly=mscorlib"
xmlns:wpg="clr-namespace:System.Windows.Controls"
x:Name="ChoEazyCopyWindow"
Title="ChoEazyCopy - Cinchoo Inc."
Width="950"
Height="600"
MinWidth="500"
MinHeight="400"
AllowDrop="True"
BorderBrush="{DynamicResource AccentColorBrush}"
BorderThickness="1"
Closed="Window_Closed"
Closing="Window_Closing"
Icon="App.ico"
Loaded="Window_Loaded"
ResizeMode="CanResizeWithGrip"
TitleCaps="False">
<Controls:MetroWindow.RightWindowCommands>
<Controls:WindowCommands>
<Controls:ToggleSwitch
Margin="10,0,0,0"
FontSize="16"
Foreground="LightYellow"
IsChecked="{Binding RememberWindowSizeAndPosition}"
ToolTip="Remember windows position/size." />
</Controls:WindowCommands>
</Controls:MetroWindow.RightWindowCommands>
<Controls:MetroWindow.LeftWindowCommands>
<Controls:WindowCommands>
<Button
x:Name="btnApplicationCmds"
Click="btnApplicationCmds_Click"
ToolTip="Application Commands">
<Image Source="{iconPacks:FontAwesomeImage Kind=CogSolid}" />
<Button.ContextMenu>
<ContextMenu>
<MenuItem
x:Name="mnuLaunchNewInstance"
Click="mnuLaunchNewInstance_Click"
Header="Launch New Instance">
<MenuItem.Icon>
<Image Source="Resources/OpenNewWindow.png" />
</MenuItem.Icon>
</MenuItem>
<MenuItem
x:Name="mnuRunasAdministrator"
Click="mnuRunasAdministrator_Click"
Header="Run as Administrator">
<MenuItem.Icon>
<Image Source="Resources/Security.png" />
</MenuItem.Icon>
</MenuItem>
<MenuItem
x:Name="mnuRegisterShellExtensions"
Click="mnuRegisterShellExtensions_Click"
Header="Register Shell Extensions">
<MenuItem.Icon>
<Image Source="Resources/Registry.png" />
</MenuItem.Icon>
</MenuItem>
<MenuItem
x:Name="mnuUnregisterShellExtensions"
Click="mnuUnregisterShellExtensions_Click"
Header="Unregister Shell Extensions">
<MenuItem.Icon>
<Image Source="Resources/RemoveRegistry.png" />
</MenuItem.Icon>
</MenuItem>
<Separator />
<MenuItem
x:Name="mnuAlwaysOnTop"
Click="mnuAlwaysOnTop_Click"
Header="Always on Top"
IsCheckable="True"
IsChecked="False">
<!--<MenuItem.Icon>
<iconPacks:FontAwesome Kind="HandshakeRegular"></iconPacks:FontAwesome>
</MenuItem.Icon>-->
</MenuItem>
<MenuItem
x:Name="mnuRunatSystemsStartup"
Click="mnuRunatSystemsStartup_Click"
Header="Run at Systems Startup"
IsCheckable="True">
<!--<MenuItem.Icon>
<iconPacks:FontAwesome Kind="ShieldAltSolid"></iconPacks:FontAwesome>
</MenuItem.Icon>-->
</MenuItem>
<MenuItem
x:Name="mnuDarkTheme"
Click="mnuDarkTheme_Click"
Header="Enable Dark Theme"
IsCheckable="True"
IsChecked="False">
<!--<MenuItem.Icon>
<iconPacks:FontAwesome Kind="HandshakeRegular"></iconPacks:FontAwesome>
</MenuItem.Icon>-->
</MenuItem>
</ContextMenu>
</Button.ContextMenu>
</Button>
</Controls:WindowCommands>
</Controls:MetroWindow.LeftWindowCommands>
<Window.Resources>
<ContextMenu x:Key="expControlPanelContextMenu">
<MenuItem
x:Name="mnuResetExpander"
Click="mnuResetExpander_Click"
Header="Reset" />
</ContextMenu>
<ContextMenu x:Key="TextBoxContextMenu" Background="White">
<MenuItem Command="ApplicationCommands.Copy">
<MenuItem.Icon>
<Image Source="Resources/Copy.png" />
</MenuItem.Icon>
</MenuItem>
<MenuItem Command="ApplicationCommands.Cut">
<MenuItem.Icon>
<Image Source="Resources/Cut.png" />
</MenuItem.Icon>
</MenuItem>
<MenuItem Command="ApplicationCommands.Paste">
<MenuItem.Icon>
<Image Source="Resources/Paste.png" />
</MenuItem.Icon>
</MenuItem>
</ContextMenu>
<Style TargetType="ToolTip">
<Style.Triggers>
<Trigger Property="Content" Value="{x:Static sys:String.Empty}">
<Setter Property="Visibility" Value="Collapsed" />
</Trigger>
<Trigger Property="Content" Value="{x:Null}">
<Setter Property="Visibility" Value="Collapsed" />
</Trigger>
</Style.Triggers>
<Style.Resources>
<Style TargetType="ContentPresenter">
<Style.Resources>
<Style TargetType="TextBlock">
<Setter Property="TextWrapping" Value="Wrap" />
</Style>
</Style.Resources>
</Style>
</Style.Resources>
<Setter Property="MaxWidth" Value="500" />
</Style>
<Style TargetType="{x:Type TextBox}">
<Setter Property="ContextMenu" Value="{StaticResource TextBoxContextMenu}" />
</Style>
<Style TargetType="{x:Type Button}">
<Style.Resources>
<Style TargetType="{x:Type Image}">
<Style.Triggers>
<Trigger Property="IsEnabled" Value="False">
<Setter Property="Opacity" Value="0.5" />
</Trigger>
</Style.Triggers>
</Style>
</Style.Resources>
</Style>
<Style x:Key="GridViewColumnHeaderStyle1" TargetType="{x:Type GridViewColumnHeader}">
<Setter Property="HorizontalContentAlignment" Value="Left" />
<Setter Property="Background" Value="{Binding WindowTitleBrush}" />
<Setter Property="Foreground" Value="{Binding TitleForeground}" />
<Style.Triggers>
<Trigger Property="IsMouseOver" Value="true">
<Setter Property="Background" Value="Transparent" />
</Trigger>
</Style.Triggers>
</Style>
<Style
x:Key="WaterMarkTextBoxStyle"
BasedOn="{StaticResource {x:Type TextBox}}"
TargetType="{x:Type TextBox}">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type TextBox}">
<Grid>
<Border
x:Name="Bd"
Background="{TemplateBinding Background}"
BorderBrush="{TemplateBinding BorderBrush}"
BorderThickness="{TemplateBinding BorderThickness}"
SnapsToDevicePixels="True">
<Grid>
<ScrollViewer x:Name="PART_ContentHost" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
<TextBlock
x:Name="textBlock"
Padding="2,0,0,0"
Opacity="0.5"
Text="{TemplateBinding Tag}"
TextWrapping="Wrap"
Visibility="Hidden" />
</Grid>
</Border>
</Grid>
<ControlTemplate.Triggers>
<Trigger Property="IsMouseOver" Value="True">
<Setter Property="BorderBrush" Value="{Binding TextBoxFocusBorderBrush}" />
<Setter Property="Background" Value="Transparent" />
</Trigger>
<MultiTrigger>
<MultiTrigger.Conditions>
<Condition Property="Text" Value="" />
</MultiTrigger.Conditions>
<Setter TargetName="textBlock" Property="Visibility" Value="Visible" />
</MultiTrigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<Style x:Key="StatusBarTextBlock" TargetType="{x:Type TextBlock}">
<Setter Property="TextWrapping" Value="NoWrap" />
<Setter Property="TextTrimming" Value="CharacterEllipsis" />
<Setter Property="Padding" Value="2,0" />
</Style>
<local:BoolInverterConverter x:Key="BoolInverterConverter1" />
<local:BoolInverterConverter x:Key="BoolInverterConverter2" />
<local:BoolToBackgroundColorConverter x:Key="BoolToBackgroundColorConverter1" />
<local:BoolToForegroundColorConverter x:Key="BoolToForegroundColorConverter1" />
<local:BooleanToVisibilityConverter x:Key="BooleanToVisibilityConverter1" />
<local:BooleanToVisibilityInverterConverter x:Key="BooleanToVisibilityInverterConverter1" />
<local:BooleanToVisibilityInverterConverterEx x:Key="BooleanToVisibilityInverterConverterEx1" />
<local:MathConverter x:Key="MathConverter" />
<Style TargetType="{x:Type local:ChoMruComboBox}">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type local:ChoMruComboBox}">
<ComboBox
IsEditable="True"
IsTextSearchCaseSensitive="False"
IsTextSearchEnabled="True"
ItemsSource="{Binding MruSource, RelativeSource={RelativeSource TemplatedParent}}"
Text="{Binding Text, RelativeSource={RelativeSource TemplatedParent}, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" />
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</Window.Resources>
<DockPanel>
<StatusBar
Width="Auto"
Margin="5,0,5,5"
DockPanel.Dock="Bottom">
<StatusBarItem
Padding="0"
VerticalContentAlignment="Top"
Focusable="False">
<TextBlock x:Name="sbAppStatus" Style="{StaticResource StatusBarTextBlock}"><Run Text="{Binding AppStatusText}" /></TextBlock>
</StatusBarItem>
</StatusBar>
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*" />
<ColumnDefinition Width="5" />
<ColumnDefinition Width="{Binding ControlPanelWidth, Mode=TwoWay}">
<ColumnDefinition.Style>
<Style TargetType="{x:Type ColumnDefinition}">
<Setter Property="MinWidth" Value="350" />
<!-- Default MinHeight -->
<Style.Triggers>
<DataTrigger Binding="{Binding ElementName=expControlPanel, Path=IsExpanded}" Value="False">
<Setter Property="MinWidth" Value="24" />
<!-- MinHeight when Collapsed -->
<Setter Property="MaxWidth" Value="40" />
</DataTrigger>
<DataTrigger Binding="{Binding ElementName=expControlPanel, Path=IsExpanded}" Value="True">
<Setter Property="MaxWidth" Value="{Binding ElementName=ChoEazyCopyWindow, Path=Width, Converter={StaticResource MathConverter}, ConverterParameter=@VALUE/2}" />
</DataTrigger>
</Style.Triggers>
</Style>
</ColumnDefinition.Style>
</ColumnDefinition>
</Grid.ColumnDefinitions>
<DockPanel Grid.Column="0" LastChildFill="true">
<Ribbon
x:Name="RibbonWin"
MinWidth="500"
Margin="0,0,5,0"
Background="{Binding ThemeBackgroundBrush}"
ContextMenu="{x:Null}"
DockPanel.Dock="Top"
Foreground="Black"
Loaded="RibbonWin_Loaded"
SelectedIndex="0">
<Ribbon.ApplicationMenu>
<RibbonApplicationMenu Visibility="Collapsed" />
</Ribbon.ApplicationMenu>
<RibbonTab
ContextMenu="{x:Null}"
Header="Home"
KeyTip="H">
<RibbonGroup
x:Name="HomeGroup"
ContextMenu="{x:Null}"
Header="Action">
<RibbonButton
x:Name="btnRun"
Click="btnRun_Click"
ContextMenu="{x:Null}"
KeyTip="R"
Label="Run"
LargeImageSource="Resources\Run.png" />
<RibbonButton
x:Name="btnStop"
Click="btnStop_Click"
ContextMenu="{x:Null}"
KeyTip="T"
Label="Stop"
SmallImageSource="Resources\Stop.png" />
<RibbonButton
x:Name="btnClear"
Click="btnClear_Click"
ContextMenu="{x:Null}"
KeyTip="E"
Label="Clear Output"
SmallImageSource="Resources\Erase.png" />
<RibbonCheckBox
x:Name="btnScrollOutput"
ContextMenu="{x:Null}"
IsChecked="{Binding ScrollOutput}"
KeyTip="L"
Label="Scroll Output"
SmallImageSource="Resources\Scroll.png" />
</RibbonGroup>
<RibbonGroup
x:Name="FileGroup"
ContextMenu="{x:Null}"
Header="File">
<!--<RibbonButton x:Name="btnNewFile" LargeImageSource="Resources\NewFile.png" Label="New" KeyTip="N" Click="btnNewFile_Click" ContextMenu="{x:Null}"/>-->
<RibbonMenuButton
x:Name="btnNewFile"
KeyTip="N"
Label="New"
LargeImageSource="Resources\NewFile.png"
SmallImageSource="Resources\NewFile.png">
<RibbonMenuItem
Click="btnNewFile_Click"
ContextMenu="{x:Null}"
Header="Empty Job"
ImageSource="Resources\NewFile.png" />
<RibbonMenuItem
Click="btnNewSyncFile_Click"
ContextMenu="{x:Null}"
Header="Synchronization Job"
ImageSource="Resources\SyncJob.png"
ToolTip="With the Synchronization job all new and modified files of source folder are mirrored to destination folder. Files and folders which don't exist anymore in the source folder when the job runs will be deleted in the destination folder." />
<RibbonMenuItem
Click="btnNewCopyFile_Click"
ContextMenu="{x:Null}"
Header="Copy Job"
ImageSource="Resources\CopyJob.png"
ToolTip="With the Copy job all new and modified files of source folder are also copied to destination folder. However files and folders which previously has been copied to the destination folder but doesn't exist anymore when the job runs, will be kept in the destination folder." />
<RibbonMenuItem
Click="btnNewMoveFile_Click"
ContextMenu="{x:Null}"
Header="Move Job"
ImageSource="Resources\MoveJob.png"
ToolTip="With the Move job, move all files/folders from source location to destination location. All successfull moved files/folders are removed from the source." />
</RibbonMenuButton>
<RibbonButton
x:Name="btnOpenFile"
Click="btnOpenFile_Click"
ContextMenu="{x:Null}"
KeyTip="O"
Label="Open"
SmallImageSource="Resources\OpenFile.png" />
<RibbonButton
x:Name="btnSaveFile"
Click="btnSaveFile_Click"
ContextMenu="{x:Null}"
KeyTip="S"
Label="Save"
SmallImageSource="Resources\SaveFile.png" />
<RibbonButton
x:Name="btnSaveAsFile"
Click="btnSaveAsFile_Click"
ContextMenu="{x:Null}"
KeyTip="A"
Label="Save As"
SmallImageSource="Resources\SaveAsFile.png" />
</RibbonGroup>
<RibbonGroup x:Name="DonateGroup" ContextMenu="{x:Null}">
<RibbonButton
x:Name="btnDonate"
Click="BtnDonate_Click"
ContextMenu="{x:Null}"
KeyTip="D"
Label="Donate"
LargeImageSource="Resources\Donate.png"
ToolTip="Your support is much appreciated." />
</RibbonGroup>
<!--<RibbonGroup VerticalAlignment="Center" ContextMenu="{x:Null}">
<DockPanel LastChildFill="True">
<TextBlock DockPanel.Dock="Bottom">Settings File</TextBlock>
<TextBlock x:Name="tbSettingsName" FontSize="24" FontWeight="Bold" Foreground="DarkBlue"
Width="Auto" VerticalAlignment="Stretch" FontFamily="Verdana"
Text="{Binding SettingsFileName}" ToolTip="{Binding SettingsFilePath}"
/>
</DockPanel>
</RibbonGroup>-->
<RibbonGroup x:Name="HelpGroup" ContextMenu="{x:Null}">
<RibbonButton
x:Name="btnHelp"
Click="btnHelp_Click"
ContextMenu="{x:Null}"
KeyTip="D"
Label="Help"
LargeImageSource="Resources\Help.png"
ToolTip="RoboCopy offical help" />
</RibbonGroup>
</RibbonTab>
</Ribbon>
<DockPanel
x:Name="dockPanel1"
HorizontalAlignment="Stretch"
VerticalAlignment="Stretch"
FocusManager.FocusedElement="{Binding ElementName=txtFolder}"
LastChildFill="True">
<Grid Width="Auto" DockPanel.Dock="Top">
<Grid.RowDefinitions>
<RowDefinition />
<RowDefinition />
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition />
</Grid.ColumnDefinitions>
<Border
Grid.Row="0"
Margin="5,5,5,0"
Background="{Binding WindowTitleBrush}"
BorderBrush="{Binding WindowTitleBrush}"
BorderThickness="1">
<DockPanel LastChildFill="true">
<Label FontWeight="Bold" Foreground="{Binding TitleForeground}">TASK FILE:</Label>
<TextBlock
VerticalAlignment="Center"
Foreground="{Binding TitleForeground}"
Text="{Binding SettingsFileName}"
ToolTip="{Binding SettingsFilePath}" />
</DockPanel>
</Border>
<GroupBox
x:Name="grpFolders"
Grid.Row="1"
Grid.Column="0"
Height="Auto"
Margin="5">
<GroupBox.Header>
<DockPanel LastChildFill="True">
<Button
xmlns:Controls="clr-namespace:MahApps.Metro.Controls;assembly=MahApps.Metro"
xmlns:Converters="clr-namespace:MahApps.Metro.Converters;assembly=MahApps.Metro"
x:Name="btnSwapDir"
Click="btnSwapDir_Click"
Content="Swap Directories"
DockPanel.Dock="Right"
Style="{DynamicResource MetroButton}" />
<TextBlock
xmlns:Controls="clr-namespace:MahApps.Metro.Controls;assembly=MahApps.Metro"
xmlns:Converters="clr-namespace:MahApps.Metro.Converters;assembly=MahApps.Metro"
VerticalAlignment="Center"
Text="CHOOSE FOLDERS">
<TextBlock.Foreground>
<MultiBinding Converter="{x:Static Converters:BackgroundToForegroundConverter.Instance}">
<Binding
Mode="OneWay"
Path="Background"
RelativeSource="{RelativeSource AncestorType=GroupBox}" />
<Binding
Mode="OneWay"
Path="(Controls:GroupBoxHelper.HeaderForeground)"
RelativeSource="{RelativeSource AncestorType=GroupBox}" />
</MultiBinding>
</TextBlock.Foreground>
</TextBlock>
</DockPanel>
</GroupBox.Header>
<Grid Width="Auto" Height="Auto">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="35*" />
<ColumnDefinition Width="145*" />
<ColumnDefinition Width="368*" />
<ColumnDefinition Width="20" />
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition />
<RowDefinition />
<RowDefinition />
<RowDefinition />
</Grid.RowDefinitions>
<Label
Grid.Row="0"
Grid.ColumnSpan="2"
FontWeight="Bold">
Source Directory
</Label>
<TextBox
x:Name="txtSourceDirectory"
Grid.Row="1"
Grid.Column="0"
Grid.ColumnSpan="3"
Margin="1"
VerticalAlignment="Stretch"
BorderBrush="{Binding SourceDirStatus, Converter={local:SourceDirBorderColorConverter}}"
TabIndex="0"
Text="{Binding Path=AppSettings.SourceDirectory, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
ToolTip="{Binding Path=SourceDirTooltip}" />
<Button
x:Name="btnSourceDirBrowse"
Grid.Row="1"
Grid.Column="3"
Margin="1,0,1,2"
VerticalAlignment="Bottom"
Click="btnSourceDirBrowse_Click"
Style="{StaticResource {x:Static ToolBar.ButtonStyleKey}}"
TabIndex="1"
ToolTip="Choose source directory...">
<Image Source="Resources/OpenFolder.png">
<Image.Style>
<Style TargetType="{x:Type Image}">
<Style.Triggers>
<Trigger Property="IsEnabled" Value="False">
<Setter Property="Opacity" Value="0.5" />
</Trigger>
</Style.Triggers>
</Style>
</Image.Style>
</Image>
</Button>
<Label
Grid.Row="2"
Grid.ColumnSpan="2"
FontWeight="Bold">
Destination Directory
</Label>
<TextBox
x:Name="txtDestDirectory"
Grid.Row="3"
Grid.Column="0"
Grid.ColumnSpan="3"
Margin="1"
TabIndex="2"
Text="{Binding Path=AppSettings.DestDirectory, UpdateSourceTrigger=PropertyChanged}"
ToolTip="Destination directory." />
<Button
x:Name="btnDestDirBrowse"
Grid.Row="3"
Grid.Column="3"
Margin="1,2,1,1"
Click="btnDestDirBrowse_Click"
Style="{StaticResource {x:Static ToolBar.ButtonStyleKey}}"
TabIndex="3"
ToolTip="Choose destination directory...">
<Image Source="Resources/OpenFolder.png">
<Image.Style>
<Style TargetType="{x:Type Image}">
<Style.Triggers>
<Trigger Property="IsEnabled" Value="False">
<Setter Property="Opacity" Value="0.5" />
</Trigger>
</Style.Triggers>
</Style>
</Image.Style>
</Image>
</Button>
</Grid>
</GroupBox>
</Grid>
<GroupBox
DockPanel.Dock="Bottom"
IsEnabled="{Binding IsNotRunning}"
Visibility="{Binding Path=AppSettings.ListOnly, Converter={StaticResource BooleanToVisibilityInverterConverter1}}">
<GroupBox.Header>
<DockPanel LastChildFill="True">
<CheckBox
xmlns:Controls="clr-namespace:MahApps.Metro.Controls;assembly=MahApps.Metro"
xmlns:Converters="clr-namespace:MahApps.Metro.Converters;assembly=MahApps.Metro"
Content="SHOW PROGRESS"
DockPanel.Dock="Right"
IsChecked="{Binding Path=AppSettings.ShowRoboCopyProgress}"
Style="{DynamicResource MetroCheckBox}">
<CheckBox.Foreground>
<MultiBinding Converter="{x:Static Converters:BackgroundToForegroundConverter.Instance}">
<Binding
Mode="OneWay"
Path="Background"
RelativeSource="{RelativeSource AncestorType=GroupBox}" />
<Binding
Mode="OneWay"
Path="(Controls:GroupBoxHelper.HeaderForeground)"
RelativeSource="{RelativeSource AncestorType=GroupBox}" />
</MultiBinding>
</CheckBox.Foreground>
</CheckBox>
<TextBlock
xmlns:Controls="clr-namespace:MahApps.Metro.Controls;assembly=MahApps.Metro"
xmlns:Converters="clr-namespace:MahApps.Metro.Converters;assembly=MahApps.Metro"
VerticalAlignment="Center"
Text="ROBOCOPY PROGRESS">
<TextBlock.Foreground>
<MultiBinding Converter="{x:Static Converters:BackgroundToForegroundConverter.Instance}">
<Binding
Mode="OneWay"
Path="Background"
RelativeSource="{RelativeSource AncestorType=GroupBox}" />
<Binding
Mode="OneWay"
Path="(Controls:GroupBoxHelper.HeaderForeground)"
RelativeSource="{RelativeSource AncestorType=GroupBox}" />
</MultiBinding>
</TextBlock.Foreground>
</TextBlock>
</DockPanel>
</GroupBox.Header>
<DockPanel x:Name="dpRoboCopyProgress" LastChildFill="true">
<TextBlock
DockPanel.Dock="Top"
Text="Robocopy progress disabled."
Visibility="{Binding Path=AppSettings.ShowRoboCopyProgress, Converter={StaticResource BooleanToVisibilityInverterConverter1}}" />
<TextBlock
DockPanel.Dock="Top"
Text="{Binding RobocopyProgresssText}"
Visibility="{Binding Path=AppSettings.ShowRoboCopyProgress, Converter={StaticResource BooleanToVisibilityConverter1}}" />
<Grid Visibility="{Binding Path=AppSettings.ShowRoboCopyProgress, Converter={StaticResource BooleanToVisibilityConverter1}}">
<ProgressBar
x:Name="pbar"
Height="15"
Margin="0,5,0,5"
HorizontalAlignment="Stretch"
Maximum="100"
Minimum="0"
Value="{Binding RobocopyProgresssBarValue}" />
<TextBlock
HorizontalAlignment="Center"
VerticalAlignment="Center"
Foreground="White"
Text="{Binding ElementName=pbar, Path=Value, StringFormat={}{0:0}%}" />
</Grid>
</DockPanel>
</GroupBox>
<Grid Width="Auto">
<Grid.ColumnDefinitions>
<ColumnDefinition />
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="100" MinHeight="100" />
<RowDefinition Height="Auto" />
<RowDefinition Height="*" />
</Grid.RowDefinitions>
<GroupBox
Grid.Row="0"
Margin="5,0,5,0"
HorizontalAlignment="Stretch"
VerticalAlignment="Stretch">
<GroupBox.Header>
<DockPanel LastChildFill="True">
<CheckBox
xmlns:Controls="clr-namespace:MahApps.Metro.Controls;assembly=MahApps.Metro"
xmlns:Converters="clr-namespace:MahApps.Metro.Converters;assembly=MahApps.Metro"
Content="TEST RUN"
DockPanel.Dock="Right"
IsChecked="{Binding Path=AppSettings.ListOnly}"
Style="{DynamicResource MetroCheckBox}">
<CheckBox.Foreground>
<MultiBinding Converter="{x:Static Converters:BackgroundToForegroundConverter.Instance}">
<Binding
Mode="OneWay"
Path="Background"
RelativeSource="{RelativeSource AncestorType=GroupBox}" />
<Binding
Mode="OneWay"
Path="(Controls:GroupBoxHelper.HeaderForeground)"
RelativeSource="{RelativeSource AncestorType=GroupBox}" />
</MultiBinding>
</CheckBox.Foreground>
</CheckBox>
<TextBlock
xmlns:Controls="clr-namespace:MahApps.Metro.Controls;assembly=MahApps.Metro"
xmlns:Converters="clr-namespace:MahApps.Metro.Converters;assembly=MahApps.Metro"
VerticalAlignment="Center"
Text="ROBOCOPY COMMAND">
<TextBlock.Foreground>
<MultiBinding Converter="{x:Static Converters:BackgroundToForegroundConverter.Instance}">
<Binding
Mode="OneWay"
Path="Background"
RelativeSource="{RelativeSource AncestorType=GroupBox}" />
<Binding
Mode="OneWay"
Path="(Controls:GroupBoxHelper.HeaderForeground)"
RelativeSource="{RelativeSource AncestorType=GroupBox}" />
</MultiBinding>
</TextBlock.Foreground>
</TextBlock>
</DockPanel>
</GroupBox.Header>
<DockPanel LastChildFill="True">
<TextBox
Name="txtRoboCopyCmdEx"
Margin="0,3,0,2"
HorizontalAlignment="Stretch"
VerticalAlignment="Stretch"
IsReadOnly="True"
TabIndex="24"
TextWrapping="Wrap"
VerticalScrollBarVisibility="Auto"
Visibility="Collapsed" />
<TextBox
Name="txtRoboCopyCmd"
Margin="0,3,0,2"
HorizontalAlignment="Stretch"
VerticalAlignment="Stretch"
IsReadOnly="True"
TabIndex="24"
TextWrapping="Wrap"
VerticalScrollBarVisibility="Auto" />
</DockPanel>
</GroupBox>
<GridSplitter
Grid.Row="1"
Height="1"
Margin="5,5,5,0"
HorizontalAlignment="Stretch"
IsTabStop="False"
ResizeDirection="Rows" />
<GroupBox
Grid.Row="2"
Margin="5,0,5,5"
VerticalAlignment="Stretch">
<GroupBox.Header>
<DockPanel LastChildFill="True">
<CheckBox
xmlns:Controls="clr-namespace:MahApps.Metro.Controls;assembly=MahApps.Metro"
xmlns:Converters="clr-namespace:MahApps.Metro.Converters;assembly=MahApps.Metro"
Content="SHOW LINE NUMBERS"
DockPanel.Dock="Right"
IsChecked="{Binding Path=AppSettings.ShowOutputLineNumbers}"
Style="{DynamicResource MetroCheckBox}">
<CheckBox.Foreground>
<MultiBinding Converter="{x:Static Converters:BackgroundToForegroundConverter.Instance}">
<Binding
Mode="OneWay"
Path="Background"
RelativeSource="{RelativeSource AncestorType=GroupBox}" />
<Binding
Mode="OneWay"
Path="(Controls:GroupBoxHelper.HeaderForeground)"
RelativeSource="{RelativeSource AncestorType=GroupBox}" />
</MultiBinding>
</CheckBox.Foreground>
</CheckBox>
<TextBlock
xmlns:Controls="clr-namespace:MahApps.Metro.Controls;assembly=MahApps.Metro"
xmlns:Converters="clr-namespace:MahApps.Metro.Converters;assembly=MahApps.Metro"
VerticalAlignment="Center"
Text="OUTPUT">
<TextBlock.Foreground>
<MultiBinding Converter="{x:Static Converters:BackgroundToForegroundConverter.Instance}">
<Binding
Mode="OneWay"
Path="Background"
RelativeSource="{RelativeSource AncestorType=GroupBox}" />
<Binding
Mode="OneWay"
Path="(Controls:GroupBoxHelper.HeaderForeground)"
RelativeSource="{RelativeSource AncestorType=GroupBox}" />
</MultiBinding>
</TextBlock.Foreground>
</TextBlock>
</DockPanel>
</GroupBox.Header>
<avalonEdit:TextEditor
xmlns:avalonEdit="http://icsharpcode.net/sharpdevelop/avalonedit"
Name="txtStatus"
FontFamily="Courier New"
FontSize="10pt"
Foreground="{Binding ControlForegroundBrush}"
HorizontalScrollBarVisibility="Auto"
KeyDown="txtStatus_KeyDown"
ShowLineNumbers="{Binding Path=AppSettings.ShowOutputLineNumbers}"
SyntaxHighlighting="DOS"
TabIndex="25"
VerticalScrollBarVisibility="Auto" />
<!--
TextBox
Margin="0,3,0,2"
VerticalAlignment="Stretch"
x:Name="txtStatus"
IsReadOnly="True"
TabIndex="25" FontFamily="Courier New" VerticalScrollBarVisibility="Auto" HorizontalScrollBarVisibility="Auto" /
-->
</GroupBox>
</Grid>
</DockPanel>
</DockPanel>
<Expander
x:Name="expControlPanel"
Grid.Column="2"
ContextMenu="{StaticResource expControlPanelContextMenu}"
ExpandDirection="Left"
IsExpanded="True">
<Expander.Header>
<TextBlock
FontWeight="Bold"
Foreground="White"
Text="Control Panel">
<TextBlock.LayoutTransform>
<RotateTransform Angle="90" />
</TextBlock.LayoutTransform>
</TextBlock>
</Expander.Header>
<TabControl
x:Name="tabControlPanel"
Grid.Column="2"
TabStripPlacement="Bottom">
<TabControl.Resources>
<SolidColorBrush x:Key="RedBrush" Color="Red" />
<SolidColorBrush x:Key="GreenBrush" Color="Green" />
<SolidColorBrush x:Key="SolidBorderBrush" Color="#888" />
<SolidColorBrush x:Key="DisabledBackgroundBrush" Color="#EEE" />
<SolidColorBrush x:Key="DisabledBorderBrush" Color="#AAA" />
<SolidColorBrush x:Key="DisabledForegroundBrush" Color="#888" />
<Style TargetType="{x:Type TabItem}">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type TabItem}">
<Grid>
<Border
Name="Border"
Margin="0,0,-4,0"
Background="{Binding TabControlBackgroundBrush}"
BorderBrush="{StaticResource SolidBorderBrush}"
BorderThickness="1,1,1,1"
CornerRadius="0,0,2,12">
<ContentPresenter
x:Name="ContentSite"
Margin="12,2,12,2"
HorizontalAlignment="Center"
VerticalAlignment="Center"
ContentSource="Header"
RecognizesAccessKey="True" />
</Border>
</Grid>
<ControlTemplate.Triggers>
<Trigger Property="IsSelected" Value="True">
<Setter Property="Panel.ZIndex" Value="100" />
<Setter TargetName="Border" Property="Background" Value="{Binding TabControlForegroundBrush}" />
<Setter TargetName="Border" Property="BorderThickness" Value="1,1,1,0" />
<Setter Property="Foreground" Value="{Binding TabControlBackgroundBrush}" />
</Trigger>
<Trigger Property="IsSelected" Value="False">
<Setter TargetName="Border" Property="Background" Value="{Binding TabControlBackgroundBrush}" />
<Setter Property="Foreground" Value="{Binding TabControlForegroundBrush}" />
</Trigger>
<Trigger Property="IsEnabled" Value="False">
<Setter TargetName="Border" Property="Background" Value="{StaticResource DisabledBackgroundBrush}" />
<Setter TargetName="Border" Property="BorderBrush" Value="{StaticResource DisabledBorderBrush}" />
<Setter Property="Foreground" Value="{StaticResource DisabledForegroundBrush}" />
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
<Setter Property="HeaderTemplate">
<Setter.Value>
<DataTemplate>
<ContentPresenter Content="{TemplateBinding Content}" TextBlock.FontWeight="Bold">
<ContentPresenter.LayoutTransform>
<RotateTransform Angle="0" />
</ContentPresenter.LayoutTransform>
</ContentPresenter>
</DataTemplate>
</Setter.Value>
</Setter>
</Style>
</TabControl.Resources>
<TabItem
x:Name="tabRoboCopyOptionsItem"
Header="RoboCopy Options"
ToolTip="">
<DockPanel LastChildFill="True">
<TextBlock
x:Name="txtPropertyGridWaterMark"
DockPanel.Dock="Top"
FontSize="20"
FontWeight="Bold"
Foreground="Red"
Text="{Binding PropertyGridTooltip}"
TextWrapping="WrapWithOverflow"
ToolTip="{Binding PropertyGridTooltip}"
Visibility="Collapsed" />
<sfw:PropertyGrid
xmlns:sfw="clr-namespace:SoftFluent.Windows;assembly=SoftFluent.Windows"
Name="pgAppSettings"
Margin="-3"
Background="{Binding PGControlBackgroundBrush}"
BorderBrush="{Binding PGControlBorderBrush}"
DecamelizePropertiesDisplayNames="false"
Foreground="{Binding PGControlForegroundBrush}"
GroupByCategory="True"
HelpVisible="True"
SelectedObject="{Binding AppSettings}" />
<!--<local:ChoPropertyGrid Margin="-3" VerticalAlignment="Stretch" x:Name="pgAppSettings"
SelectedObject="{Binding AppSettings}"
ToolTip="{Binding PropertyGridTooltip}" Style="{x:Null}"/>-->
<!--<local:ExtendedPropertyGrid Margin="-3" VerticalAlignment="Stretch" x:Name="pgAppSettings"
SelectedObject="{Binding AppSettings}" SelectedObjectName="" ShowTitle="False"
ShowDescriptionByTooltip="True" FilterWatermark="{Binding PropertyGridTooltip}"
ToolTip="{Binding PropertyGridTooltip}" Style="{x:Null}"/>-->
</DockPanel>
</TabItem>
<TabItem
x:Name="tabBackupTasks"
Header="Backup Tasks"
ToolTip="">
<GroupBox
x:Name="grpBackupTasks"
Margin="-3"
Header="Backup Tasks">
<DockPanel LastChildFill="True">
<DockPanel HorizontalAlignment="Stretch" DockPanel.Dock="Top">
<TextBlock DockPanel.Dock="Top" FontWeight="Bold">Directory</TextBlock>
<DockPanel
HorizontalAlignment="Stretch"
DockPanel.Dock="Bottom"
LastChildFill="True">
<Button
x:Name="btnFindBackupTaskDirectoryInFileExplorer"
Width="20"
Height="20"
VerticalAlignment="Center"
Click="btnFindBackupTaskDirectoryInFileExplorer_Click"
DockPanel.Dock="Right"
IsEnabled="{Binding BackupTaskDirStatus}"
Style="{StaticResource {x:Static ToolBar.ButtonStyleKey}}"
ToolTip="Find backup task directory in file explorer">
<Border>
<Image Source="Resources/Search.png">
<Image.Style>
<Style TargetType="{x:Type Image}">
<Style.Triggers>
<Trigger Property="IsEnabled" Value="False">
<Setter Property="Opacity" Value="0.5" />
</Trigger>
</Style.Triggers>
</Style>
</Image.Style>
</Image>
</Border>
</Button>
<Button
x:Name="btnRefreshBackupTasks"
Width="20"
Margin="1,0,1,2"
VerticalAlignment="Bottom"
Click="btnRefreshBackupTasks_Click"
DockPanel.Dock="Right"
IsEnabled="{Binding BackupTaskDirStatus}"
Style="{StaticResource {x:Static ToolBar.ButtonStyleKey}}"
ToolTip="Reload backup tasks...">
<Image Source="Resources/Refresh.png">
<Image.Style>
<Style TargetType="{x:Type Image}">
<Style.Triggers>
<Trigger Property="IsEnabled" Value="False">
<Setter Property="Opacity" Value="0.5" />
</Trigger>
</Style.Triggers>
</Style>
</Image.Style>
</Image>
</Button>
<Button
x:Name="btnBackupTaskDirectory"
Width="20"
Margin="1,0,1,2"