|
4 | 4 | xmlns:pdfViewer="clr-namespace:Syncfusion.Maui.PdfViewer;assembly=Syncfusion.Maui.PdfViewer"
|
5 | 5 | x:Class="AutoSavePDFinAWS.MainPage">
|
6 | 6 |
|
7 |
| - <!-- Resource definitions for styling UI components --> |
| 7 | + <!-- UI resource definitions --> |
8 | 8 | <ContentPage.Resources>
|
9 | 9 | <ResourceDictionary>
|
10 | 10 |
|
11 |
| - <!-- Style for toolbar buttons with modern appearance and visual states --> |
| 11 | + <!-- Toolbar button style --> |
12 | 12 | <Style x:Key="ToolbarButtonStyle"
|
13 | 13 | TargetType="Button">
|
14 | 14 | <Setter Property="CornerRadius"
|
|
24 | 24 | <Setter Property="FontAttributes"
|
25 | 25 | Value="Bold" />
|
26 | 26 |
|
27 |
| - <!-- Visual state management for enabled/disabled states --> |
| 27 | + <!-- Visual states for button --> |
28 | 28 | <Setter Property="VisualStateManager.VisualStateGroups">
|
29 | 29 | <VisualStateGroupList>
|
30 | 30 | <VisualStateGroup Name="CommonStates">
|
|
47 | 47 | </ResourceDictionary>
|
48 | 48 | </ContentPage.Resources>
|
49 | 49 |
|
50 |
| - <!-- Main layout container with two rows: toolbar and PDF viewer --> |
| 50 | + <!-- Main layout grid --> |
51 | 51 | <Grid RowSpacing="0">
|
52 | 52 | <Grid.RowDefinitions>
|
53 | 53 | <RowDefinition Height="Auto" />
|
|
56 | 56 | <!-- PDF viewer row - fills remaining space -->
|
57 | 57 | </Grid.RowDefinitions>
|
58 | 58 |
|
59 |
| - <!-- Top toolbar containing file operations and status notifications --> |
| 59 | + <!-- Toolbar --> |
60 | 60 | <Border Grid.Row="0"
|
61 | 61 | BackgroundColor="#F3F4F6"
|
62 | 62 | Padding="12"
|
|
69 | 69 | <!-- Button area - auto-sized -->
|
70 | 70 | </Grid.ColumnDefinitions>
|
71 | 71 |
|
72 |
| - <!-- Status notification display showing current operation or file state --> |
| 72 | + <!-- Status notification label --> |
73 | 73 | <Label Grid.Column="0"
|
74 | 74 | x:Name="NotificationLabel"
|
75 | 75 | Text="{Binding NotificationText}"
|
76 | 76 | HorizontalOptions="Start"
|
77 | 77 | VerticalOptions="Center" />
|
78 | 78 |
|
79 |
| - <!-- Horizontal container for toolbar buttons and controls --> |
| 79 | + <!-- Toolbar controls --> |
80 | 80 | <HorizontalStackLayout Grid.Column="1">
|
81 | 81 |
|
82 |
| - <!-- Manual save button - enabled only when auto-save is disabled --> |
83 |
| - <!-- Uses InverseBooleanConverter to enable when IsAutoSaveEnabled is false --> |
| 82 | + <!-- Save button (manual) --> |
84 | 83 | <Button x:Name="SaveButton"
|
85 | 84 | FontSize="20"
|
86 | 85 | Text=""
|
|
91 | 90 | Command="{Binding SavePdfCommand}"
|
92 | 91 | IsEnabled="{Binding IsAutoSaveEnabled, Converter={StaticResource InverseBooleanConverter}}"/>
|
93 | 92 |
|
94 |
| - <!-- Auto-save toggle control with checkbox and label --> |
| 93 | + <!-- Auto-save toggle --> |
95 | 94 | <Border StrokeThickness="1"
|
96 | 95 | Padding="0,0,12,0"
|
97 | 96 | Margin="4,0"
|
98 | 97 | Stroke="LightGray"
|
99 | 98 | VerticalOptions="Center">
|
100 | 99 | <StackLayout Orientation="Horizontal" VerticalOptions="Center">
|
101 |
| - <!-- Checkbox bound to auto-save enabled property --> |
102 | 100 | <CheckBox IsChecked="{Binding IsAutoSaveEnabled}" VerticalOptions="Center" />
|
103 | 101 | <Label Text="Auto Save" VerticalOptions="Center" />
|
104 | 102 | </StackLayout>
|
|
108 | 106 | </Grid>
|
109 | 107 | </Border>
|
110 | 108 |
|
111 |
| - <!-- Syncfusion PDF Viewer control with event handlers for document editing --> |
112 |
| - <!-- Events are wired to track all types of PDF modifications for auto-save --> |
| 109 | + <!-- PDF Viewer with event handlers --> |
113 | 110 | <pdfViewer:SfPdfViewer Grid.Row="1"
|
114 | 111 | x:Name="PdfViewer"
|
115 | 112 | DocumentLoaded="PdfViewer_DocumentLoaded"
|
|
0 commit comments