Skip to content

Commit 3a6e934

Browse files
Feedback addressed
1 parent a2be368 commit 3a6e934

File tree

2 files changed

+4
-14
lines changed

2 files changed

+4
-14
lines changed

DocumentViewerDemo/MainPage.xaml.cs

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -24,31 +24,28 @@ public MainPage()
2424
pdfViewer5.ZoomMode = ZoomMode.FitToWidth;
2525
}
2626

27-
async void SfTabView_Loaded(System.Object sender, System.EventArgs e)
27+
private void SfTabView_Loaded(System.Object sender, System.EventArgs e)
2828
{
2929
// Ensure the viewModel is not null before proceeding
3030
if (viewModel?.PDFDocuments != null)
3131
{
3232
// Check if the first tab's header matches "PDF_Succinctly.pdf"
3333
if (tab1.Header.Equals("PDF_Succinctly.pdf"))
3434
{
35-
await Task.Delay(80); // Slight delay to ensure UI is ready
3635
pdfViewer.DocumentSource = viewModel.PDFDocuments[0]; // Assign the stream to the "DocumentSource" property of the PdfViewer control
3736
tab1.Content = pdfViewer; // Set the content of tab1 to the pdfViewer.
3837
}
3938

4039
// Check if the second tab's header matches "Input.docx"
4140
if (tab2.Header.Equals("Input.docx"))
4241
{
43-
await Task.Delay(80); // Slight delay to ensure UI is ready
4442
pdfViewer1.DocumentSource = viewModel.ConvertDocxToPdf(viewModel.PDFDocuments[1]); // Assign the stream to the "DocumentSource" property of the PdfViewer control
4543
tab2.Content = pdfViewer1; // Set the content of tab1 to the pdfViewer1.
4644
}
4745

4846
// Check if the third tab's header matches "Autumn Leaves.jpg"
4947
if (tab3.Header.Equals("Autumn Leaves.jpg"))
5048
{
51-
await Task.Delay(80); // Slight delay to ensure UI is ready
5249
pdfViewer2.DocumentSource = viewModel.ConvertImageToPdf(viewModel.PDFDocuments[2]); // Assign the stream to the "DocumentSource" property of the PdfViewer control
5350
tab3.Content = pdfViewer2; // Set the content of tab1 to the pdfViewer1.
5451
}
@@ -57,7 +54,6 @@ async void SfTabView_Loaded(System.Object sender, System.EventArgs e)
5754
// Check if the fourth tab's header matches "InputTemplate.xlsx"
5855
if (tab4.Header.Equals("InputTemplate.xlsx"))
5956
{
60-
await Task.Delay(80); // Slight delay to ensure UI is ready
6157
pdfViewer3.DocumentSource = viewModel.ConvertXlsxToPdf(viewModel.PDFDocuments[3]); // Assign the stream to the "DocumentSource" property of the PdfViewer control
6258
tab4.Content = pdfViewer3; // Set the content of tab1 to the pdfViewer1.
6359
}
@@ -66,15 +62,13 @@ async void SfTabView_Loaded(System.Object sender, System.EventArgs e)
6662
// Check if the fifth tab's header matches "Input.xps"
6763
if (tab5.Header.Equals("Input.xps"))
6864
{
69-
await Task.Delay(80); // Slight delay to ensure UI is ready
7065
pdfViewer4.DocumentSource = viewModel.ConvertXpsToPdf(viewModel.PDFDocuments[4]); // Assign the stream to the "DocumentSource" property of the PdfViewer control
7166
tab5.Content = pdfViewer4; // Set the content of tab1 to the pdfViewer1.
7267
}
7368

7469
// Check if the sixth tab's header matches "Template.pptx"
7570
if (tab6.Header.Equals("Template.pptx"))
7671
{
77-
await Task.Delay(80); // Slight delay to ensure UI is ready
7872
pdfViewer5.DocumentSource = viewModel.ConvertPptToPdf(viewModel.PDFDocuments[5]); // Assign the stream to the "DocumentSource" property of the PdfViewer control
7973
tab6.Content = pdfViewer5; // Set the content of tab1 to the pdfViewer1.
8074
}

DocumentViewerDemo/README.md

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ This project demonstrates how to open and view multiple document formats
77
3. [Syncfusion.Maui.TabView](https://www.nuget.org/packages/Syncfusion.Maui.TabView) package.
88
4. [Syncfusion.DocIORenderer.NET](https://www.nuget.org/packages/Syncfusion.DocIORenderer.NET) package to convert Word document to PDF.
99
5. [Syncfusion.Pdf.Imaging.NET](https://www.nuget.org/packages/Syncfusion.Pdf.Imaging.NET) package used to draw the image files to PDF.
10-
6. [Syncfusion.Presentation.NET](https://www.nuget.org/packages/Syncfusion.Presentation.NET) package used to read write and converting the PowerPoint presentation programmatically.
10+
6. [Syncfusion.Presentation.NET](https://www.nuget.org/packages/Syncfusion.Presentation.NET) package used to read, write and converting the PowerPoint presentation programmatically.
1111
7. [Syncfusion.PresentationRenderer.NET](https://www.nuget.org/packages/Syncfusion.PresentationRenderer.NET) package to preserve the original appearance of the PowerPoint presentation in the converted PDF document.
1212
8. [Syncfusion.XlsIORenderer.NET](https://www.nuget.org/packages/Syncfusion.XlsIORenderer.NET) package to convert the Excel document to PDF document.
1313
9. [Syncfusion.XpsToPdfConverter.NET](https://www.nuget.org/packages/Syncfusion.XpsToPdfConverter.NET) package used to convert.xps format file to PDF document file.
@@ -54,9 +54,5 @@ Assign the saved PDF stream to the [DocumentSource](https://help.syncfusion.com/
5454
## Run the App
5555

5656
1. Build and run the application on all platforms.
57-
1. Switch to all tabs and check whether all pdf is loading.
58-
1. Ensure all behaviors of PdfViewer in all PdfViewer tabs.
59-
60-
61-
62-
57+
2. Switch to all tabs and check whether all pdf is loading.
58+
3. Ensure all behaviors of PdfViewer in all PdfViewer tabs.

0 commit comments

Comments
 (0)