Skip to content

Commit 1d48c51

Browse files
committed
feedbacks addressed
1 parent ace4d8c commit 1d48c51

File tree

3 files changed

+11
-29
lines changed

3 files changed

+11
-29
lines changed

DisplayPDF_fundamental_syntax_errors/MainWindow.xaml

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
xmlns:local="clr-namespace:LoadFundamentalSyntaxErrorDocument"
77
xmlns:syncfusion="clr-namespace:Syncfusion.Windows.PdfViewer;assembly=Syncfusion.PdfViewer.WPF"
88
mc:Ignorable="d"
9-
Title="MainWindow" Height="450" Width="800">
9+
Title="MainWindow" WindowState="Maximized">
1010
<Window.DataContext>
1111
<local:MainWindowViewModel />
1212
</Window.DataContext>
@@ -15,18 +15,14 @@
1515
<RowDefinition Height="Auto" />
1616
<RowDefinition />
1717
</Grid.RowDefinitions>
18-
<Grid Grid.Row="0"
18+
<StackPanel Grid.Row="0" Orientation="Horizontal"
1919
Margin="12">
20-
<Grid.ColumnDefinitions>
21-
<ColumnDefinition Width="70*" />
22-
<ColumnDefinition Width="30*" />
23-
</Grid.ColumnDefinitions>
24-
<TextBlock Text="{Binding FilePath, TargetNullValue=No file selected, StringFormat={}File: {0}}" />
2520
<Button Content="Open"
26-
Command="{Binding OpenPDFFileCommand}"
27-
Grid.Column="1" />
28-
</Grid>
29-
<syncfusion:PdfDocumentView Grid.Row="1"
21+
Command="{Binding OpenPDFFileCommand}"
22+
Width="50"
23+
Height="30"/>
24+
</StackPanel>
25+
<syncfusion:PdfViewerControl Grid.Row="1"
3026
Margin="12"
3127
ZoomMode="FitPage"
3228
ItemSource="{Binding PdfDocument, UpdateSourceTrigger=PropertyChanged}" />

DisplayPDF_fundamental_syntax_errors/MainWindow.xaml.cs

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,4 @@
1-
using System;
2-
using System.Collections.Generic;
3-
using System.Linq;
4-
using System.Text;
5-
using System.Threading.Tasks;
6-
using System.Windows;
7-
using System.Windows.Controls;
8-
using System.Windows.Data;
9-
using System.Windows.Documents;
10-
using System.Windows.Input;
11-
using System.Windows.Media;
12-
using System.Windows.Media.Imaging;
13-
using System.Windows.Navigation;
14-
using System.Windows.Shapes;
1+
using System.Windows;
152

163
namespace LoadFundamentalSyntaxErrorDocument
174
{

DisplayPDF_fundamental_syntax_errors/MainWindowViewModel.cs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,8 @@
1-
using System;
2-
using CommunityToolkit.Mvvm.ComponentModel;
1+
using CommunityToolkit.Mvvm.ComponentModel;
32
using CommunityToolkit.Mvvm.Input;
43
using Microsoft.Win32;
54
using Syncfusion.Pdf.Parsing;
65
using System.IO;
7-
using System.Xml.Linq;
86

97
namespace LoadFundamentalSyntaxErrorDocument
108
{
@@ -33,7 +31,8 @@ private void OpenPDFFile()
3331
{
3432
var dialog = new OpenFileDialog
3533
{
36-
Filter = "PDF files (*.pdf)|*.pdf"
34+
Filter = "PDF files (*.pdf)|*.pdf",
35+
InitialDirectory = Environment.GetFolderPath(Environment.SpecialFolder.Desktop),
3736
};
3837
if (dialog.ShowDialog() == true)
3938
{

0 commit comments

Comments
 (0)