Przeglądaj źródła

ComPDFKit.Demo(win) - 对比设置弹窗补充, 内容对比结果交互补充

weixiangjie 6 dni temu
rodzic
commit
94082a8f80

+ 76 - 7
Demo/Examples/Compdfkit.Controls/Comparison/CompareContentResultControl.xaml

@@ -6,8 +6,7 @@
     xmlns:local="clr-namespace:ComPDFKit.Controls.Comparison"
     xmlns:common="clr-namespace:ComPDFKit.Controls.Common"
     xmlns:controls="clr-namespace:WpfToolkit.Controls;assembly=VirtualizingWrapPanel"
-    xmlns:pdfControl="clr-namespace:ComPDFKit.Controls.PDFControl"
-    mc:Ignorable="d" d:DesignHeight="450" d:DesignWidth="1200">
+    xmlns:pdfControl="clr-namespace:ComPDFKit.Controls.PDFControl" mc:Ignorable="d" d:DesignHeight="450" d:DesignWidth="1200">
     <UserControl.Resources>
         <ResourceDictionary>
             <ResourceDictionary.MergedDictionaries>
@@ -18,6 +17,7 @@
             </ResourceDictionary.MergedDictionaries>
             <common:CommonResourceConverter x:Key="CommonResourceConverter"></common:CommonResourceConverter>
             <common:BoolToVisibleConverter x:Key="BoolToVisibleConverter"></common:BoolToVisibleConverter>
+            <common:TextLengthToBoolConverter x:Key="TextLengthToBoolConverter"/>
             <local:GroupHeaderConverter x:Key="GroupHeaderConverter" />
         </ResourceDictionary>
     </UserControl.Resources>
@@ -64,7 +64,7 @@
                 </StackPanel>
                 <StackPanel HorizontalAlignment="Right" Orientation="Horizontal" Margin="0,5,12,5">
                     <CheckBox Content="Scroll Sync" x:Name="SynchronizedScrollingCKBox" BorderThickness="2" BorderBrush="Black" VerticalContentAlignment="Center" FontSize="14" FontFamily="Segoe UI"></CheckBox>
-                    <Button Content="Save" Width="112" Height="32" Margin="19,0,8,0"></Button>
+                    <Button Content="Save" Width="112" Height="32" Margin="19,0,8,0" Click="SaveBtn_Click"></Button>
                     <Button Content="Exit" Width="112" Height="32" Click="CloseBtn_Click"></Button>
                 </StackPanel>
             </DockPanel>
@@ -199,13 +199,12 @@
                         <RowDefinition Height="*"></RowDefinition>
                     </Grid.RowDefinitions>
                     <Grid Grid.Row="0">
-                        <pdfControl:CPDFScalingControl x:Name="CPDFSaclingControl" Margin="12,0,0,0" HorizontalAlignment="Left"  VerticalAlignment="Center"></pdfControl:CPDFScalingControl>
+                        <pdfControl:CPDFScalingControl x:Name="CPDFSaclingControl" Margin="12,0,0,0" HorizontalAlignment="Left" VerticalAlignment="Center"></pdfControl:CPDFScalingControl>
                         <TextBlock Text="oldFile.pdf" HorizontalAlignment="Center" VerticalAlignment="Center"></TextBlock>
                     </Grid>
                     <pdfControl:PDFViewControl Grid.Row="1" x:Name="LeftViewer"/>
                 </Grid>
-                <GridSplitter Grid.Column="1" HorizontalAlignment="Stretch"
-                              VerticalAlignment="Stretch" ShowsPreview="True" Background="#ECECEC" Cursor="SizeWE" BorderBrush="#DCDCDC" BorderThickness="0.6">
+                <GridSplitter Grid.Column="1" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" ShowsPreview="True" Background="#ECECEC" Cursor="SizeWE" BorderBrush="#DCDCDC" BorderThickness="0.6">
                 </GridSplitter>
                 <Ellipse Grid.Column="1" Width="6" Height="6" Fill="#DCDCDC" Panel.ZIndex="1" HorizontalAlignment="Center" VerticalAlignment="Center" IsHitTestVisible="False"></Ellipse>
                 <Grid Grid.Column="2">
