Переглянути джерело

文件列表 - 最近列表为空时,点击超链接加载文档

chenrongqian 2 роки тому
батько
коміт
469f9fd47a

+ 17 - 1
PDF Office/App.xaml

@@ -12,7 +12,23 @@
                 <ResourceDictionary Source="pack://application:,,,/PDF Office;component/Styles/ListBoxStyle.xaml" />
             </ResourceDictionary.MergedDictionaries>
 
-
+            <Style TargetType="{x:Type Hyperlink}">
+                <Setter Property="Foreground" Value="#477EDE"></Setter>
+                <Setter Property="TextBlock.TextDecorations" Value="{x:Null}"></Setter>
+                <Style.Triggers>
+                    <Trigger Property="IsMouseOver" Value="True">
+                        <Setter Property="Foreground" Value="#6B97E4"></Setter>
+                        <!--在鼠标悬停显示下划线-->
+                        <Setter Property="TextBlock.TextDecorations">
+                            <Setter.Value>
+                                <TextDecorationCollection>
+                                    <TextDecoration Location="Underline"/>
+                                </TextDecorationCollection>
+                            </Setter.Value>
+                        </Setter>
+                    </Trigger>
+                </Style.Triggers>
+            </Style>
         </ResourceDictionary>
     </Application.Resources>
 </prism:PrismApplication>

+ 2 - 2
PDF Office/Views/HomePanel/RecentFiles/RecentFilesView.xaml

@@ -204,9 +204,9 @@
                 <StackPanel Orientation="Horizontal" Margin="0,12,0,0">
                     <TextBlock x:Name="clickFileText" Text="Drop documents here or click the '" Foreground="#FF999999" VerticalAlignment="Center" FontSize="14"/>
                     <TextBlock  Margin="2,0,2,0" VerticalAlignment="Center" FontSize="15">
-                        <!--<Hyperlink Style="{StaticResource hyberlinkstyle}"  Click="OpenFiles_Click">
+                        <Hyperlink   Click="OpenFiles_Click">
                             <TextBlock x:Name="OpenFilesLinkText" Text="Open Files"/>
-                        </Hyperlink>-->
+                        </Hyperlink>
                     </TextBlock>
                     <TextBlock x:Name="dropFileText" Text="' button in the Sidebar" Foreground="#FF999999" VerticalAlignment="Center" FontSize="14"/>
                 </StackPanel>

+ 11 - 1
PDF Office/Views/HomePanel/RecentFiles/RecentFilesView.xaml.cs

@@ -33,6 +33,7 @@ namespace PDF_Office.Views.HomePanel.RecentFiles
             RecentFilesList.ItemsSource = RecentFilesGroup;
             GridRecentFilesList.ItemsSource = RecentFilesGroup;
             RecentFilesList.SelectedItem = null;
+            ShowListViewContentUI();
         }
 
         private void SetLangText()
@@ -326,7 +327,7 @@ namespace PDF_Office.Views.HomePanel.RecentFiles
                     //MessageBoxEx.Show(App.MainPageLoader.GetString("Main_TheFileNotExistWarning"));
                     SettingHelper.RemoveRecentOpenFile(fileInfo.FilePath);
                     RecentFilesGroup.Remove(fileInfo);
-                    ShowListViewContentUI();
+                    ShowListViewContentUI(); 
                 }
 
             }
@@ -336,6 +337,15 @@ namespace PDF_Office.Views.HomePanel.RecentFiles
         private void OpenFiles_Click(object sender, RoutedEventArgs e)
         {
 
+            var dlg = new OpenFileDialog();
+            dlg.Multiselect = true;
+            dlg.Filter = Properties.Resources.OpenDialogFilter;
+
+            if (dlg.ShowDialog() == true)
+            {
+                MainWindow parentWindow = Window.GetWindow(this) as MainWindow;
+                parentWindow.LoadPdfViewer(dlg.FileNames);
+            }
         }
         #endregion