@@ -108,7 +108,7 @@ In the MainPage constructor, set the [ZoomMode](https://help.syncfusion.com/cr/m
108108
109109 // Accessing the PDF document that is added as embedded resource as stream.
110110 Stream ? documentSource = typeof (App ).GetTypeInfo ().Assembly .GetManifestResourceStream (" MultiTabbedPDFViewer.Assets.PDF_Succinctly.pdf" );
111- Stream ? documentSource1 = typeof (App ).GetTypeInfo ().Assembly .GetManifestResourceStream (" MultiTabbedPDFViewer.Assets.form_document .pdf" );
111+ Stream ? documentSource1 = typeof (App ).GetTypeInfo ().Assembly .GetManifestResourceStream (" MultiTabbedPDFViewer.Assets.rotated_document .pdf" );
112112 Stream ? documentSource2 = typeof (App ).GetTypeInfo ().Assembly .GetManifestResourceStream (" MultiTabbedPDFViewer.Assets.Annotations.pdf" );
113113 // Add the PDF streams to the collection if they are successfully retrieved
114114 if (documentSource != null )
@@ -150,36 +150,33 @@ In the SfTabView `Loaded` event handler, evaluate the header text of each SfTabI
150150** C#:**
151151
152152``` csharp
153- async void SfTabView_Loaded (System .Object sender , System .EventArgs e )
153+ private void SfTabView_Loaded (System .Object sender , System .EventArgs e )
154+ {
155+ // Ensure the viewModel is not null before proceeding
156+ if (viewModel ? .PDFDocuments != null )
154157 {
155- // Ensure the viewModel is not null before proceeding
156- if (viewModel ? .PDFDocuments != null )
158+ // Check if the first tab's header matches "doc 1"
159+ if (tab1 .Header .Equals (" doc 1" ))
160+ {
161+ pdfViewer .DocumentSource = viewModel .PDFDocuments [0 ]; // Assign the stream to the "DocumentSource" property of the PdfViewer control
162+ tab1 .Content = pdfViewer ; // Set the content of tab1 to the pdfViewer.
163+ }
164+
165+ // Check if the second tab's header matches "doc 2"
166+ if (tab2 .Header .Equals (" doc 2" ))
157167 {
158- // Check if the first tab's header matches "doc 1"
159- if (tab1 .Header .Equals (" doc 1" ))
160- {
161- await Task .Delay (80 ); // Slight delay to ensure UI is ready
162- pdfViewer .DocumentSource = viewModel .PDFDocuments [0 ]; // Assign the stream to the "DocumentSource" property of the PdfViewer control
163- tab1 .Content = pdfViewer ; // Set the content of tab1 to the pdfViewer.
164- }
165-
166- // Check if the second tab's header matches "doc 2"
167- if (tab2 .Header .Equals (" doc 2" ))
168- {
169- await Task .Delay (80 ); // Slight delay to ensure UI is ready
170- pdfViewer1 .DocumentSource = viewModel .PDFDocuments [1 ]; // Assign the stream to the "DocumentSource" property of the PdfViewer control
171- tab2 .Content = pdfViewer1 ; // Set the content of tab1 to the pdfViewer1.
172- }
173-
174- // Check if the third tab's header matches "doc 3"
175- if (tab3 .Header .Equals (" doc 3" ))
176- {
177- await Task .Delay (80 ); // Slight delay to ensure UI is ready
178- pdfViewer2 .DocumentSource = viewModel .PDFDocuments [2 ]; // Assign the stream to the "DocumentSource" property of the PdfViewer control
179- tab3 .Content = pdfViewer2 ; // Set the content of tab1 to the pdfViewer1.
180- }
168+ pdfViewer1 .DocumentSource = viewModel .PDFDocuments [1 ]; // Assign the stream to the "DocumentSource" property of the PdfViewer control
169+ tab2 .Content = pdfViewer1 ; // Set the content of tab2 to the pdfViewer1.
170+ }
171+
172+ // Check if the third tab's header matches "doc 3"
173+ if (tab3 .Header .Equals (" doc 3" ))
174+ {
175+ pdfViewer2 .DocumentSource = viewModel .PDFDocuments [2 ]; // Assign the stream to the "DocumentSource" property of the PdfViewer control
176+ tab3 .Content = pdfViewer2 ; // Set the content of tab3 to the pdfViewer1.
181177 }
182178 }
179+ }
183180```
184181
185182### 6. Subscription of TabView Loaded event.
0 commit comments