@@ -214,12 +213,82 @@
                         <RowDefinition Height="*"></RowDefinition>
                     </Grid.RowDefinitions>
                     <Grid Grid.Row="0">
-                        <pdfControl:CPDFScalingControl x:Name="CPDFSaclingControl1" Margin="12,0,0,0" HorizontalAlignment="Left"  VerticalAlignment="Center"></pdfControl:CPDFScalingControl>
+                        <pdfControl:CPDFScalingControl x:Name="CPDFSaclingControl1" Margin="12,0,0,0" HorizontalAlignment="Left" VerticalAlignment="Center"></pdfControl:CPDFScalingControl>
                         <TextBlock Text="newFile.pdf" HorizontalAlignment="Center" VerticalAlignment="Center"></TextBlock>
                     </Grid>
                     <pdfControl:PDFViewControl Grid.Row="1" x:Name="RightViewer"/>
                 </Grid>
             </Grid>
         </Grid>
+        <Grid Name="SavePopGrid" Background="#20000000" Visibility="Collapsed">
+            <Border VerticalAlignment="Center" HorizontalAlignment="Center" CornerRadius="5" Width="432" Height="303" BorderThickness="0.5" BorderBrush="Black" Background="White">
+                <Border.Effect>
+                    <DropShadowEffect ShadowDepth="4" BlurRadius="10" Color="Black" Opacity="0.4"/>
+                </Border.Effect>
+                <Grid Margin="20,5,20,0">
+                    <Grid.RowDefinitions>
+                        <RowDefinition Height="44"></RowDefinition>
+                        <RowDefinition Height="137"></RowDefinition>
+                        <RowDefinition Height="48"></RowDefinition>
+                        <RowDefinition Height="64"></RowDefinition>
+                    </Grid.RowDefinitions>
+                    <Grid>
+
+                        <TextBlock Margin="0,10,0,0" FontSize="14" FontFamily="Segoe UI" Height="20" Name="SaveText">Save</TextBlock>
+                        <Button Click="CancelBtn_Click" HorizontalAlignment="Right" Background="White" Width="16" Height="16" BorderThickness="0">
+                            <Path Fill="Black">
+                                <Path.Data>
+                                    M5.69231 5L9.5 1.19231L8.80769 0.5L5 4.30769L1.19231 0.5L0.5 1.19231L4.30769 5L0.5 8.80769L1.19231 9.5L5 5.69231L8.80769 9.5L9.5 8.80769L5.69231 5Z
+                                </Path.Data>
+                            </Path>
+                        </Button>
+                    </Grid>
+                    <GroupBox Grid.Row="1" Header="Save as" Name="SaceAsGroup">
+                        <StackPanel Margin="8,24,0,0">
+                            <StackPanel Margin="0,0,0,0" Orientation="Horizontal">
+                                <RadioButton GroupName="SavePopGroup" Name="OldCheckBox" VerticalAlignment="Center" IsChecked="True" Content="Old"></RadioButton>
+                            </StackPanel>
+                            <StackPanel Margin="0,16,0,0" Orientation="Horizontal">
+                                <RadioButton GroupName="SavePopGroup" Name="NewCheckBox" VerticalAlignment="Center" Content="New"></RadioButton>
+                            </StackPanel>
+                            <StackPanel Margin="0,16,0,0" Orientation="Horizontal">
+                                <RadioButton GroupName="SavePopGroup" Name="CombineCheckBox" VerticalAlignment="Center" Content="Combine"></RadioButton>
+                            </StackPanel>
+                        </StackPanel>
+                    </GroupBox>
+                    <StackPanel Grid.Row="2" Orientation="Horizontal" Margin="5,16,0,0">
+                        <TextBlock x:Name="TxbFilePath" VerticalAlignment="Center" Text="File Location" MaxWidth="75" Height="20" TextTrimming="WordEllipsis" ToolTip="{Binding ElementName=TxbFilePath,Path=Text}"/>
+                        <TextBox x:Name="CmbFilePath" Width="193" Height="32" Margin="10,0" IsReadOnly="True" Padding="8,5,0,0"/>
+                        <Button Width="100" Name="BrowseFilePath" Content="Browse..." Height="32" HorizontalAlignment="Right" BorderThickness="1" Click="BrowseFilePathButton_Click"></Button>
+                    </StackPanel>
+                    <StackPanel Orientation="Horizontal" Grid.Row="3" HorizontalAlignment="Right" Margin="0,20,2,0">
+                        <Button Width="112" Height="32" Padding="0,2,0,2" Background="#E1E1E1" BorderBrush="#FA477EDE" BorderThickness="1" Click="ConfirmSaveBtn_Click" IsEnabled="{Binding ElementName=CmbFilePath,Path=Text,Converter={StaticResource TextLengthToBoolConverter}}" x:Name="ConfirmSaveBtn">Save</Button>
+                        <Button Width="112" Height="32" Padding="0,2,0,2" Margin="10,0,0,0" Background="#E1E1E1" BorderBrush="#33000000" BorderThickness="1" Click="CancelBtn_Click" Name="BtnCancel">Cancel</Button>
+
+                    </StackPanel>
+                </Grid>
+            </Border>
+        </Grid>
+        <Grid Name="CloseConfirmGrid" Background="#20000000" Visibility="Collapsed">
+            <Border VerticalAlignment="Center" HorizontalAlignment="Center" CornerRadius="5" Width="320" Height="168" BorderThickness="0.5" BorderBrush="Black" Background="#FCFDFF">
+                <Border.Effect>
+                    <DropShadowEffect ShadowDepth="4" BlurRadius="10" Color="Black" Opacity="0.4"/>
+                </Border.Effect>
+                <Grid>
+                    <Grid.RowDefinitions>
+                        <RowDefinition Height="auto"></RowDefinition>
+                        <RowDefinition Height="*"></RowDefinition>
+                        <RowDefinition Height="auto"></RowDefinition>
+                    </Grid.RowDefinitions>
+                    <TextBlock FontSize="14" FontWeight="Bold" Margin="24,16,24,0" HorizontalAlignment="Left" FontFamily="Segoe UI" TextWrapping="WrapWithOverflow">Attention</TextBlock>
+                    <TextBlock Grid.Row="1" FontSize="14" Margin="24,16,24,0" HorizontalAlignment="Left" FontFamily="Segoe UI" TextWrapping="WrapWithOverflow"
+                               Text="Please confirm that you have saved the comparison results file"></TextBlock>
+                    <StackPanel Grid.Row="2" Orientation="Horizontal" Margin="24,24,24,20">
+                        <Button Width="130" Padding="0,2,0,2"  Background="#E1E1E1" BorderBrush="#33000000" BorderThickness="1" Click="CancelCloseBtn_Click" Name="BtnCancle1">Cancel</Button>
+                        <Button Width="130" Padding="0,2,0,2" Margin="10,0,0,0" Height="32" Click="ConfirmExitBtn_Click" Foreground="White" Background="#1460F3" BorderThickness="1" Name="BtnSave2">Confirm</Button>
+                    </StackPanel>
+                </Grid>
+            </Border>
+        </Grid>
     </Grid>
 </UserControl>

