-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMainWindow.xaml
More file actions
1592 lines (1459 loc) · 151 KB
/
Copy pathMainWindow.xaml
File metadata and controls
1592 lines (1459 loc) · 151 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
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
<Window x:Class="Passpix.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"
mc:Ignorable="d"
Title="Simple Editor" Height="820" Width="1240"
WindowStartupLocation="CenterScreen"
Background="{DynamicResource WindowBgBrush}"
Icon="assets/logo.ico"
FontFamily="{DynamicResource PrimaryFont}"
FontSize="{DynamicResource BodyFontSize}">
<Window.Resources>
<!-- Modern Underline TabItem Style -->
<Style x:Key="UnderlineTabItem" TargetType="TabItem">
<Setter Property="Foreground" Value="{DynamicResource MutedTextBrush}" />
<Setter Property="FontWeight" Value="SemiBold" />
<Setter Property="FontSize" Value="14" />
<Setter Property="Padding" Value="15,10" />
<Setter Property="Cursor" Value="Hand" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="TabItem">
<Border x:Name="Border" BorderThickness="0,0,0,3" BorderBrush="Transparent" Padding="{TemplateBinding Padding}" Background="Transparent">
<ContentPresenter ContentSource="Header" HorizontalAlignment="Center" VerticalAlignment="Center"/>
</Border>
<ControlTemplate.Triggers>
<Trigger Property="IsSelected" Value="True">
<Setter Property="Foreground" Value="{DynamicResource TextBrush}" />
<Setter TargetName="Border" Property="BorderBrush" Value="{DynamicResource AccentBrush}" />
</Trigger>
<Trigger Property="IsMouseOver" Value="True">
<Setter Property="Foreground" Value="{DynamicResource TextBrush}" />
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<Style x:Key="ModernTabControl" TargetType="TabControl">
<Setter Property="BorderThickness" Value="0"/>
<Setter Property="Background" Value="Transparent"/>
<Setter Property="HorizontalContentAlignment" Value="Stretch"/>
<Setter Property="VerticalContentAlignment" Value="Stretch"/>
</Style>
<!-- Vertical Left TabItem Style for PDF suite -->
<Style x:Key="LeftTabItem" TargetType="TabItem">
<Setter Property="Foreground" Value="{DynamicResource MutedTextBrush}" />
<Setter Property="FontWeight" Value="SemiBold" />
<Setter Property="FontSize" Value="13" />
<Setter Property="Padding" Value="12,12" />
<Setter Property="Cursor" Value="Hand" />
<Setter Property="HorizontalContentAlignment" Value="Stretch"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="TabItem">
<Border x:Name="Border" BorderThickness="3,0,0,0" BorderBrush="Transparent" Padding="{TemplateBinding Padding}" Background="Transparent">
<ContentPresenter ContentSource="Header" VerticalAlignment="Center"/>
</Border>
<ControlTemplate.Triggers>
<Trigger Property="IsSelected" Value="True">
<Setter Property="Foreground" Value="{DynamicResource TextBrush}" />
<Setter TargetName="Border" Property="BorderBrush" Value="{DynamicResource AccentBrush}" />
<Setter TargetName="Border" Property="Background" Value="{DynamicResource HoverBrush}" />
</Trigger>
<Trigger Property="IsMouseOver" Value="True">
<Setter Property="Foreground" Value="{DynamicResource TextBrush}" />
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</Window.Resources>
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="*" />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<Grid Grid.Row="0">
<!-- Main Content Host (Sidebar completely removed, spans full width) -->
<Grid Margin="25">
<!-- 1. Home Dashboard Panel (Hides Sidebar) -->
<Grid x:Name="PanelHome" Visibility="Visible">
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="*" />
</Grid.RowDefinitions>
<Grid Grid.Row="0" Margin="0,10,0,20">
<StackPanel VerticalAlignment="Center">
<TextBlock Text="Welcome back" Foreground="{DynamicResource MutedTextBrush}" FontSize="14" FontWeight="SemiBold"/>
<TextBlock Text="Dashboard" Foreground="{DynamicResource TextBrush}" FontSize="32" FontWeight="Bold" Margin="0,5,0,0"/>
</StackPanel>
<!-- Top-Right Settings Gear Icon wheel (Home Page Only) -->
<Button x:Name="BtnHomeSettings" HorizontalAlignment="Right" VerticalAlignment="Top" Style="{StaticResource ModernButton}" Width="44" Height="44" Padding="0" Click="BtnNavSettings_Click" ToolTip="Settings">
<Path Data="M19.43 12.98c.04-.32.07-.64.07-.98s-.03-.66-.07-.98l2.11-1.65c.19-.15.24-.42.12-.64l-2-3.46c-.12-.22-.39-.3-.61-.22l-2.49 1c-.52-.4-1.08-.73-1.69-.98l-.38-2.65C14.46.2 14.25 0 14 0h-4c-.25 0-.46.2-.49.45L9.13 3.1c-.61.25-1.17.59-1.69.98l-2.49-1c-.23-.09-.49 0-.61.22l-2 3.46c-.13.22-.07.49.12.64l2.11 1.65c-.04.32-.07.65-.07.98s.03.66.07.98l-2.11 1.65c-.19.15-.24.42-.12.64l2 3.46c.12.22.39.3.61.22l2.49-1c.52.4 1.08.73 1.69.98l.38 2.65c.03.25.24.45.49.45h4c.25 0 .46-.2.49-.45l.38-2.65c.61-.25 1.17-.59 1.69-.98l2.49 1c.23.09.49 0 .61-.22l2-3.46c.12-.22.07-.49-.12-.64l-2.11-1.65zM12 15.5c-1.93 0-3.5-1.57-3.5-3.5s1.57-3.5 3.5-3.5 3.5 1.57 3.5 3.5-1.57 3.5-3.5 3.5z"
Fill="{DynamicResource TextBrush}" Stretch="Uniform" Margin="10"/>
</Button>
</Grid>
<TextBlock Grid.Row="1" Text="Quick Access Tools" Foreground="{DynamicResource TextBrush}" FontSize="{DynamicResource LargeHeadingFontSize}" FontWeight="SemiBold" Margin="0,15,0,10"/>
<ScrollViewer Grid.Row="2" VerticalScrollBarVisibility="Auto" HorizontalScrollBarVisibility="Disabled">
<StackPanel Orientation="Vertical">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*" />
<ColumnDefinition Width="20" />
<ColumnDefinition Width="*" />
<ColumnDefinition Width="20" />
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<!-- Card 1: Passpix -->
<Border Grid.Column="0" Background="{DynamicResource CardBgBrush}" BorderThickness="1" BorderBrush="{DynamicResource BorderBrush}" CornerRadius="12" Padding="{DynamicResource CardPadding}">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="*"/>
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<Image Grid.Row="0" Source="assets/passpix_icon.png" Width="48" Height="48" HorizontalAlignment="Left" Margin="0,0,0,15"/>
<TextBlock Grid.Row="1" Text="Passport Photo (Passpix)" Foreground="{DynamicResource TextBrush}" FontSize="{DynamicResource LargeHeadingFontSize}" FontWeight="Bold" Margin="0,0,0,8"/>
<TextBlock Grid.Row="2" Text="Crop portraits visually with mouse zoom & handles, remove background offline using local AI, and layout precise grid print sheets." Foreground="{DynamicResource MutedTextBrush}" FontSize="{DynamicResource BodyFontSize}" TextWrapping="Wrap" LineHeight="18" Margin="0,0,0,20"/>
<Button Grid.Row="3" Content="Launch Passpix" Click="BtnNavPasspix_Click" Style="{StaticResource AccentButton}" HorizontalAlignment="Stretch"/>
</Grid>
</Border>
<!-- Card 2: PDF Utility -->
<Border Grid.Column="2" Background="{DynamicResource CardBgBrush}" BorderThickness="1" BorderBrush="{DynamicResource BorderBrush}" CornerRadius="12" Padding="{DynamicResource CardPadding}">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="*"/>
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<Image Grid.Row="0" Source="assets/pdf_icon.png" Width="48" Height="48" HorizontalAlignment="Left" Margin="0,0,0,15"/>
<TextBlock Grid.Row="1" Text="PDF Utility Suite" Foreground="{DynamicResource TextBrush}" FontSize="{DynamicResource LargeHeadingFontSize}" FontWeight="Bold" Margin="0,0,0,8"/>
<TextBlock Grid.Row="2" Text="Access all 12 tools including conversions, splits, merges, page reorders, rotations, password protections, and numbering with live thumbnails." Foreground="{DynamicResource MutedTextBrush}" FontSize="{DynamicResource BodyFontSize}" TextWrapping="Wrap" LineHeight="18" Margin="0,0,0,20"/>
<Button Grid.Row="3" Content="Open PDF Suite" Click="BtnNavPdf_Click" Style="{StaticResource AccentButton}" HorizontalAlignment="Stretch"/>
</Grid>
</Border>
<!-- Card 3: Compressor -->
<Border Grid.Column="4" Background="{DynamicResource CardBgBrush}" BorderThickness="1" BorderBrush="{DynamicResource BorderBrush}" CornerRadius="12" Padding="{DynamicResource CardPadding}">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="*"/>
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<Image Grid.Row="0" Source="assets/compress_icon.png" Width="48" Height="48" HorizontalAlignment="Left" Margin="0,0,0,15"/>
<TextBlock Grid.Row="1" Text="Image & PDF Compressor" Foreground="{DynamicResource TextBrush}" FontSize="{DynamicResource LargeHeadingFontSize}" FontWeight="Bold" Margin="0,0,0,8"/>
<TextBlock Grid.Row="2" Text="Compress JPEGs, PNGs, and PDF files. Set target sizes in KB. The optimizer guarantees outputs stay strictly under the limit." Foreground="{DynamicResource MutedTextBrush}" FontSize="{DynamicResource BodyFontSize}" TextWrapping="Wrap" LineHeight="18" Margin="0,0,0,20"/>
<Button Grid.Row="3" Content="Launch Compressor" Click="BtnNavCompress_Click" Style="{StaticResource AccentButton}" HorizontalAlignment="Stretch"/>
</Grid>
</Border>
</Grid>
<!-- Recent Files Section -->
<Border Margin="0,20,0,10" Background="{DynamicResource CardBgBrush}" BorderThickness="1" BorderBrush="{DynamicResource BorderBrush}" CornerRadius="12" Padding="{DynamicResource CardPadding}">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="10"/>
<RowDefinition Height="*"/>
</Grid.RowDefinitions>
<TextBlock Grid.Row="0" Text="Recent Files" Foreground="{DynamicResource TextBrush}" FontSize="{DynamicResource LargeHeadingFontSize}" FontWeight="Bold"/>
<Grid Grid.Row="2">
<StackPanel x:Name="PnlRecentFilesList" Orientation="Vertical"/>
<TextBlock x:Name="TxtNoRecentFiles" Text="No recent files. Saved images or PDFs will appear here." Foreground="{DynamicResource MutedTextBrush}" FontSize="{DynamicResource BodyFontSize}" HorizontalAlignment="Center" Margin="0,10,0,10"/>
</Grid>
</Grid>
</Border>
</StackPanel>
</ScrollViewer>
</Grid>
<!-- 2. Passpix Panel -->
<Grid x:Name="PanelPasspix" Visibility="Collapsed">
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="*" />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<StackPanel Grid.Row="0" Margin="0,0,0,15">
<TextBlock Text="Passport Photo Toolkit" Foreground="{DynamicResource MutedTextBrush}" FontSize="13" FontWeight="SemiBold"/>
<TextBlock Text="Passpix Creator" Foreground="{DynamicResource TextBrush}" FontSize="24" FontWeight="Bold"/>
</StackPanel>
<!-- Passpix Body Grid -->
<Grid Grid.Row="1" Margin="0,5,0,15">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="320" />
<ColumnDefinition Width="20" />
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<!-- Left Column Controls -->
<Border Grid.Column="0" Background="{DynamicResource CardBgBrush}" BorderThickness="1" BorderBrush="{DynamicResource BorderBrush}" CornerRadius="8" Padding="15">
<ScrollViewer VerticalScrollBarVisibility="Auto" HorizontalScrollBarVisibility="Disabled">
<StackPanel>
<!-- Step 1: Select Image -->
<StackPanel>
<TextBlock Text="Step 1: Select Portrait" Foreground="{DynamicResource TextBrush}" FontSize="13" FontWeight="Bold" Margin="0,0,0,5"/>
<Button x:Name="BtnPasspixSelect" Content="Select Image" Click="BtnPasspixSelect_Click" Style="{StaticResource AccentButton}" HorizontalAlignment="Stretch"/>
<TextBlock x:Name="LblPasspixFileName" Text="No file selected" Foreground="{DynamicResource MutedTextBrush}" FontSize="11" Margin="0,4,0,0" TextTrimming="CharacterEllipsis"/>
</StackPanel>
<Separator Background="{DynamicResource BorderBrush}" Height="1" Margin="0,12"/>
<!-- Step 2: Crop Inputs -->
<StackPanel>
<TextBlock Text="Step 2: Crop Specifications" Foreground="{DynamicResource TextBrush}" FontSize="13" FontWeight="Bold" Margin="0,0,0,8"/>
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*" />
<ColumnDefinition Width="10" />
<ColumnDefinition Width="*" />
<ColumnDefinition Width="10" />
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<StackPanel Grid.Column="0">
<TextBlock Text="Width (in)" Foreground="{DynamicResource MutedTextBrush}" FontSize="11" Margin="0,0,0,3"/>
<TextBox x:Name="TxtCropWidth" Text="1.19" TextChanged="TxtCropDimensions_TextChanged" Style="{StaticResource ModernTextBox}" HorizontalContentAlignment="Center"/>
</StackPanel>
<StackPanel Grid.Column="2">
<TextBlock Text="Height (in)" Foreground="{DynamicResource MutedTextBrush}" FontSize="11" Margin="0,0,0,3"/>
<TextBox x:Name="TxtCropHeight" Text="1.53" TextChanged="TxtCropDimensions_TextChanged" Style="{StaticResource ModernTextBox}" HorizontalContentAlignment="Center"/>
</StackPanel>
<StackPanel Grid.Column="4">
<TextBlock Text="DPI" Foreground="{DynamicResource MutedTextBrush}" FontSize="11" Margin="0,0,0,3"/>
<TextBox x:Name="TxtCropDpi" Text="300" TextChanged="TxtCropDimensions_TextChanged" Style="{StaticResource ModernTextBox}" HorizontalContentAlignment="Center" IsReadOnly="True"/>
</StackPanel>
</Grid>
</StackPanel>
<Separator Background="{DynamicResource BorderBrush}" Height="1" Margin="0,12"/>
<!-- Step 3: Background Removal -->
<StackPanel>
<TextBlock Text="Step 3: Background Settings" Foreground="{DynamicResource TextBrush}" FontSize="13" FontWeight="Bold" Margin="0,0,0,8"/>
<CheckBox x:Name="ChkRemoveBg" Content="Remove BG (Offline AI)" Checked="ChkRemoveBg_Checked" Unchecked="ChkRemoveBg_Unchecked" Foreground="{DynamicResource TextBrush}" FontWeight="SemiBold" Margin="0,0,0,10"/>
<TextBlock Text="Solid Background Fill" Foreground="{DynamicResource MutedTextBrush}" FontSize="11" Margin="0,0,0,3"/>
<ComboBox x:Name="CmbSolidFill" SelectionChanged="CmbSolidFill_SelectionChanged" Style="{StaticResource ModernComboBox}" HorizontalAlignment="Stretch">
<ComboBoxItem Content="white" IsSelected="True" />
<ComboBoxItem Content="transparent" />
<ComboBoxItem Content="blue" />
<ComboBoxItem Content="red" />
<ComboBoxItem Content="light blue" />
<ComboBoxItem x:Name="CmbCustomColor" Content="Custom Color..." PreviewMouseLeftButtonDown="CmbCustomColor_PreviewMouseLeftButtonDown" />
</ComboBox>
</StackPanel>
<Separator Background="{DynamicResource BorderBrush}" Height="1" Margin="0,12"/>
<!-- Step 4: Grid Sheet Layout -->
<StackPanel>
<TextBlock Text="Step 4: Grid Sheet Settings" Foreground="{DynamicResource TextBrush}" FontSize="13" FontWeight="Bold" Margin="0,0,0,8"/>
<TextBlock Text="Page Size" Foreground="{DynamicResource MutedTextBrush}" FontSize="11" Margin="0,0,0,3"/>
<ComboBox x:Name="CmbPageSize" SelectionChanged="CmbPageSize_SelectionChanged" Style="{StaticResource ModernComboBox}" HorizontalAlignment="Stretch" Margin="0,0,0,10">
<ComboBoxItem Content="4x6" IsSelected="True"/>
<ComboBoxItem Content="5x7" />
<ComboBoxItem Content="A4" />
</ComboBox>
<TextBlock Text="Copies" Foreground="{DynamicResource MutedTextBrush}" FontSize="11" Margin="0,0,0,3"/>
<TextBox x:Name="TxtCopies" Text="9" TextChanged="TxtCopies_TextChanged" Style="{StaticResource ModernTextBox}" Margin="0,0,0,5"/>
</StackPanel>
</StackPanel>
</ScrollViewer>
</Border>
<!-- Right Column Preview Area -->
<Border Grid.Column="2" Background="{DynamicResource CardBgBrush}" BorderThickness="1" BorderBrush="{DynamicResource BorderBrush}" CornerRadius="8" Padding="15">
<TabControl x:Name="TcPasspix" Style="{StaticResource ModernTabControl}" SelectionChanged="PasspixTabControl_SelectionChanged">
<!-- Tab 1: Portrait & Cropper -->
<TabItem Header="Passport Photo Cropper" Style="{StaticResource UnderlineTabItem}">
<Grid Margin="0,15,0,0">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*" />
<ColumnDefinition Width="15" />
<ColumnDefinition Width="280" />
</Grid.ColumnDefinitions>
<!-- Left side: Interactive Cropper Container with MouseWheel & Drag Zoom/Pan -->
<Border Grid.Column="0" Background="#0A000000" BorderThickness="1" BorderBrush="{DynamicResource BorderBrush}" CornerRadius="4" ClipToBounds="True">
<Grid x:Name="GridCropperContainer" Background="#0F172A"
MouseWheel="GridCropperContainer_MouseWheel"
MouseDown="GridCropperContainer_MouseDown"
MouseMove="GridCropperContainer_MouseMove"
MouseUp="GridCropperContainer_MouseUp"
Cursor="Hand">
<!-- The full uploaded portrait with RenderTransform group -->
<Image x:Name="ImgOriginal" HorizontalAlignment="Center" VerticalAlignment="Center" SizeChanged="ImgOriginal_SizeChanged" Stretch="Uniform" StretchDirection="Both">
<Image.RenderTransform>
<TransformGroup>
<ScaleTransform x:Name="ImgScale" ScaleX="1" ScaleY="1" />
<TranslateTransform x:Name="ImgTranslate" X="0" Y="0" />
</TransformGroup>
</Image.RenderTransform>
</Image>
<!-- Draggable/Resizable Canvas Overlay (Remains static while image pans/zooms) -->
<Canvas x:Name="CanvasCropOverlay" Background="Transparent" HorizontalAlignment="Stretch" VerticalAlignment="Stretch">
<!-- Draggable / Resizable selector panel with 4 corner resize handles -->
<Grid x:Name="RectCropSelector" Width="100" Height="130" Background="#256366F1" Cursor="SizeAll"
MouseLeftButtonDown="RectCropSelector_MouseDown"
MouseMove="RectCropSelector_MouseMove"
MouseLeftButtonUp="RectCropSelector_MouseUp">
<Border BorderBrush="#6366F1" BorderThickness="2" IsHitTestVisible="False"/>
<!-- Corner handles -->
<!-- Top Left -->
<Border Width="10" Height="10" Background="White" BorderBrush="#6366F1" BorderThickness="1.5" CornerRadius="5"
HorizontalAlignment="Left" VerticalAlignment="Top" Margin="-5,-5,0,0" Cursor="SizeNWSE"
MouseLeftButtonDown="Handle_MouseDown" MouseMove="Handle_MouseMove" MouseLeftButtonUp="Handle_MouseUp" Tag="TL"/>
<!-- Top Right -->
<Border Width="10" Height="10" Background="White" BorderBrush="#6366F1" BorderThickness="1.5" CornerRadius="5"
HorizontalAlignment="Right" VerticalAlignment="Top" Margin="0,-5,-5,0" Cursor="SizeNESW"
MouseLeftButtonDown="Handle_MouseDown" MouseMove="Handle_MouseMove" MouseLeftButtonUp="Handle_MouseUp" Tag="TR"/>
<!-- Bottom Left -->
<Border Width="10" Height="10" Background="White" BorderBrush="#6366F1" BorderThickness="1.5" CornerRadius="5"
HorizontalAlignment="Left" VerticalAlignment="Bottom" Margin="-5,0,0,-5" Cursor="SizeNESW"
MouseLeftButtonDown="Handle_MouseDown" MouseMove="Handle_MouseMove" MouseLeftButtonUp="Handle_MouseUp" Tag="BL"/>
<!-- Bottom Right -->
<Border Width="10" Height="10" Background="White" BorderBrush="#6366F1" BorderThickness="1.5" CornerRadius="5"
HorizontalAlignment="Right" VerticalAlignment="Bottom" Margin="0,0,-5,-5" Cursor="SizeNWSE"
MouseLeftButtonDown="Handle_MouseDown" MouseMove="Handle_MouseMove" MouseLeftButtonUp="Handle_MouseUp" Tag="BR"/>
</Grid>
</Canvas>
<TextBlock x:Name="TxtCropperPlaceholder" Text="Select an image to start. Scroll to Zoom, Right-Click Drag to Pan." Foreground="#94A3B8" FontSize="13" HorizontalAlignment="Center" VerticalAlignment="Center" IsHitTestVisible="False"/>
</Grid>
</Border>
<!-- Right side: Cropped portrait preview -->
<Grid Grid.Column="2">
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="*"/>
</Grid.RowDefinitions>
<TextBlock Grid.Row="0" Text="Cropped Live Preview" Foreground="{DynamicResource TextBrush}" FontSize="13" FontWeight="Bold" HorizontalAlignment="Center" Margin="0,5,0,10"/>
<Border Grid.Row="1" BorderBrush="{DynamicResource BorderBrush}" BorderThickness="2" HorizontalAlignment="Center" VerticalAlignment="Center" MaxWidth="240" MaxHeight="300">
<Grid x:Name="GridCroppedResultBg" Background="White">
<Image x:Name="ImgCroppedResult" Stretch="Uniform" StretchDirection="Both" SnapsToDevicePixels="True"/>
<TextBlock x:Name="TxtCropResultPlaceholder" Text="Portrait Preview" Foreground="#94A3B8" FontSize="12" HorizontalAlignment="Center" VerticalAlignment="Center"/>
<!-- Lightweight Progress Ring -->
<Grid x:Name="PnlProgressRing" Visibility="Collapsed" HorizontalAlignment="Center" VerticalAlignment="Center" Width="30" Height="30">
<Ellipse Stroke="#E2E8F0" StrokeThickness="3" Width="30" Height="30"/>
<Ellipse Stroke="{DynamicResource AccentBrush}" StrokeThickness="3" StrokeDashArray="3 1" Width="30" Height="30" RenderTransformOrigin="0.5,0.5">
<Ellipse.RenderTransform>
<RotateTransform x:Name="RotTransform" Angle="0"/>
</Ellipse.RenderTransform>
<Ellipse.Triggers>
<EventTrigger RoutedEvent="Loaded">
<BeginStoryboard>
<Storyboard>
<DoubleAnimation Storyboard.TargetName="RotTransform" Storyboard.TargetProperty="Angle" From="0" To="360" Duration="0:0:1" RepeatBehavior="Forever"/>
</Storyboard>
</BeginStoryboard>
</EventTrigger>
</Ellipse.Triggers>
</Ellipse>
</Grid>
</Grid>
</Border>
</Grid>
</Grid>
</TabItem>
<!-- Tab 2: Print Grid Sheet -->
<TabItem Header="Print Grid Sheet" Style="{StaticResource UnderlineTabItem}">
<Grid Margin="0,15,0,0">
<Grid.RowDefinitions>
<RowDefinition Height="*"/>
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<Border Grid.Row="0" Background="#0A000000" BorderThickness="1" BorderBrush="{DynamicResource BorderBrush}" CornerRadius="4" Padding="10">
<Grid Background="#0F172A">
<Image x:Name="ImgSheetResult" Stretch="Uniform" HorizontalAlignment="Center" VerticalAlignment="Center" MaxHeight="450"/>
<TextBlock x:Name="TxtSheetPlaceholder" Text="Grid sheet will be displayed here" Foreground="#94A3B8" FontSize="13" HorizontalAlignment="Center" VerticalAlignment="Center"/>
</Grid>
</Border>
<TextBlock Grid.Row="1" Text="Tip: Increase/Decrease copies or page size in the settings card on the left. The grid adjusts dynamically." Foreground="{DynamicResource MutedTextBrush}" FontSize="11" HorizontalAlignment="Center" Margin="0,10,0,0" />
</Grid>
</TabItem>
</TabControl>
</Border>
</Grid>
<!-- Bottom Action Bar -->
<Border Grid.Row="2" Background="{DynamicResource CardBgBrush}" BorderThickness="1" BorderBrush="{DynamicResource BorderBrush}" CornerRadius="8" Padding="12">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="*" />
<ColumnDefinition Width="Auto" />
</Grid.ColumnDefinitions>
<Button Grid.Column="0" Content="Back to Home" Click="BtnNavHome_Click" Style="{StaticResource MutedButton}"/>
<StackPanel Grid.Column="2" Orientation="Horizontal">
<Button x:Name="BtnSavePhoto" Content="Save Photo" Click="BtnSavePhoto_Click" Style="{StaticResource SuccessButton}" Width="110"/>
<Button x:Name="BtnSaveSheet" Content="Save Sheet" Margin="10,0,0,0" Click="BtnSaveSheet_Click" Style="{StaticResource SuccessButton}" Width="110"/>
<Button x:Name="BtnPrintSheet" Content="Print Sheet" Margin="10,0,0,0" Click="BtnPrintSheet_Click" Style="{StaticResource InfoButton}" Width="110"/>
</StackPanel>
</Grid>
</Border>
</Grid>
<!-- 3. PDF Utility Panel (tabbed overhaul housing all 12 tools) -->
<Grid x:Name="PanelPdf" Visibility="Collapsed" Margin="0" HorizontalAlignment="Stretch" VerticalAlignment="Stretch">
<Grid.Resources>
<Style x:Key="PdfTabControl" TargetType="TabControl" BasedOn="{StaticResource ModernTabControl}">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="TabControl">
<Grid KeyboardNavigation.TabNavigation="Local" ClipToBounds="true" SnapsToDevicePixels="true" HorizontalAlignment="Stretch" VerticalAlignment="Stretch">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="250"/>
<ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions>
<!-- Tool List Panel (TabPanel) -->
<ScrollViewer Grid.Column="0" VerticalScrollBarVisibility="Auto" HorizontalScrollBarVisibility="Disabled" HorizontalAlignment="Stretch" VerticalAlignment="Stretch">
<TabPanel x:Name="HeaderPanel" IsItemsHost="true" KeyboardNavigation.TabIndex="1" HorizontalAlignment="Stretch" VerticalAlignment="Stretch"/>
</ScrollViewer>
<!-- Selected Tool Action Panel & Preview Panel -->
<Border Grid.Column="1"
Background="{TemplateBinding Background}"
BorderThickness="{TemplateBinding BorderThickness}"
BorderBrush="{TemplateBinding BorderBrush}"
HorizontalAlignment="Stretch"
VerticalAlignment="Stretch">
<ContentPresenter x:Name="PART_SelectedContentHost"
ContentSource="SelectedContent"
HorizontalAlignment="Stretch"
VerticalAlignment="Stretch"/>
</Border>
</Grid>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</Grid.Resources>
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="*" />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<StackPanel Grid.Row="0" Margin="0,0,0,15">
<TextBlock Text="Document Assembler & Suite" Foreground="{DynamicResource MutedTextBrush}" FontSize="13" FontWeight="SemiBold"/>
<TextBlock Text="PDF Utility Suite" Foreground="{DynamicResource TextBrush}" FontSize="24" FontWeight="Bold"/>
</StackPanel>
<!-- Tabbed left vertical navigation hosting 12 tools -->
<TabControl Grid.Row="1" TabStripPlacement="Left" Style="{StaticResource PdfTabControl}" SelectionChanged="PdfToolsTabControl_SelectionChanged" HorizontalAlignment="Stretch" VerticalAlignment="Stretch">
<!-- 1. PDF to Image Converter -->
<TabItem Header="1. PDF to Image" Style="{StaticResource LeftTabItem}">
<Grid Margin="0" HorizontalAlignment="Stretch" VerticalAlignment="Stretch">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="300" />
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<Border Grid.Column="0" HorizontalAlignment="Stretch" Margin="0" Background="{DynamicResource CardBgBrush}" BorderThickness="1" BorderBrush="{DynamicResource BorderBrush}" CornerRadius="8" Padding="15">
<StackPanel>
<TextBlock Text="PDF to Image" Foreground="{DynamicResource TextBrush}" FontSize="14" FontWeight="Bold" Margin="0,0,0,10"/>
<Button x:Name="BtnPdfToImgBrowse" Content="Select PDF File" Click="BtnPdfToImgBrowse_Click" Style="{StaticResource AccentButton}" Margin="0,5,0,5"/>
<TextBlock x:Name="LblPdfToImgFile" Text="No file selected" Foreground="{DynamicResource MutedTextBrush}" FontSize="11" TextTrimming="CharacterEllipsis"/>
<Separator Margin="0,15" Background="{DynamicResource BorderBrush}"/>
<Button x:Name="BtnPdfToImgSaveAll" Content="Export All Pages" Click="BtnPdfToImgSaveAll_Click" Style="{StaticResource SuccessButton}" Margin="0,5,0,5"/>
</StackPanel>
</Border>
<Border Grid.Column="1" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Background="{DynamicResource CardBgBrush}" BorderThickness="1" BorderBrush="{DynamicResource BorderBrush}" CornerRadius="8">
<ScrollViewer VerticalScrollBarVisibility="Auto" HorizontalScrollBarVisibility="Disabled" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" HorizontalContentAlignment="Stretch" VerticalContentAlignment="Stretch" Width="Auto" Height="Auto">
<Grid HorizontalAlignment="Stretch" VerticalAlignment="Stretch">
<!-- Empty State Placeholder -->
<StackPanel x:Name="WpPdfToImgPreviewsPlaceholder" HorizontalAlignment="Center" VerticalAlignment="Center" Margin="20">
<TextBlock Text="📁" FontSize="36" Foreground="{DynamicResource AccentBrush}" HorizontalAlignment="Center" Margin="0,0,0,10"/>
<TextBlock Text="No Document Loaded" FontSize="14" FontWeight="Bold" Foreground="{DynamicResource TextBrush}" HorizontalAlignment="Center" Margin="0,0,0,5"/>
<TextBlock Text="Drag & Drop PDF files or use the left panel to begin." FontSize="11" Foreground="{DynamicResource MutedTextBrush}" HorizontalAlignment="Center" TextAlignment="Center" TextWrapping="Wrap"/>
</StackPanel>
<WrapPanel x:Name="WpPdfToImgPreviews" Orientation="Horizontal" HorizontalAlignment="Stretch" VerticalAlignment="Top" ItemWidth="160" ItemHeight="230"/>
</Grid>
</ScrollViewer>
</Border>
</Grid>
</TabItem>
<!-- 2. Image to PDF Converter -->
<TabItem Header="2. Image to PDF" Style="{StaticResource LeftTabItem}">
<Grid Margin="0" HorizontalAlignment="Stretch" VerticalAlignment="Stretch">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="300" />
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<Border Grid.Column="0" HorizontalAlignment="Stretch" Margin="0" Background="{DynamicResource CardBgBrush}" BorderThickness="1" BorderBrush="{DynamicResource BorderBrush}" CornerRadius="8" Padding="15">
<StackPanel>
<TextBlock Text="Image to PDF" Foreground="{DynamicResource TextBrush}" FontSize="14" FontWeight="Bold" Margin="0,0,0,10"/>
<Button x:Name="BtnImgToPdfAdd" Content="Add Image Files" Click="BtnImgToPdfAdd_Click" Style="{StaticResource AccentButton}" Margin="0,5,0,5"/>
<Button x:Name="BtnImgToPdfClear" Content="Clear All Images" Click="BtnImgToPdfClear_Click" Style="{StaticResource MutedButton}" Margin="0,5,0,5"/>
<Separator Margin="0,15" Background="{DynamicResource BorderBrush}"/>
<Button x:Name="BtnImgToPdfCompile" Content="Compile & Save PDF" Click="BtnImgToPdfCompile_Click" Style="{StaticResource SuccessButton}" Margin="0,5,0,5"/>
</StackPanel>
</Border>
<Border Grid.Column="1" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Background="{DynamicResource CardBgBrush}" BorderThickness="1" BorderBrush="{DynamicResource BorderBrush}" CornerRadius="8">
<ScrollViewer VerticalScrollBarVisibility="Auto" HorizontalScrollBarVisibility="Disabled" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" HorizontalContentAlignment="Stretch" VerticalContentAlignment="Stretch" Width="Auto" Height="Auto">
<Grid HorizontalAlignment="Stretch" VerticalAlignment="Stretch">
<!-- Empty State Placeholder -->
<StackPanel x:Name="WpImgToPdfPreviewsPlaceholder" HorizontalAlignment="Center" VerticalAlignment="Center" Margin="20">
<TextBlock Text="📁" FontSize="36" Foreground="{DynamicResource AccentBrush}" HorizontalAlignment="Center" Margin="0,0,0,10"/>
<TextBlock Text="No Document Loaded" FontSize="14" FontWeight="Bold" Foreground="{DynamicResource TextBrush}" HorizontalAlignment="Center" Margin="0,0,0,5"/>
<TextBlock Text="Drag & Drop PDF files or use the left panel to begin." FontSize="11" Foreground="{DynamicResource MutedTextBrush}" HorizontalAlignment="Center" TextAlignment="Center" TextWrapping="Wrap"/>
</StackPanel>
<WrapPanel x:Name="WpImgToPdfPreviews" Orientation="Horizontal" HorizontalAlignment="Stretch" VerticalAlignment="Top" ItemWidth="160" ItemHeight="230"/>
</Grid>
</ScrollViewer>
</Border>
</Grid>
</TabItem>
<!-- 3. Password Protect PDF -->
<TabItem Header="3. Protect PDF" Style="{StaticResource LeftTabItem}">
<Grid Margin="0" HorizontalAlignment="Stretch" VerticalAlignment="Stretch">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="300" />
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<Border Grid.Column="0" HorizontalAlignment="Stretch" Margin="0" Background="{DynamicResource CardBgBrush}" BorderThickness="1" BorderBrush="{DynamicResource BorderBrush}" CornerRadius="8" Padding="15">
<StackPanel>
<TextBlock Text="Password Protect" Foreground="{DynamicResource TextBrush}" FontSize="14" FontWeight="Bold" Margin="0,0,0,10"/>
<TextBlock Text="Target PDF File" Foreground="{DynamicResource MutedTextBrush}" FontSize="11" Margin="0,0,0,5"/>
<Grid Margin="0,0,0,15">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="5"/>
<ColumnDefinition Width="Auto"/>
</Grid.ColumnDefinitions>
<TextBox x:Name="TxtProtectPdfPath" Style="{StaticResource ModernTextBox}" IsReadOnly="True" VerticalContentAlignment="Center" FontSize="11"/>
<Button Grid.Column="2" Content="Browse" Click="BtnProtectPdfBrowse_Click" Style="{StaticResource ModernButton}" Padding="8,4"/>
</Grid>
<TextBlock Text="Set Password" Foreground="{DynamicResource MutedTextBrush}" FontSize="11" Margin="0,0,0,5"/>
<TextBox x:Name="TxtProtectPassword" Style="{StaticResource ModernTextBox}" Margin="0,0,0,25" VerticalContentAlignment="Center" FontSize="11"/>
<Button Content="Encrypt & Save PDF" Click="BtnProtectPdfApply_Click" Style="{StaticResource SuccessButton}" HorizontalAlignment="Stretch"/>
</StackPanel>
</Border>
<Border Grid.Column="1" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Background="{DynamicResource CardBgBrush}" BorderThickness="1" BorderBrush="{DynamicResource BorderBrush}" CornerRadius="8">
<ScrollViewer VerticalScrollBarVisibility="Auto" HorizontalScrollBarVisibility="Disabled" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" HorizontalContentAlignment="Stretch" VerticalContentAlignment="Stretch" Width="Auto" Height="Auto">
<Grid HorizontalAlignment="Stretch" VerticalAlignment="Stretch">
<!-- Empty State Placeholder -->
<StackPanel x:Name="WpProtectPdfPreviewsPlaceholder" HorizontalAlignment="Center" VerticalAlignment="Center" Margin="20">
<TextBlock Text="📁" FontSize="36" Foreground="{DynamicResource AccentBrush}" HorizontalAlignment="Center" Margin="0,0,0,10"/>
<TextBlock Text="No Document Loaded" FontSize="14" FontWeight="Bold" Foreground="{DynamicResource TextBrush}" HorizontalAlignment="Center" Margin="0,0,0,5"/>
<TextBlock Text="Drag & Drop PDF files or use the left panel to begin." FontSize="11" Foreground="{DynamicResource MutedTextBrush}" HorizontalAlignment="Center" TextAlignment="Center" TextWrapping="Wrap"/>
</StackPanel>
<WrapPanel x:Name="WpProtectPdfPreviews" Orientation="Horizontal" HorizontalAlignment="Stretch" VerticalAlignment="Top" ItemWidth="160" ItemHeight="230"/>
</Grid>
</ScrollViewer>
</Border>
</Grid>
</TabItem>
<!-- 4. Unlock PDF Password -->
<TabItem Header="4. Unlock PDF" Style="{StaticResource LeftTabItem}">
<Grid Margin="0" HorizontalAlignment="Stretch" VerticalAlignment="Stretch">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="300" />
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<Border Grid.Column="0" HorizontalAlignment="Stretch" Margin="0" Background="{DynamicResource CardBgBrush}" BorderThickness="1" BorderBrush="{DynamicResource BorderBrush}" CornerRadius="8" Padding="15">
<StackPanel>
<TextBlock Text="Decrypt / Unlock PDF" Foreground="{DynamicResource TextBrush}" FontSize="14" FontWeight="Bold" Margin="0,0,0,10"/>
<TextBlock Text="Locked PDF File" Foreground="{DynamicResource MutedTextBrush}" FontSize="11" Margin="0,0,0,5"/>
<Grid Margin="0,0,0,15">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="5"/>
<ColumnDefinition Width="Auto"/>
</Grid.ColumnDefinitions>
<TextBox x:Name="TxtUnlockPdfPath" Style="{StaticResource ModernTextBox}" IsReadOnly="True" VerticalContentAlignment="Center" FontSize="11"/>
<Button Grid.Column="2" Content="Browse" Click="BtnUnlockPdfBrowse_Click" Style="{StaticResource ModernButton}" Padding="8,4"/>
</Grid>
<TextBlock Text="Enter Document Password" Foreground="{DynamicResource MutedTextBrush}" FontSize="11" Margin="0,0,0,5"/>
<TextBox x:Name="TxtUnlockPassword" Style="{StaticResource ModernTextBox}" Margin="0,0,0,25" VerticalContentAlignment="Center" FontSize="11"/>
<Button Content="Decrypt & Save PDF" Click="BtnUnlockPdfApply_Click" Style="{StaticResource SuccessButton}" HorizontalAlignment="Stretch"/>
</StackPanel>
</Border>
<Border Grid.Column="1" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Background="{DynamicResource CardBgBrush}" BorderThickness="1" BorderBrush="{DynamicResource BorderBrush}" CornerRadius="8">
<ScrollViewer VerticalScrollBarVisibility="Auto" HorizontalScrollBarVisibility="Disabled" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" HorizontalContentAlignment="Stretch" VerticalContentAlignment="Stretch" Width="Auto" Height="Auto">
<Grid HorizontalAlignment="Stretch" VerticalAlignment="Stretch">
<!-- Empty State Placeholder -->
<StackPanel x:Name="WpUnlockPdfPreviewsPlaceholder" HorizontalAlignment="Center" VerticalAlignment="Center" Margin="20">
<TextBlock Text="📁" FontSize="36" Foreground="{DynamicResource AccentBrush}" HorizontalAlignment="Center" Margin="0,0,0,10"/>
<TextBlock Text="No Document Loaded" FontSize="14" FontWeight="Bold" Foreground="{DynamicResource TextBrush}" HorizontalAlignment="Center" Margin="0,0,0,5"/>
<TextBlock Text="Drag & Drop PDF files or use the left panel to begin." FontSize="11" Foreground="{DynamicResource MutedTextBrush}" HorizontalAlignment="Center" TextAlignment="Center" TextWrapping="Wrap"/>
</StackPanel>
<WrapPanel x:Name="WpUnlockPdfPreviews" Orientation="Horizontal" HorizontalAlignment="Stretch" VerticalAlignment="Top" ItemWidth="160" ItemHeight="230"/>
</Grid>
</ScrollViewer>
</Border>
</Grid>
</TabItem>
<!-- 5. Rearrange Pages with Preview -->
<TabItem Header="5. Rearrange Pages" Style="{StaticResource LeftTabItem}">
<Grid Margin="0" HorizontalAlignment="Stretch" VerticalAlignment="Stretch">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="300" />
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<Border Grid.Column="0" HorizontalAlignment="Stretch" Margin="0" Background="{DynamicResource CardBgBrush}" BorderThickness="1" BorderBrush="{DynamicResource BorderBrush}" CornerRadius="8" Padding="15">
<StackPanel>
<TextBlock Text="Rearrange Pages" Foreground="{DynamicResource TextBrush}" FontSize="14" FontWeight="Bold" Margin="0,0,0,10"/>
<Button x:Name="BtnRearrangeBrowse" Content="Select PDF File" Click="BtnRearrangeBrowse_Click" Style="{StaticResource AccentButton}" Margin="0,5,0,5"/>
<TextBlock x:Name="LblRearrangeFile" Text="No file selected" Foreground="{DynamicResource MutedTextBrush}" FontSize="11" TextTrimming="CharacterEllipsis"/>
<Separator Margin="0,15" Background="{DynamicResource BorderBrush}"/>
<Button x:Name="BtnRearrangeSave" Content="Save Rearranged PDF" Click="BtnRearrangeSave_Click" Style="{StaticResource SuccessButton}" Margin="0,5,0,5"/>
</StackPanel>
</Border>
<Border Grid.Column="1" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Background="{DynamicResource CardBgBrush}" BorderThickness="1" BorderBrush="{DynamicResource BorderBrush}" CornerRadius="8">
<ScrollViewer VerticalScrollBarVisibility="Auto" HorizontalScrollBarVisibility="Disabled" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" HorizontalContentAlignment="Stretch" VerticalContentAlignment="Stretch" Width="Auto" Height="Auto">
<Grid HorizontalAlignment="Stretch" VerticalAlignment="Stretch">
<!-- Empty State Placeholder -->
<StackPanel x:Name="WpRearrangePreviewsPlaceholder" HorizontalAlignment="Center" VerticalAlignment="Center" Margin="20">
<TextBlock Text="📁" FontSize="36" Foreground="{DynamicResource AccentBrush}" HorizontalAlignment="Center" Margin="0,0,0,10"/>
<TextBlock Text="No Document Loaded" FontSize="14" FontWeight="Bold" Foreground="{DynamicResource TextBrush}" HorizontalAlignment="Center" Margin="0,0,0,5"/>
<TextBlock Text="Drag & Drop PDF files or use the left panel to begin." FontSize="11" Foreground="{DynamicResource MutedTextBrush}" HorizontalAlignment="Center" TextAlignment="Center" TextWrapping="Wrap"/>
</StackPanel>
<WrapPanel x:Name="WpRearrangePreviews" Orientation="Horizontal" HorizontalAlignment="Stretch" VerticalAlignment="Top" ItemWidth="160" ItemHeight="230"/>
</Grid>
</ScrollViewer>
</Border>
</Grid>
</TabItem>
<!-- 6. Merge PDFs -->
<TabItem Header="6. Merge PDFs" Style="{StaticResource LeftTabItem}">
<Grid Margin="0" HorizontalAlignment="Stretch" VerticalAlignment="Stretch">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="300" />
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<!-- Left Column Control Panel -->
<Border Grid.Column="0" HorizontalAlignment="Stretch" Margin="0" Background="{DynamicResource CardBgBrush}" BorderThickness="1" BorderBrush="{DynamicResource BorderBrush}" CornerRadius="8" Padding="15">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="*" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<TextBlock Grid.Row="0" Text="Arranged PDF Documents" Foreground="{DynamicResource TextBrush}" FontSize="14" FontWeight="Bold" Margin="0,0,0,10"/>
<Grid Grid.Row="1" Margin="0,0,0,10">
<ListBox x:Name="LstPdfFiles" AllowDrop="True"
DragEnter="LstPdfFiles_DragEnter" DragOver="LstPdfFiles_DragOver" Drop="LstPdfFiles_Drop"
Background="#0F172A" BorderBrush="{DynamicResource BorderBrush}" BorderThickness="1" Foreground="#FFFFFF" FontWeight="SemiBold" Padding="5">
<ListBox.ItemTemplate>
<DataTemplate>
<Grid Margin="2">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<Image Grid.Column="0" Source="assets/pdf_icon.png" Width="12" Height="12" Margin="0,0,6,0"/>
<TextBlock Grid.Column="1" Text="{Binding}" Foreground="#FFFFFF" FontSize="11" TextTrimming="CharacterEllipsis"/>
</Grid>
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
<TextBlock x:Name="TxtPdfPlaceholder" Text="Drag & Drop PDF Files Here" Foreground="#E0E0E0" FontSize="11" HorizontalAlignment="Center" VerticalAlignment="Center" IsHitTestVisible="False" TextWrapping="Wrap" Margin="10"/>
</Grid>
<!-- Actions -->
<Grid Grid.Row="2" Margin="0,0,0,10">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<Button Content="Add PDFs" Click="BtnAddPdfs_Click" Style="{StaticResource AccentButton}" Margin="0,2,2,2"/>
<Button Grid.Column="1" Content="Clear All" Click="BtnClearPdfs_Click" Style="{StaticResource ModernButton}" Margin="2,2,0,2"/>
<Button Grid.Row="1" Content="Move Up" Click="BtnMovePdfUp_Click" Style="{StaticResource ModernButton}" Margin="0,2,2,0"/>
<Button Grid.Row="1" Grid.Column="1" Content="Move Down" Click="BtnMovePdfDown_Click" Style="{StaticResource ModernButton}" Margin="2,2,0,0"/>
</Grid>
<!-- Primary Save button -->
<Button Grid.Row="3" Content="Merge and Save PDF" Click="BtnMergePdfs_Click" Style="{StaticResource SuccessButton}" HorizontalAlignment="Stretch"/>
</Grid>
</Border>
<!-- Right Panel Preview Workspace -->
<Border Grid.Column="1" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Background="{DynamicResource CardBgBrush}" BorderThickness="1" BorderBrush="{DynamicResource BorderBrush}" CornerRadius="8">
<ScrollViewer VerticalScrollBarVisibility="Auto" HorizontalScrollBarVisibility="Disabled" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" HorizontalContentAlignment="Stretch" VerticalContentAlignment="Stretch" Width="Auto" Height="Auto">
<Grid HorizontalAlignment="Stretch" VerticalAlignment="Stretch">
<!-- Empty State Placeholder -->
<StackPanel x:Name="WpMergePreviewsPlaceholder" HorizontalAlignment="Center" VerticalAlignment="Center" Margin="20">
<TextBlock Text="📁" FontSize="36" Foreground="{DynamicResource AccentBrush}" HorizontalAlignment="Center" Margin="0,0,0,10"/>
<TextBlock Text="No Document Loaded" FontSize="14" FontWeight="Bold" Foreground="{DynamicResource TextBrush}" HorizontalAlignment="Center" Margin="0,0,0,5"/>
<TextBlock Text="Drag & Drop PDF files or use the left panel to begin." FontSize="11" Foreground="{DynamicResource MutedTextBrush}" HorizontalAlignment="Center" TextAlignment="Center" TextWrapping="Wrap"/>
</StackPanel>
<WrapPanel x:Name="WpMergePreviews" Orientation="Horizontal" HorizontalAlignment="Stretch" VerticalAlignment="Top" ItemWidth="160" ItemHeight="230"/>
</Grid>
</ScrollViewer>
</Border>
</Grid>
</TabItem>
<!-- 7. Split PDF with Preview -->
<TabItem Header="7. Split PDF" Style="{StaticResource LeftTabItem}">
<Grid Margin="0" HorizontalAlignment="Stretch" VerticalAlignment="Stretch">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="300" />
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<Border Grid.Column="0" HorizontalAlignment="Stretch" Margin="0" Background="{DynamicResource CardBgBrush}" BorderThickness="1" BorderBrush="{DynamicResource BorderBrush}" CornerRadius="8" Padding="15">
<StackPanel>
<TextBlock Text="Split PDF Pages" Foreground="{DynamicResource TextBrush}" FontSize="14" FontWeight="Bold" Margin="0,0,0,10"/>
<Button x:Name="BtnSplitVisualBrowse" Content="Select PDF File" Click="BtnSplitVisualBrowse_Click" Style="{StaticResource AccentButton}" Margin="0,5,0,5"/>
<TextBlock x:Name="LblSplitVisualFile" Text="No file selected" Foreground="{DynamicResource MutedTextBrush}" FontSize="11" TextTrimming="CharacterEllipsis"/>
<Separator Margin="0,15" Background="{DynamicResource BorderBrush}"/>
<Button x:Name="BtnSplitVisualSave" Content="Save Split Pages" Click="BtnSplitVisualSave_Click" Style="{StaticResource SuccessButton}" Margin="0,5,0,5"/>
</StackPanel>
</Border>
<Border Grid.Column="1" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Background="{DynamicResource CardBgBrush}" BorderThickness="1" BorderBrush="{DynamicResource BorderBrush}" CornerRadius="8">
<ScrollViewer VerticalScrollBarVisibility="Auto" HorizontalScrollBarVisibility="Disabled" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" HorizontalContentAlignment="Stretch" VerticalContentAlignment="Stretch" Width="Auto" Height="Auto">
<Grid HorizontalAlignment="Stretch" VerticalAlignment="Stretch">
<!-- Empty State Placeholder -->
<StackPanel x:Name="WpSplitVisualPreviewsPlaceholder" HorizontalAlignment="Center" VerticalAlignment="Center" Margin="20">
<TextBlock Text="📁" FontSize="36" Foreground="{DynamicResource AccentBrush}" HorizontalAlignment="Center" Margin="0,0,0,10"/>
<TextBlock Text="No Document Loaded" FontSize="14" FontWeight="Bold" Foreground="{DynamicResource TextBrush}" HorizontalAlignment="Center" Margin="0,0,0,5"/>
<TextBlock Text="Drag & Drop PDF files or use the left panel to begin." FontSize="11" Foreground="{DynamicResource MutedTextBrush}" HorizontalAlignment="Center" TextAlignment="Center" TextWrapping="Wrap"/>
</StackPanel>
<WrapPanel x:Name="WpSplitVisualPreviews" Orientation="Horizontal" HorizontalAlignment="Stretch" VerticalAlignment="Top" ItemWidth="160" ItemHeight="230"/>
</Grid>
</ScrollViewer>
</Border>
</Grid>
</TabItem>
<!-- 8. Add Page Numbers -->
<TabItem Header="8. Page Numbers" Style="{StaticResource LeftTabItem}">
<Grid Margin="0" HorizontalAlignment="Stretch" VerticalAlignment="Stretch">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="300" />
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<Border Grid.Column="0" HorizontalAlignment="Stretch" Margin="0" Background="{DynamicResource CardBgBrush}" BorderThickness="1" BorderBrush="{DynamicResource BorderBrush}" CornerRadius="8" Padding="15">
<StackPanel>
<TextBlock Text="Add Page Numbers" Foreground="{DynamicResource TextBrush}" FontSize="14" FontWeight="Bold" Margin="0,0,0,10"/>
<TextBlock Text="Target PDF File" Foreground="{DynamicResource MutedTextBrush}" FontSize="11" Margin="0,0,0,5"/>
<Grid Margin="0,0,0,15">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="5"/>
<ColumnDefinition Width="Auto"/>
</Grid.ColumnDefinitions>
<TextBox x:Name="TxtPageNumPdfPath" Style="{StaticResource ModernTextBox}" IsReadOnly="True" VerticalContentAlignment="Center" FontSize="11"/>
<Button Grid.Column="2" Content="Browse" Click="BtnPageNumPdfBrowse_Click" Style="{StaticResource ModernButton}" Padding="8,4"/>
</Grid>
<TextBlock Text="Page Number Position" Foreground="{DynamicResource MutedTextBrush}" FontSize="11" Margin="0,0,0,5"/>
<ComboBox x:Name="CmbPageNumPosition" Style="{StaticResource ModernComboBox}" Margin="0,0,0,25" HorizontalAlignment="Stretch">
<ComboBoxItem Content="Bottom Center" IsSelected="True" />
<ComboBoxItem Content="Bottom Left" />
<ComboBoxItem Content="Bottom Right" />
</ComboBox>
<Button Content="Stamp Numbers & Save" Click="BtnPageNumApply_Click" Style="{StaticResource SuccessButton}" HorizontalAlignment="Stretch"/>
</StackPanel>
</Border>
<Border Grid.Column="1" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Background="{DynamicResource CardBgBrush}" BorderThickness="1" BorderBrush="{DynamicResource BorderBrush}" CornerRadius="8">
<ScrollViewer VerticalScrollBarVisibility="Auto" HorizontalScrollBarVisibility="Disabled" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" HorizontalContentAlignment="Stretch" VerticalContentAlignment="Stretch" Width="Auto" Height="Auto">
<Grid HorizontalAlignment="Stretch" VerticalAlignment="Stretch">
<!-- Empty State Placeholder -->
<StackPanel x:Name="WpPageNumPreviewsPlaceholder" HorizontalAlignment="Center" VerticalAlignment="Center" Margin="20">
<TextBlock Text="📁" FontSize="36" Foreground="{DynamicResource AccentBrush}" HorizontalAlignment="Center" Margin="0,0,0,10"/>
<TextBlock Text="No Document Loaded" FontSize="14" FontWeight="Bold" Foreground="{DynamicResource TextBrush}" HorizontalAlignment="Center" Margin="0,0,0,5"/>
<TextBlock Text="Drag & Drop PDF files or use the left panel to begin." FontSize="11" Foreground="{DynamicResource MutedTextBrush}" HorizontalAlignment="Center" TextAlignment="Center" TextWrapping="Wrap"/>
</StackPanel>
<WrapPanel x:Name="WpPageNumPreviews" Orientation="Horizontal" HorizontalAlignment="Stretch" VerticalAlignment="Top" ItemWidth="160" ItemHeight="230"/>
</Grid>
</ScrollViewer>
</Border>
</Grid>
</TabItem>
<!-- 9. Add/Delete Page with Preview -->
<TabItem Header="9. Add/Delete Page" Style="{StaticResource LeftTabItem}">
<Grid Margin="0" HorizontalAlignment="Stretch" VerticalAlignment="Stretch">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="300" />
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<Border Grid.Column="0" HorizontalAlignment="Stretch" Margin="0" Background="{DynamicResource CardBgBrush}" BorderThickness="1" BorderBrush="{DynamicResource BorderBrush}" CornerRadius="8" Padding="15">
<StackPanel>
<TextBlock Text="Add / Delete Pages" Foreground="{DynamicResource TextBrush}" FontSize="14" FontWeight="Bold" Margin="0,0,0,10"/>
<Button x:Name="BtnAddDeleteBrowse" Content="Select PDF File" Click="BtnAddDeleteBrowse_Click" Style="{StaticResource AccentButton}" Margin="0,5,0,5"/>
<TextBlock x:Name="LblAddDeleteFile" Text="No file selected" Foreground="{DynamicResource MutedTextBrush}" FontSize="11" TextTrimming="CharacterEllipsis"/>
<Separator Margin="0,15" Background="{DynamicResource BorderBrush}"/>
<Button x:Name="BtnAddDeleteBlank" Content="Append Blank Page" Click="BtnAddDeleteBlank_Click" Style="{StaticResource ModernButton}" Margin="0,5,0,5"/>
<Button x:Name="BtnAddDeleteSave" Content="Save Final Changes" Click="BtnAddDeleteSave_Click" Style="{StaticResource SuccessButton}" Margin="0,5,0,5"/>
</StackPanel>
</Border>
<Border Grid.Column="1" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Background="{DynamicResource CardBgBrush}" BorderThickness="1" BorderBrush="{DynamicResource BorderBrush}" CornerRadius="8">
<ScrollViewer VerticalScrollBarVisibility="Auto" HorizontalScrollBarVisibility="Disabled" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" HorizontalContentAlignment="Stretch" VerticalContentAlignment="Stretch" Width="Auto" Height="Auto">
<Grid HorizontalAlignment="Stretch" VerticalAlignment="Stretch">
<!-- Empty State Placeholder -->
<StackPanel x:Name="WpAddDeletePreviewsPlaceholder" HorizontalAlignment="Center" VerticalAlignment="Center" Margin="20">
<TextBlock Text="📁" FontSize="36" Foreground="{DynamicResource AccentBrush}" HorizontalAlignment="Center" Margin="0,0,0,10"/>
<TextBlock Text="No Document Loaded" FontSize="14" FontWeight="Bold" Foreground="{DynamicResource TextBrush}" HorizontalAlignment="Center" Margin="0,0,0,5"/>
<TextBlock Text="Drag & Drop PDF files or use the left panel to begin." FontSize="11" Foreground="{DynamicResource MutedTextBrush}" HorizontalAlignment="Center" TextAlignment="Center" TextWrapping="Wrap"/>
</StackPanel>
<WrapPanel x:Name="WpAddDeletePreviews" Orientation="Horizontal" HorizontalAlignment="Stretch" VerticalAlignment="Top" ItemWidth="160" ItemHeight="230"/>
</Grid>
</ScrollViewer>
</Border>
</Grid>
</TabItem>
<!-- 10. Word to PDF Converter -->
<TabItem Header="10. Word to PDF" Style="{StaticResource LeftTabItem}">
<Grid Margin="0" HorizontalAlignment="Stretch" VerticalAlignment="Stretch">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="300" />
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<Border Grid.Column="0" HorizontalAlignment="Stretch" Margin="0" Background="{DynamicResource CardBgBrush}" BorderThickness="1" BorderBrush="{DynamicResource BorderBrush}" CornerRadius="8" Padding="15">
<StackPanel>
<TextBlock Text="Word to PDF (.docx)" Foreground="{DynamicResource TextBrush}" FontSize="14" FontWeight="Bold" Margin="0,0,0,10"/>
<TextBlock Text="Select Word Document" Foreground="{DynamicResource MutedTextBrush}" FontSize="11" Margin="0,0,0,5"/>
<Grid Margin="0,0,0,25">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="5"/>
<ColumnDefinition Width="Auto"/>
</Grid.ColumnDefinitions>
<TextBox x:Name="TxtDocxPath" Style="{StaticResource ModernTextBox}" IsReadOnly="True" VerticalContentAlignment="Center" FontSize="11"/>
<Button Grid.Column="2" Content="Browse" Click="BtnDocxBrowse_Click" Style="{StaticResource ModernButton}" Padding="8,4"/>
</Grid>
<Button Content="Convert & Save PDF" Click="BtnDocxToPdfApply_Click" Style="{StaticResource SuccessButton}" HorizontalAlignment="Stretch"/>
</StackPanel>
</Border>
<Border Grid.Column="1" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Background="{DynamicResource CardBgBrush}" BorderThickness="1" BorderBrush="{DynamicResource BorderBrush}" CornerRadius="8">
<ScrollViewer VerticalScrollBarVisibility="Auto" HorizontalScrollBarVisibility="Disabled" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" HorizontalContentAlignment="Stretch" VerticalContentAlignment="Stretch" Width="Auto" Height="Auto">
<Grid HorizontalAlignment="Stretch" VerticalAlignment="Stretch">
<!-- Empty State Placeholder -->
<StackPanel x:Name="WpDocxToPdfPreviewsPlaceholder" HorizontalAlignment="Center" VerticalAlignment="Center" Margin="20">
<TextBlock Text="📁" FontSize="36" Foreground="{DynamicResource AccentBrush}" HorizontalAlignment="Center" Margin="0,0,0,10"/>
<TextBlock Text="No Document Loaded" FontSize="14" FontWeight="Bold" Foreground="{DynamicResource TextBrush}" HorizontalAlignment="Center" Margin="0,0,0,5"/>
<TextBlock Text="Drag & Drop PDF files or use the left panel to begin." FontSize="11" Foreground="{DynamicResource MutedTextBrush}" HorizontalAlignment="Center" TextAlignment="Center" TextWrapping="Wrap"/>
</StackPanel>
<WrapPanel x:Name="WpDocxToPdfPreviews" Orientation="Horizontal" HorizontalAlignment="Stretch" VerticalAlignment="Top" ItemWidth="160" ItemHeight="230"/>
</Grid>
</ScrollViewer>
</Border>
</Grid>
</TabItem>
<!-- 11. PDF to Word Converter -->
<TabItem Header="11. PDF to Word" Style="{StaticResource LeftTabItem}">
<Grid Margin="0" HorizontalAlignment="Stretch" VerticalAlignment="Stretch">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="300" />
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<Border Grid.Column="0" HorizontalAlignment="Stretch" Margin="0" Background="{DynamicResource CardBgBrush}" BorderThickness="1" BorderBrush="{DynamicResource BorderBrush}" CornerRadius="8" Padding="15">
<StackPanel>
<TextBlock Text="PDF to Word (.docx)" Foreground="{DynamicResource TextBrush}" FontSize="14" FontWeight="Bold" Margin="0,0,0,10"/>
<TextBlock Text="Select PDF Document" Foreground="{DynamicResource MutedTextBrush}" FontSize="11" Margin="0,0,0,5"/>
<Grid Margin="0,0,0,25">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="5"/>
<ColumnDefinition Width="Auto"/>
</Grid.ColumnDefinitions>
<TextBox x:Name="TxtWordPdfPath" Style="{StaticResource ModernTextBox}" IsReadOnly="True" VerticalContentAlignment="Center" FontSize="11"/>
<Button Grid.Column="2" Content="Browse" Click="BtnWordPdfBrowse_Click" Style="{StaticResource ModernButton}" Padding="8,4"/>
</Grid>
<Button Content="Convert & Save Word Doc" Click="BtnPdfToWordApply_Click" Style="{StaticResource SuccessButton}" HorizontalAlignment="Stretch"/>
</StackPanel>
</Border>
<Border Grid.Column="1" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Background="{DynamicResource CardBgBrush}" BorderThickness="1" BorderBrush="{DynamicResource BorderBrush}" CornerRadius="8">
<ScrollViewer VerticalScrollBarVisibility="Auto" HorizontalScrollBarVisibility="Disabled" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" HorizontalContentAlignment="Stretch" VerticalContentAlignment="Stretch" Width="Auto" Height="Auto">
<Grid HorizontalAlignment="Stretch" VerticalAlignment="Stretch">
<!-- Empty State Placeholder -->
<StackPanel x:Name="WpPdfToWordPreviewsPlaceholder" HorizontalAlignment="Center" VerticalAlignment="Center" Margin="20">
<TextBlock Text="📁" FontSize="36" Foreground="{DynamicResource AccentBrush}" HorizontalAlignment="Center" Margin="0,0,0,10"/>
<TextBlock Text="No Document Loaded" FontSize="14" FontWeight="Bold" Foreground="{DynamicResource TextBrush}" HorizontalAlignment="Center" Margin="0,0,0,5"/>
<TextBlock Text="Drag & Drop PDF files or use the left panel to begin." FontSize="11" Foreground="{DynamicResource MutedTextBrush}" HorizontalAlignment="Center" TextAlignment="Center" TextWrapping="Wrap"/>
</StackPanel>
<WrapPanel x:Name="WpPdfToWordPreviews" Orientation="Horizontal" HorizontalAlignment="Stretch" VerticalAlignment="Top" ItemWidth="160" ItemHeight="230"/>
</Grid>
</ScrollViewer>
</Border>
</Grid>
</TabItem>
<!-- 12. Rotate Pages with Preview -->
<TabItem Header="12. Rotate Pages" Style="{StaticResource LeftTabItem}">
<Grid Margin="0" HorizontalAlignment="Stretch" VerticalAlignment="Stretch">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="300" />
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<Border Grid.Column="0" HorizontalAlignment="Stretch" Margin="0" Background="{DynamicResource CardBgBrush}" BorderThickness="1" BorderBrush="{DynamicResource BorderBrush}" CornerRadius="8" Padding="15">
<StackPanel>
<TextBlock Text="Rotate Pages Visually" Foreground="{DynamicResource TextBrush}" FontSize="14" FontWeight="Bold" Margin="0,0,0,10"/>
<Button x:Name="BtnRotateBrowse" Content="Select PDF File" Click="BtnRotateBrowse_Click" Style="{StaticResource AccentButton}" Margin="0,5,0,5"/>
<TextBlock x:Name="LblRotateFile" Text="No file selected" Foreground="{DynamicResource MutedTextBrush}" FontSize="11" TextTrimming="CharacterEllipsis"/>
<Separator Margin="0,15" Background="{DynamicResource BorderBrush}"/>
<Button x:Name="BtnRotateSaveAll" Content="Save Rotated PDF" Click="BtnRotateSaveAll_Click" Style="{StaticResource SuccessButton}" Margin="0,5,0,5"/>
</StackPanel>
</Border>
<Border Grid.Column="1" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Background="{DynamicResource CardBgBrush}" BorderThickness="1" BorderBrush="{DynamicResource BorderBrush}" CornerRadius="8">
<ScrollViewer VerticalScrollBarVisibility="Auto" HorizontalScrollBarVisibility="Disabled" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" HorizontalContentAlignment="Stretch" VerticalContentAlignment="Stretch" Width="Auto" Height="Auto">
<Grid HorizontalAlignment="Stretch" VerticalAlignment="Stretch">
<!-- Empty State Placeholder -->
<StackPanel x:Name="WpRotatePreviewsPlaceholder" HorizontalAlignment="Center" VerticalAlignment="Center" Margin="20">
<TextBlock Text="📁" FontSize="36" Foreground="{DynamicResource AccentBrush}" HorizontalAlignment="Center" Margin="0,0,0,10"/>
<TextBlock Text="No Document Loaded" FontSize="14" FontWeight="Bold" Foreground="{DynamicResource TextBrush}" HorizontalAlignment="Center" Margin="0,0,0,5"/>
<TextBlock Text="Drag & Drop PDF files or use the left panel to begin." FontSize="11" Foreground="{DynamicResource MutedTextBrush}" HorizontalAlignment="Center" TextAlignment="Center" TextWrapping="Wrap"/>
</StackPanel>
<WrapPanel x:Name="WpRotatePreviews" Orientation="Horizontal" HorizontalAlignment="Stretch" VerticalAlignment="Top" ItemWidth="160" ItemHeight="230"/>
</Grid>
</ScrollViewer>
</Border>
</Grid>
</TabItem>
</TabControl>
<!-- Bottom Back to Home Button -->
<Border Grid.Row="2" Margin="0,15,0,0" Padding="0">
<Button Content="Back to Home" Click="BtnNavHome_Click" Style="{StaticResource MutedButton}" HorizontalAlignment="Left"/>
</Border>
</Grid>
<!-- 4. Advanced Compressor Panel (Dual Mode Image & PDF) -->
<Grid x:Name="PanelCompress" Visibility="Collapsed">
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="*" />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<StackPanel Grid.Row="0" Margin="0,0,0,15">
<TextBlock Text="Advanced Dual Media Compression" Foreground="{DynamicResource MutedTextBrush}" FontSize="13" FontWeight="SemiBold"/>
<TextBlock Text="Universal Compressor" Foreground="{DynamicResource TextBrush}" FontSize="24" FontWeight="Bold"/>
</StackPanel>
<!-- Tabs to switch between Image and PDF compressor -->
<TabControl Grid.Row="1" Style="{StaticResource ModernTabControl}" SelectionChanged="CompressorTabControl_SelectionChanged">
<!-- Image Compressor Mode -->
<TabItem Header="[Image Compressor]" Style="{StaticResource UnderlineTabItem}">
<Grid Margin="0,15,0,0">
<Grid.RowDefinitions>
<RowDefinition Height="*"/>
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>