Skip to content

Commit

Permalink
Merge pull request #80 from SyncfusionExamples/ES-920680-Popup
Browse files Browse the repository at this point in the history
920680: Made correction in the popup window sample
  • Loading branch information
KameshRajendran authored Nov 12, 2024
2 parents 7ecde05 + 5eff1c5 commit 258f81b
Showing 1 changed file with 7 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,23 +6,24 @@
<div id="target" style="width:800px;height:500px">
<SfButton @onclick="OnClick">Open PDF Viewer</SfButton>
<SfDialog @ref="@Dialog" Target="#target" Width="1060px" Visible="false" IsModal="true" Header= "@Header" ShowCloseIcon="true">
<DialogEvents OnOpen="OnOpen"></DialogEvents>
<SfPdfViewer2 @ref="Viewer" />
<SfPdfViewer2 @ref="Viewer">
<PdfViewerEvents Created="created"></PdfViewerEvents>
</SfPdfViewer2>
</SfDialog>
</div>

@code {
public SfPdfViewer2 Viewer { get; set; }
SfDialog Dialog;

public void OnClick(MouseEventArgs args)
public async void OnClick(MouseEventArgs args)
{
this.Dialog.ShowAsync();
await this.Dialog.ShowAsync();
}

public void OnOpen(BeforeOpenEventArgs args)
private async void created()
{
Viewer.LoadAsync(DocumentPath, null);
await Viewer.LoadAsync(DocumentPath, null);
}
public string DocumentPath { get; set; } = "wwwroot/data/PDF_Succinctly.pdf";
public string Header { get; set; } = "PDF Viewer";
Expand Down

0 comments on commit 258f81b

Please sign in to comment.