+ 43 - 24
Demo/Examples/Compdfkit.Controls/Comparison/CompareContentResultControl.xaml.cs

@@ -315,10 +315,10 @@ namespace ComPDFKit.Controls.Comparison
             CombineDoc = combineDoc;
             OldDoc = oldDoc;
             NewDoc = newDoc;
-            LeftViewer.InitDocument(oldDoc.FilePath);
+            LeftViewer.InitDocument(oldDoc);
             LeftViewer.SetToolType(ComPDFKit.Tool.ToolType.Viewer);
             CPDFSaclingControl.InitWithPDFViewer(LeftViewer);
-            RightViewer.InitDocument(newDoc.FilePath);
+            RightViewer.InitDocument(newDoc);
             RightViewer.SetToolType(ComPDFKit.Tool.ToolType.Viewer);
             CPDFSaclingControl1.InitWithPDFViewer(RightViewer);
             OnLeftThumbnailGenerated -= _leftviewer_OnThumbnailGenerated;
@@ -641,21 +641,6 @@ namespace ComPDFKit.Controls.Comparison
             }
             return new SolidColorBrush(Colors.Red);
         }
-
-        private void SaveData()
-        {
-            // if (string.IsNullOrEmpty(CmbFilePath.Text))
-            // {
-            //     CmbFilePath.Text = Settings.Default.AppProperties.DefaultSaveFolder;
-            // }
-            // filePath = CmbFilePath.Text;
-            // IsOldSave = OldCheckBox.IsChecked == true;
-            // OldFileName = filePath + "\\old.pdf";
-            // IsNewSave = NewCheckBox.IsChecked == true;
-            // NewFileName = filePath + "\\new.pdf";
-            // IsCombineSave = CombineCheckBox.IsChecked == true;
-            // CombineFileName = filePath + "\\combine.pdf";
-        }
         
         private double CheckZoomLevel(double zoom, bool IsGrowth)
         {
@@ -770,11 +755,24 @@ namespace ComPDFKit.Controls.Comparison
         }
 
         private void SaveBtn_Click(object sender, RoutedEventArgs e)
