File tree Expand file tree Collapse file tree 1 file changed +7
-6
lines changed
Expand file tree Collapse file tree 1 file changed +7
-6
lines changed Original file line number Diff line number Diff line change 66<div id =" target" style =" width :800px ;height :500px " >
77 <SfButton @onclick =" OnClick" >Open PDF Viewer</SfButton >
88 <SfDialog @ref =" @Dialog" Target =" #target" Width =" 1060px" Visible =" false" IsModal =" true" Header = " @Header" ShowCloseIcon =" true" >
9- <DialogEvents OnOpen =" OnOpen" ></DialogEvents >
10- <SfPdfViewer2 @ref =" Viewer" />
9+ <SfPdfViewer2 @ref =" Viewer" >
10+ <PdfViewerEvents Created =" created" ></PdfViewerEvents >
11+ </SfPdfViewer2 >
1112 </SfDialog >
1213</div >
1314
1415@code {
1516 public SfPdfViewer2 Viewer { get ; set ; }
1617 SfDialog Dialog ;
1718
18- public void OnClick (MouseEventArgs args )
19+ public async void OnClick (MouseEventArgs args )
1920 {
20- this .Dialog .ShowAsync ();
21+ await this .Dialog .ShowAsync ();
2122 }
2223
23- public void OnOpen ( BeforeOpenEventArgs args )
24+ private async void created ( )
2425 {
25- Viewer .LoadAsync (DocumentPath , null );
26+ await Viewer .LoadAsync (DocumentPath , null );
2627 }
2728 public string DocumentPath { get ; set ; } = " wwwroot/data/PDF_Succinctly.pdf" ;
2829 public string Header { get ; set ; } = " PDF Viewer" ;
You can’t perform that action at this time.
0 commit comments