From 2d1c9fe29218130781a450883fd18223269d1138 Mon Sep 17 00:00:00 2001 From: Scott Kuhl Date: Fri, 13 Sep 2024 15:08:32 -0500 Subject: [PATCH 1/2] Update toolbar-customization.md The use of __builder is from an outdated version of Blazor. Blazor now uses templated delegates. --- blazor/pdfviewer-2/toolbar-customization.md | 82 +++++++++++---------- 1 file changed, 42 insertions(+), 40 deletions(-) diff --git a/blazor/pdfviewer-2/toolbar-customization.md b/blazor/pdfviewer-2/toolbar-customization.md index a6ee87c5cd..374c4753b0 100644 --- a/blazor/pdfviewer-2/toolbar-customization.md +++ b/blazor/pdfviewer-2/toolbar-customization.md @@ -253,45 +253,47 @@ To customize the Primary Toolbar in the PDF Viewer, you can achieve this by sett // Get the renderfragment element for the custom toolbaritems in the primary toolbar private static RenderFragment GetTemplate(string name) { - return __builder => - { - if (name == "PreviousPage") - { - - - } - else if(name == "NextPage") - { - - - } - else if(name == "Save") - { - - - } - else if(name == "Download") - { - - - } - }; + if (name == "PreviousPage") + { + return @ + ; + } + + if (name == "NextPage") + { + return @ + ; + } + + if (name == "Save") + { + return @ + ; + } + + if (name == "Download") + { + return @ + ; + } + + return _ => { }; } // Click for the custom toolbaritems in the primary toolbar @@ -438,4 +440,4 @@ You can customize the appearance of the toolbar icons. The below code illustrate [View sample in GitHub](https://github.com/SyncfusionExamples/blazor-pdf-viewer-examples/tree/master/Toolbar/Custom%20Toolbar/Primary%20Custom%20Toolbar%20-%20SfPdfViewer/Icon-Style-Change). -N> This is applicable only for custom toolbar. \ No newline at end of file +N> This is applicable only for custom toolbar. From dc46dd4c5d8eac2a8ef4a074d81e62ee4d1f251f Mon Sep 17 00:00:00 2001 From: Scott Kuhl Date: Fri, 13 Sep 2024 15:19:14 -0500 Subject: [PATCH 2/2] Update toolbar-customization.md Fixed non-nullable fields. --- blazor/pdfviewer-2/toolbar-customization.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/blazor/pdfviewer-2/toolbar-customization.md b/blazor/pdfviewer-2/toolbar-customization.md index 374c4753b0..3eba2ee80e 100644 --- a/blazor/pdfviewer-2/toolbar-customization.md +++ b/blazor/pdfviewer-2/toolbar-customization.md @@ -238,8 +238,8 @@ To customize the Primary Toolbar in the PDF Viewer, you can achieve this by sett @code{ private string DocumentPath { get; set; } = "wwwroot/Data/PDF_Succinctly.pdf"; - SfPdfViewer2 Viewer; - MemoryStream stream; + SfPdfViewer2 Viewer = default!; + MemoryStream stream = default!; // List provide the position and element for the custom toolbar items public List CustomToolbarItems = new List()