+        {
+            SavePopGrid.Visibility = Visibility.Visible;
+        }
+
+        private void ConfirmSaveBtn_Click(object sender, RoutedEventArgs e)
         {
             string oldSaveName = string.Empty;
             string newSaveName = string.Empty;
             string combineSaveName = string.Empty;
-            SaveData();
+            
+            filePath = CmbFilePath.Text;
+            IsOldSave = OldCheckBox.IsChecked == true;
+            OldFileName = filePath + "\\old.pdf";
+            IsNewSave = NewCheckBox.IsChecked == true;
+            NewFileName = filePath + "\\new.pdf";
+            IsCombineSave = CombineCheckBox.IsChecked == true;
+            CombineFileName = filePath + "\\combine.pdf";
+            
             if (IsOldSave)
             {
                 oldSaveName = CommonHelper.GetFileNameAddSuffix(filePath, oldName + "_compare", ".pdf");
@@ -812,18 +810,13 @@ namespace ComPDFKit.Controls.Comparison
 
         private void CloseBtn_Click(object sender, RoutedEventArgs e)
         {
-            CloseLeave();
+            CloseConfirmGrid.Visibility = Visibility.Visible;
         }
         private void CloseLeave()
         {
             ExitCompareEvent?.Invoke(null,null);
         }
 
-        private void SaveFileCheckBox_Checked(object sender, RoutedEventArgs e)
-        {
-
-        }
-
         private void CompareBtn_Click(object sender, RoutedEventArgs e)
         {
             ThumbnailBtn.IsChecked = false;
@@ -1227,5 +1220,31 @@ namespace ComPDFKit.Controls.Comparison
         {
             
         }
+        
+        private void CancelBtn_Click(object sender, RoutedEventArgs e)
+        {
+            SavePopGrid.Visibility = Visibility.Collapsed;
+        }
+        
+        private void ConfirmExitBtn_Click(object sender, RoutedEventArgs e)
+        {
+            CloseConfirmGrid.Visibility = Visibility.Collapsed;
+            CloseLeave();
+        }
+        
+        private void BrowseFilePathButton_Click(object sender, RoutedEventArgs e)
+        {
+            CommonOpenFileDialog commonFileDialog = new CommonOpenFileDialog(/*App.MainPageLoader.GetString*/("Main_OpenFolderNoteWarning"));
+            commonFileDialog.IsFolderPicker = true;
+            if (commonFileDialog.ShowDialog() == CommonFileDialogResult.Ok)
+            {
+                CmbFilePath.Text = commonFileDialog.FileName;
+            }
+        }
+
+        private void CancelCloseBtn_Click(object sender, RoutedEventArgs e)
+        {
+            CloseConfirmGrid.Visibility = Visibility.Collapsed;
+        }
     }
 }

+ 44 - 0
Demo/Examples/Compdfkit.Controls/Comparison/ComparisonSettingDialog.xaml

@@ -228,5 +228,49 @@
                 <Button Width="112" Height="32" FontSize="14" FontFamily="Segoe UI" Click="CompareDocBtn_Click" Content="Compare" MinWidth="120" Background="#E1E1E1" BorderBrush="#FA477EDE" BorderThickness="1" Margin="10,0,18,0" Name="BtnCompare"></Button>
             </StackPanel>
         </Grid>
+        <Grid x:Name="SelectFileBorder" Background="#20000000" Visibility="Collapsed">
+            <Border VerticalAlignment="Center" HorizontalAlignment="Center" CornerRadius="5" Width="320" Height="168" BorderThickness="0.5" BorderBrush="Black" Background="#FCFDFF">
+                <Border.Effect>
+                    <DropShadowEffect ShadowDepth="4" BlurRadius="10" Color="Black" Opacity="0.4"/>
+                </Border.Effect>
+                <Grid>
+                    <Grid.RowDefinitions>
+                        <RowDefinition Height="auto"></RowDefinition>
+                        <RowDefinition Height="*"></RowDefinition>
+                        <RowDefinition Height="auto"></RowDefinition>
+                    </Grid.RowDefinitions>
+                    <TextBlock FontSize="14" FontWeight="Bold" Margin="24,16,24,0" HorizontalAlignment="Left" FontFamily="Segoe UI" TextWrapping="WrapWithOverflow">Select File</TextBlock>
+                    <TextBlock Grid.Row="1" FontSize="14" Margin="24,16,24,0" HorizontalAlignment="Left" FontFamily="Segoe UI" TextWrapping="WrapWithOverflow"
+                               Text="Please select 2 files to compare"></TextBlock>
+                    <StackPanel Grid.Row="2" Orientation="Horizontal" Margin="24,24,24,20">
+                        <Button Width="130" Padding="0,2,0,2"  Background="#E1E1E1" BorderBrush="#33000000" BorderThickness="1" Click="SelectFileCancel_OnClick">Cancel</Button>
+                        <Button Width="130" Padding="0,2,0,2" Margin="10,0,0,0" Height="32" Foreground="White" Background="#1460F3"
+                                BorderThickness="1" Click="SelectFileCancel_OnClick">OK</Button>
+                    </StackPanel>
+                </Grid>
+            </Border>
+        </Grid>
+        <Grid x:Name="PageRangeBorder" Background="#20000000" Visibility="Collapsed">
+            <Border VerticalAlignment="Center" HorizontalAlignment="Center" CornerRadius="5" Width="320" Height="168" BorderThickness="0.5" BorderBrush="Black" Background="#FCFDFF">
+                <Border.Effect>
+                    <DropShadowEffect ShadowDepth="4" BlurRadius="10" Color="Black" Opacity="0.4"/>
+                </Border.Effect>
+                <Grid>
+                    <Grid.RowDefinitions>
+                        <RowDefinition Height="auto"></RowDefinition>
+                        <RowDefinition Height="*"></RowDefinition>
+                        <RowDefinition Height="auto"></RowDefinition>
+                    </Grid.RowDefinitions>
+                    <TextBlock FontSize="14" FontWeight="Bold" Margin="24,16,24,0" HorizontalAlignment="Left" FontFamily="Segoe UI" TextWrapping="WrapWithOverflow">Invalid Page Range</TextBlock>
+                    <TextBlock Grid.Row="1" FontSize="14" Margin="24,16,24,0" HorizontalAlignment="Left" FontFamily="Segoe UI" TextWrapping="WrapWithOverflow"
+                               Text="The page range that you selected is invalid. Please select again."></TextBlock>
+                    <StackPanel Grid.Row="2" Orientation="Horizontal" Margin="24,24,24,20">
+                        <Button Width="130" Padding="0,2,0,2"  Background="#E1E1E1" BorderBrush="#33000000" BorderThickness="1" Click="PageRangeCancel_OnClick">Cancel</Button>
+                        <Button Width="130" Padding="0,2,0,2" Margin="10,0,0,0" Height="32" Foreground="White" Background="#1460F3"
+                                BorderThickness="1" Click="PageRangeCancel_OnClick">OK</Button>
+                    </StackPanel>
+                </Grid>
+            </Border>
+        </Grid>
     </Grid>
 </Window>

+ 36 - 6
Demo/Examples/Compdfkit.Controls/Comparison/ComparisonSettingDialog.xaml.cs

@@ -640,6 +640,12 @@ namespace ComPDFKit.Controls.Comparison
             InsertColorRect.Fill = new SolidColorBrush(InsertColor);
             DeleteColorRect.Fill = new SolidColorBrush(DeleteColor);
         }
+
+        private void ShowSelectFileBorder(bool isShow)
+        {
+            SelectFileBorder.Visibility = isShow ? Visibility.Visible : Visibility.Collapsed;
+        }
+            
         private void SaveCoverGrid()
         {
             if (ReplaceColorRect.Fill != null && ((SolidColorBrush)ReplaceColorRect.Fill).Color != ReplaceColor)
@@ -660,11 +666,16 @@ namespace ComPDFKit.Controls.Comparison
         {
             try
             {
+                if(OldFileComboBox.Text == "" || NewFileComboBox.Text == "")
+                {
+                    ShowSelectFileBorder(true);
+                    return;
+                }
                 if (NewDocument != null && OldDocument != null && NewDocument.IsLocked == false && OldDocument.IsLocked == false && viewCtrl != null)
                 {
                     if (Math.Min(OldRange.Count, NewRange.Count) == 0 || (CmbOldPageRange.SelectedIndex == "3" && CmbOldPageRange.Text == "") || (CmbNewPageRange.SelectedIndex == "3" && CmbNewPageRange.Text == ""))
                     {
-                        // MessageBoxEx.Show(App.MainPageLoader.GetString("Main_PageRangedWarning"));
+                        PageRangeBorder.Visibility = Visibility.Visible;
                         return;
                     }
 
@@ -1028,6 +1039,10 @@ namespace ComPDFKit.Controls.Comparison
             else
             {
                 CurrentOldPageIndex = value - 1;
+                if(CurrentOldPageIndex < 0 || CurrentOldPageIndex >= OldRange.Count)
+                {
+                    CurrentOldPageIndex = 0;
+                }
                 UpdateCover(OldDocument, OldImageControl, OldRange[CurrentOldPageIndex]);
             }
             CheckOldPageBtnState();
@@ -1358,7 +1373,8 @@ namespace ComPDFKit.Controls.Comparison
             colorDialog.FullOpen = true;
             if (colorDialog.ShowDialog() == System.Windows.Forms.DialogResult.OK)
             {
-                ReplaceColorRect.Fill = new SolidColorBrush(drawingColorToMedia(colorDialog.Color));
+                ReplaceColor = drawingColorToMedia(colorDialog.Color);
+                ReplaceColorRect.Fill = new SolidColorBrush(ReplaceColor);
             }
         }
 
@@ -1369,7 +1385,8 @@ namespace ComPDFKit.Controls.Comparison
             colorDialog.FullOpen = true;
             if (colorDialog.ShowDialog() == System.Windows.Forms.DialogResult.OK)
             {
-                InsertColorRect.Fill = new SolidColorBrush(drawingColorToMedia(colorDialog.Color));
+                InsertColor = drawingColorToMedia(colorDialog.Color);
+                InsertColorRect.Fill = new SolidColorBrush(InsertColor);
             }
         }
 
@@ -1380,7 +1397,8 @@ namespace ComPDFKit.Controls.Comparison
             colorDialog.FullOpen = true;
             if (colorDialog.ShowDialog() == System.Windows.Forms.DialogResult.OK)
             {
-                DeleteColorRect.Fill = new SolidColorBrush(drawingColorToMedia(colorDialog.Color));
+                DeleteColor = drawingColorToMedia(colorDialog.Color);
+                DeleteColorRect.Fill = new SolidColorBrush(DeleteColor);
             }
         }
 
@@ -1391,7 +1409,8 @@ namespace ComPDFKit.Controls.Comparison
             colorDialog.FullOpen = true;
             if (colorDialog.ShowDialog() == System.Windows.Forms.DialogResult.OK)
             {
-                OldColorRect.Fill = new SolidColorBrush(drawingColorToMedia(colorDialog.Color));
+                OldMarkColor = drawingColorToMedia(colorDialog.Color);
+                OldColorRect.Fill = new SolidColorBrush(OldMarkColor);
             }
         }
 
@@ -1402,7 +1421,8 @@ namespace ComPDFKit.Controls.Comparison
             colorDialog.FullOpen = true;
             if (colorDialog.ShowDialog() == System.Windows.Forms.DialogResult.OK)
             {
-                NewColorRect.Fill = new SolidColorBrush(drawingColorToMedia(colorDialog.Color));
+                NewMarkColor = drawingColorToMedia(colorDialog.Color);
+                NewColorRect.Fill = new SolidColorBrush(NewMarkColor);
             }
         }
 
@@ -1476,5 +1496,15 @@ namespace ComPDFKit.Controls.Comparison
                 }
             }
         }
+
+        private void SelectFileCancel_OnClick(object sender, RoutedEventArgs e)
+        {
+            ShowSelectFileBorder(false);
+        }
+
+        private void PageRangeCancel_OnClick(object sender, RoutedEventArgs e)
+        {
+            PageRangeBorder.Visibility = Visibility.Collapsed;
+        }
     }
 }

+ 18 - 0
Demo/Examples/Compdfkit.Controls/PDFView/PDFViewControl/PDFViewControl.xaml.cs

@@ -243,6 +243,24 @@ namespace ComPDFKit.Controls.PDFControl
                 splitHeightScale = HorizontalView.ActualHeight / ViewToolGrid.ActualHeight;
             }
         }
+        
+        public void InitDocument(CPDFDocument pdfDoc)
+        {
+            if (pdfDoc != null)
+            {
+                PDFViewTool.GetCPDFViewer().InitDoc(pdfDoc);
+
+                PDFViewTool.GetCPDFViewer().SetFitMode(FitMode.FitHeight);
+                PDFViewTool.GetCPDFViewer().SetViewMode(ViewMode.SingleContinuous);
+
+                PDFViewTool.SetIsMultiSelected(true);
+
+                splitViewerTool.GetCPDFViewer().InitDoc(pdfDoc);
+
+                splitViewerTool.GetCPDFViewer().SetFitMode(FitMode.FitHeight);
+                splitViewerTool.GetCPDFViewer().SetViewMode(ViewMode.SingleContinuous);
+            }
+        }
 
         public void InitDocument(string Path)
         {