From 41b4a5bc4de16113bcf7067da791c3ce32b9c053 Mon Sep 17 00:00:00 2001 From: Yuvaraj Date: Wed, 17 Jul 2024 16:09:25 +0530 Subject: [PATCH 1/8] 897889- Removed the VS 2008,2010,2012, 2013 for WPF platform. --- wpf/Bullet-Graph/Getting-Started.md | 2 +- wpf/Charts/CodedUI.md | 6 ------ wpf/DataGrid/Styles-and-Templates.md | 2 +- wpf/DataGrid/UI-Automation.md | 6 ------ wpf/Grouping/Overview.md | 3 --- wpf/Introduction/System-Requirement.md | 11 ----------- wpf/Range-Selector/Getting-Started.md | 3 --- wpf/Sparkline/Getting-started.md | 2 -- wpf/System-Requirements.md | 2 +- wpf/Testing/coded-ui.md | 18 +----------------- wpf/TreeGrid/UI-Automation.md | 9 --------- .../Add-References.md | 2 +- wpf/Visual-Studio-Integration/Overview.md | 2 +- 13 files changed, 6 insertions(+), 62 deletions(-) diff --git a/wpf/Bullet-Graph/Getting-Started.md b/wpf/Bullet-Graph/Getting-Started.md index 4480757374..f1e2303a4a 100644 --- a/wpf/Bullet-Graph/Getting-Started.md +++ b/wpf/Bullet-Graph/Getting-Started.md @@ -79,7 +79,7 @@ The SfBulletGraph control will be created as shown in the figure below. ![Displaying SfBulletGraph control](Getting-Started_images/Getting-Started_img7.jpg) ->**Note:- The Syncfusion Reference Manager is available in versions 11.3.0.30 and later. It supports referencing assemblies from version 10.4.0.71 version to the current version and Syncfusion Reference Manager can be used only in Visual Studio 2010, 2012, 2013 and 2015.** +>**Note:- The Syncfusion Reference Manager is available in versions 11.3.0.30 and later. It supports referencing assemblies from version 10.4.0.71 version to the current version and Syncfusion Reference Manager can be used only in Visual Studio 2015.** ## Configuring SfBulletGraph diff --git a/wpf/Charts/CodedUI.md b/wpf/Charts/CodedUI.md index 6d4f0a30ef..b825c61dad 100644 --- a/wpf/Charts/CodedUI.md +++ b/wpf/Charts/CodedUI.md @@ -54,12 +54,6 @@ Place this assembly in below mentioned location, and install this assembly in GA The above assembly must be placed into the following directory based on your Visual Studio version. -For Visual Studio 2010: C:\Program Files (x86)\Common Files\Microsoft Shared\VSTT\10.0\UITestExtensionPackages - -For Visual Studio 2012: C:\Program Files (x86)\Common Files\Microsoft Shared\VSTT\11.0\UITestExtensionPackages - -For Visual Studio 2013: C:\Program Files (x86)\Common Files\Microsoft Shared\VSTT\12.0\UITestExtensionPackages - N> Syncfusion.SfChart.CUITExtension.WPF.dll need to be installed in GAC location. Please refer the MSDN link for_ [GAC](https://learn.microsoft.com/en-us/previous-versions/dotnet/netframework-2.0/ex0ss12c(v=vs.80)) _installation. ## Getting Started diff --git a/wpf/DataGrid/Styles-and-Templates.md b/wpf/DataGrid/Styles-and-Templates.md index e5be9c6d54..8ac28cbaa6 100644 --- a/wpf/DataGrid/Styles-and-Templates.md +++ b/wpf/DataGrid/Styles-and-Templates.md @@ -378,7 +378,7 @@ You can edit or create new style for the following SfDataGrid elements through * 15. FilterPopupTemplate 16. DetailsViewDataGridStyle -N> Visual Studio Editing option is available from Visual Studio 2012 and higher versions only. +N> Visual Studio Editing option is available from Visual Studio 2015 and higher versions only. ## Writing Style by TargetType diff --git a/wpf/DataGrid/UI-Automation.md b/wpf/DataGrid/UI-Automation.md index 14f55c5cfb..c3a4603cf1 100644 --- a/wpf/DataGrid/UI-Automation.md +++ b/wpf/DataGrid/UI-Automation.md @@ -57,12 +57,6 @@ To test SfDataGrid with CUITs, build the Extension Project and place it in the m The above assembly must be placed into the following directory based on your Visual Studio version. -For `Visual Studio 2010` : C:\Program Files (x86)\Common Files\Microsoft Shared\VSTT\10.0\UITestExtensionPackages - -For `Visual Studio 2012` : C:\Program Files (x86)\Common Files\Microsoft Shared\VSTT\11.0\UITestExtensionPackages - -For `Visual Studio 2013` : C:\Program Files (x86)\Common Files\Microsoft Shared\VSTT\12.0\UITestExtensionPackages - N> `Syncfusion.VisualStudio.TestTools.UITest.SfGridExtension.dll` need to be installed in GAC location. Please refer the MSDN link for [GAC](https://learn.microsoft.com/en-us/previous-versions/dotnet/netframework-2.0/ex0ss12c(v=vs.80)) installation. ### Getting Started diff --git a/wpf/Grouping/Overview.md b/wpf/Grouping/Overview.md index 584a1bfaba..6725186a82 100644 --- a/wpf/Grouping/Overview.md +++ b/wpf/Grouping/Overview.md @@ -49,9 +49,6 @@ The prerequisites details are listed below: Development Environments diff --git a/wpf/Introduction/System-Requirement.md b/wpf/Introduction/System-Requirement.md index 6ceb2e1fb8..19b941c980 100644 --- a/wpf/Introduction/System-Requirement.md +++ b/wpf/Introduction/System-Requirement.md @@ -22,14 +22,3 @@ This section describes the system requirements to use Syncfusion WPFControls for -## IDE - -### Following IDEs can be used for development: - -* Microsoft Visual Studio 2008 -* Microsoft Visual Studio 2010 -* Microsoft Visual Studio 2012 -* Microsoft Visual Studio 2013 - - - diff --git a/wpf/Range-Selector/Getting-Started.md b/wpf/Range-Selector/Getting-Started.md index c335b5e343..4b325b8a31 100644 --- a/wpf/Range-Selector/Getting-Started.md +++ b/wpf/Range-Selector/Getting-Started.md @@ -29,9 +29,6 @@ The following section explains how to create SfDateTimeRangeNavigator. 1. Open the Add Reference window in your project. 2. Choose our assemblies by following the given steps depending upon the developing environment. - * If you use VS 2012, choose Assemblies > Extensions > Syncfusion.SfChart.WPF.dll. - * If you use VS 2010, choose .Net > Syncfusion.SfChart.WPF.dll. - 3. Add the following namespace in your XAML page: {% capture codesnippet1 %} diff --git a/wpf/Sparkline/Getting-started.md b/wpf/Sparkline/Getting-started.md index f943f6239c..c024821e94 100644 --- a/wpf/Sparkline/Getting-started.md +++ b/wpf/Sparkline/Getting-started.md @@ -17,8 +17,6 @@ Following steps explain how to create sparkline, * Open the [Add Reference](https://www.microsoft.com/en-us/download/details.aspx?id=55984) window from your project. * To Choose our assemblies follow the below step depending upon the developing environment. -* If using VS 2012 choose Assemblies > Extensions > Syncfusion.SfChart.WPF.dll -* If using VS 2010 choose .Net>Syncfusion.SfChart.WPF.dll * Add the following namespace in your XAML page: {% tabs %} diff --git a/wpf/System-Requirements.md b/wpf/System-Requirements.md index 399a0d6eda..0e7baaa4b9 100644 --- a/wpf/System-Requirements.md +++ b/wpf/System-Requirements.md @@ -28,6 +28,6 @@ This section describes the system requirements to use Syncfusion WPF Controls fo ### Development Environment -* Microsoft Visual Studio 2010/2012/2013/2015/2017/2019/2022 +* Microsoft Visual Studio 2015/2017/2019/2022 * .NET Framework 4.0/4.6.2 * .NET 6.0/.NET 7.0/.Net 8.0 \ No newline at end of file diff --git a/wpf/Testing/coded-ui.md b/wpf/Testing/coded-ui.md index a9f178ff8b..768d107e94 100644 --- a/wpf/Testing/coded-ui.md +++ b/wpf/Testing/coded-ui.md @@ -81,7 +81,7 @@ Visual Studio -Coded UI provides support only in Visual Studio – 2010, 2012 and 2013 Ultimate and Premium platforms for Visual Studio 2015 and 2017 supported only in Enterprise platform. For more information about the platforms and configurations supported by Coded UI tests, refer to this {{'[link](https://learn.microsoft.com/en-us/previous-versions/visualstudio/visual-studio-2015/test/supported-configurations-and-platforms-for-coded-ui-tests-and-action-recordings?view=vs-2015&redirectedfrom=MSDN#%22%22)'| markdownify }}. +Coded UI provides support only in Visual Studio – Premium platforms for Visual Studio 2015 and 2017 supported only in Enterprise platform. For more information about the platforms and configurations supported by Coded UI tests, refer to this {{'[link](https://learn.microsoft.com/en-us/previous-versions/visualstudio/visual-studio-2015/test/supported-configurations-and-platforms-for-coded-ui-tests-and-action-recordings?view=vs-2015&redirectedfrom=MSDN#%22%22)'| markdownify }}. @@ -367,22 +367,6 @@ C:\Program Files (x86)\Common Files\Microsoft Shared\VSTT\10.0\UITestExtensionPa -2012 - - -C:\Program Files (x86)\Common Files\Microsoft Shared\VSTT\11.0\UITestExtensionPackages - - - - -2013 - - -C:\Program Files (x86)\Common Files\Microsoft Shared\VSTT\13.0\UITestExtensionPackages - - - - 2015 diff --git a/wpf/TreeGrid/UI-Automation.md b/wpf/TreeGrid/UI-Automation.md index ccbd4f1663..9a5a7a71ff 100644 --- a/wpf/TreeGrid/UI-Automation.md +++ b/wpf/TreeGrid/UI-Automation.md @@ -39,15 +39,6 @@ Syncfusion.VisualStudio.TestTools.UITest.SfGridExtension.dll The SfGridExtension assembly must be placed into the following directory based on your Visual Studio version. -For Visual Studio 2010: -C:\Program Files (x86)\Common Files\Microsoft Shared\VSTT\10.0\UITestExtensionPackages - -For Visual Studio 2012: -C:\Program Files (x86)\Common Files\Microsoft Shared\VSTT\11.0\UITestExtensionPackages - -For Visual Studio 2013: -C:\Program Files (x86)\Common Files\Microsoft Shared\VSTT\13.0\UITestExtensionPackages - For Visual Studio 2015: C:\Program Files (x86)\Common Files\Microsoft Shared\VSTT\14.0\UITestExtensionPackages diff --git a/wpf/Visual-Studio-Integration/Add-References.md b/wpf/Visual-Studio-Integration/Add-References.md index df6ad9f12d..2852e768c0 100644 --- a/wpf/Visual-Studio-Integration/Add-References.md +++ b/wpf/Visual-Studio-Integration/Add-References.md @@ -9,7 +9,7 @@ documentation: ug # Add Reference for WPF -Syncfusion Reference Manager is the Visual Studio Add-In for WPF platform. It adds the Syncfusion assembly reference to the project, either from the GAC location or from Essential Studio installed location or from NuGet packages. It can also migrate the projects that contain the old versions of the Syncfusion assembly reference to newer or specific versions of the Syncfusion assembly reference. It supports Microsoft Visual Studio 2013 or higher. This Visual Studio extension is included from Essential Studio 2013 Volume 3 release. +Syncfusion Reference Manager is the Visual Studio Add-In for WPF platform. It adds the Syncfusion assembly reference to the project, either from the GAC location or from Essential Studio installed location or from NuGet packages. It can also migrate the projects that contain the old versions of the Syncfusion assembly reference to newer or specific versions of the Syncfusion assembly reference. It supports Microsoft Visual Studio 2015 or higher. This Visual Studio extension is included from Essential Studio 2013 Volume 3 release. N> This Reference Manager can be applied to a project for Syncfusion assembly versions 10.4.0.71 and later. diff --git a/wpf/Visual-Studio-Integration/Overview.md b/wpf/Visual-Studio-Integration/Overview.md index 9a412f6d29..eb6d08447c 100644 --- a/wpf/Visual-Studio-Integration/Overview.md +++ b/wpf/Visual-Studio-Integration/Overview.md @@ -9,7 +9,7 @@ documentation: ug # Syncfusion WPF Extension -The Syncfusion WPF Studio Extensions can be accessed through the Syncfusion Menu to create and configure the project with Syncfusion references in Visual Studio.The Syncfusion WPF Extensions supports Microsoft Visual Studio 2013 or higher. +The Syncfusion WPF Studio Extensions can be accessed through the Syncfusion Menu to create and configure the project with Syncfusion references in Visual Studio.The Syncfusion WPF Extensions supports Microsoft Visual Studio 2015 or higher. N> Syncfusion Extension is published in Visual Studio Marketplace. We provided separate Syncfusion WPF Extension support for Visual Studio 2022 and Visual Studio 2019 or lower. Please refer below marketplace link. From 79e1c4f14b994b831694649a7a9c56799dc7af11 Mon Sep 17 00:00:00 2001 From: Yuvaraj Date: Wed, 17 Jul 2024 16:19:19 +0530 Subject: [PATCH 2/8] resolved the CI error. --- wpf/Grouping/Overview.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wpf/Grouping/Overview.md b/wpf/Grouping/Overview.md index 6725186a82..e32a521f2e 100644 --- a/wpf/Grouping/Overview.md +++ b/wpf/Grouping/Overview.md @@ -2,7 +2,7 @@ layout: post title: About WPF Grouping control | Syncfusion description: Learn here all about introduction of Syncfusion WPF Grouping control, its elements and more details. -platform: WindowsForms +platform: wpf control: Grouping documentation: ug --- From 258692bc7647288f9ca2339c27727a8a0ad235d9 Mon Sep 17 00:00:00 2001 From: Yuvaraj Date: Wed, 17 Jul 2024 18:41:00 +0530 Subject: [PATCH 3/8] addressed the review concerns --- wpf/Charts/CodedUI.md | 3 +++ wpf/DataGrid/UI-Automation.md | 3 +++ wpf/Grouping/Overview.md | 1 - 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/wpf/Charts/CodedUI.md b/wpf/Charts/CodedUI.md index b825c61dad..eaffc78ea9 100644 --- a/wpf/Charts/CodedUI.md +++ b/wpf/Charts/CodedUI.md @@ -54,6 +54,9 @@ Place this assembly in below mentioned location, and install this assembly in GA The above assembly must be placed into the following directory based on your Visual Studio version. +For Visual Studio 2015: +C:\Program Files (x86)\Common Files\Microsoft Shared\VSTT\14.0\UITestExtensionPackages + N> Syncfusion.SfChart.CUITExtension.WPF.dll need to be installed in GAC location. Please refer the MSDN link for_ [GAC](https://learn.microsoft.com/en-us/previous-versions/dotnet/netframework-2.0/ex0ss12c(v=vs.80)) _installation. ## Getting Started diff --git a/wpf/DataGrid/UI-Automation.md b/wpf/DataGrid/UI-Automation.md index c3a4603cf1..81ced0e1c0 100644 --- a/wpf/DataGrid/UI-Automation.md +++ b/wpf/DataGrid/UI-Automation.md @@ -57,6 +57,9 @@ To test SfDataGrid with CUITs, build the Extension Project and place it in the m The above assembly must be placed into the following directory based on your Visual Studio version. +For Visual Studio 2015: +C:\Program Files (x86)\Common Files\Microsoft Shared\VSTT\14.0\UITestExtensionPackages + N> `Syncfusion.VisualStudio.TestTools.UITest.SfGridExtension.dll` need to be installed in GAC location. Please refer the MSDN link for [GAC](https://learn.microsoft.com/en-us/previous-versions/dotnet/netframework-2.0/ex0ss12c(v=vs.80)) installation. ### Getting Started diff --git a/wpf/Grouping/Overview.md b/wpf/Grouping/Overview.md index e32a521f2e..c9bb59bb57 100644 --- a/wpf/Grouping/Overview.md +++ b/wpf/Grouping/Overview.md @@ -49,7 +49,6 @@ The prerequisites details are listed below: Development Environments
  • Visual Studio 2015 (Ultimate, Premium, Professional, and Express)
  • -
  • Visual Studio 2005 (Professional, Standard & Express)

.NET Framework versions From 74eedfd39ab646f8b5c63815ca4ea8aea99b6848 Mon Sep 17 00:00:00 2001 From: Yuvaraj Date: Thu, 18 Jul 2024 15:48:28 +0530 Subject: [PATCH 4/8] addressed the review concerns in range selector and sparkline control --- wpf/Range-Selector/Getting-Started.md | 6 ++---- wpf/Sparkline/Getting-started.md | 4 +++- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/wpf/Range-Selector/Getting-Started.md b/wpf/Range-Selector/Getting-Started.md index 4b325b8a31..aeeeacb81f 100644 --- a/wpf/Range-Selector/Getting-Started.md +++ b/wpf/Range-Selector/Getting-Started.md @@ -26,10 +26,8 @@ The following section explains how to create SfDateTimeRangeNavigator. ### Add the assembly reference -1. Open the Add Reference window in your project. -2. Choose our assemblies by following the given steps depending upon the developing environment. - -3. Add the following namespace in your XAML page: +1. Refer to this [article](https://help.syncfusion.com/wpf/add-syncfusion-controls) to learn how to add Syncfusion controls to Visual Studio projects in various ways. You can also refer to [this](https://help.syncfusion.com/wpf/control-dependencies) link to learn about the assemblies required for adding Chart to your project. +2. Add the following namespace in your XAML page: {% capture codesnippet1 %} {% highlight xaml %} diff --git a/wpf/Sparkline/Getting-started.md b/wpf/Sparkline/Getting-started.md index c024821e94..d7e26d80f1 100644 --- a/wpf/Sparkline/Getting-started.md +++ b/wpf/Sparkline/Getting-started.md @@ -16,7 +16,7 @@ Following steps explain how to create sparkline, ### Adding the assembly reference: * Open the [Add Reference](https://www.microsoft.com/en-us/download/details.aspx?id=55984) window from your project. -* To Choose our assemblies follow the below step depending upon the developing environment. +* Choose Assemblies -> Extensions -> Syncfusion.SfChart.WPF * Add the following namespace in your XAML page: {% tabs %} @@ -35,6 +35,8 @@ using Syncfusion.UI.Xaml.Charts; {% endtabs %} +N> This window differs for the Visual Basic project. + ### Initialize the sparkline You need to initialize the sparkline represented by the following class Syncfusion.UI.Xaml.Charts.SfChart, From 969dd4975ddbc34c036c0ae62758d71da9772929 Mon Sep 17 00:00:00 2001 From: Krithika Date: Thu, 18 Jul 2024 19:48:10 +0530 Subject: [PATCH 5/8] 883474 Need to include adding annotation topic under programmatic support --- ...rking-with-Annotations-Programmatically.md | 47 +++++++++++++++++++ 1 file changed, 47 insertions(+) diff --git a/wpf/Pdf-Viewer/Working-with-Annotations/Working-with-Annotations-Programmatically.md b/wpf/Pdf-Viewer/Working-with-Annotations/Working-with-Annotations-Programmatically.md index dd08a438e5..83bcbe9add 100644 --- a/wpf/Pdf-Viewer/Working-with-Annotations/Working-with-Annotations-Programmatically.md +++ b/wpf/Pdf-Viewer/Working-with-Annotations/Working-with-Annotations-Programmatically.md @@ -8,6 +8,53 @@ documentation: ug --- # Working with annotations programmatically +## Add an annotation + +PDF Viewer allows the users to add the annotation programmatically without user interaction. We can add the annotation to the PDF document with the help of the [PdfViewerControl’s loadedDocument](https://help.syncfusion.com/cr/wpf/Syncfusion.Windows.PdfViewer.PdfViewerControl.html#Syncfusion_Windows_PdfViewer_PdfViewerControl_LoadedDocument) property from the code behind. + +The following code snippet explains how to add an ink annotation at runtime to the PDF document. + +{% tabs %} +{% highlight C# %} + +//Adding ink annotation at runtime to the PDF document. +private void AddAnnotation() +{ + //Get the instance of the loadedDocument from the PdfViewerControl. + PdfLoadedDocument loadedDocument = pdfViewer.LoadedDocument; + + //Specify the ink points + List inkPoints = new List { 40, 300, 60, 100, 40, 50, 40, 300 }; + //Specify the bounds of an annotation + RectangleF rectangle = new RectangleF(0, 0, 300, 400); + //Create a new ink annotation + PdfInkAnnotation inkAnnotation = new PdfInkAnnotation(rectangle, inkPoints); + + //Add the ink annotation to the desired page of the PdfLoadedDocument property instance. + loadedDocument.Pages[0].Annotations.Add(inkAnnotation); +} + +{% endhighlight %} +{% highlight VB %} + +'Adding ink annotation at runtime to the PDF document. +private void AddAnnotation() +{ + 'Get the instance of the loadedDocument from the PdfViewerControl. + Dim loadedDocument As PdfLoadedDocument = pdfViewer.LoadedDocument + + 'Specify the ink points + Dim inkPoints As List(Of Single) = New List(Of Single) From {40, 300, 60, 100, 40, 50, 40, 300} + 'Specify the bounds of an annotation + Dim rectangle As RectangleF = New RectangleF(0, 0, 300, 400) + 'Create a new ink annotation + Dim inkAnnotation As PdfInkAnnotation = New PdfInkAnnotation(rectangle, inkPoints) + + 'Add the ink annotation to the desired page of the PdfLoadedDocument property instance. + loadedDocument.Pages[0].Annotations.Add(inkAnnotation) +} +{% endhighlight %} +{% endtabs %} ## Select an annotation From fec0e90501a6993f4148ff9b0a5bcf5d8c7178ec Mon Sep 17 00:00:00 2001 From: Krithika Date: Fri, 19 Jul 2024 14:07:08 +0530 Subject: [PATCH 6/8] 883474 Need to include adding annotation topic under programmatic support --- ...rking-with-Annotations-Programmatically.md | 48 ++++++++++++++++++- 1 file changed, 46 insertions(+), 2 deletions(-) diff --git a/wpf/Pdf-Viewer/Working-with-Annotations/Working-with-Annotations-Programmatically.md b/wpf/Pdf-Viewer/Working-with-Annotations/Working-with-Annotations-Programmatically.md index 83bcbe9add..21aaa1340d 100644 --- a/wpf/Pdf-Viewer/Working-with-Annotations/Working-with-Annotations-Programmatically.md +++ b/wpf/Pdf-Viewer/Working-with-Annotations/Working-with-Annotations-Programmatically.md @@ -10,7 +10,7 @@ documentation: ug # Working with annotations programmatically ## Add an annotation -PDF Viewer allows the users to add the annotation programmatically without user interaction. We can add the annotation to the PDF document with the help of the [PdfViewerControl’s loadedDocument](https://help.syncfusion.com/cr/wpf/Syncfusion.Windows.PdfViewer.PdfViewerControl.html#Syncfusion_Windows_PdfViewer_PdfViewerControl_LoadedDocument) property from the code behind. +PDF Viewer allows users to add annotations programmatically without user interaction. Annotations can be added to the PDF document using the [PdfViewerControl’s loadedDocument](https://help.syncfusion.com/cr/wpf/Syncfusion.Windows.PdfViewer.PdfViewerControl.html#Syncfusion_Windows_PdfViewer_PdfViewerControl_LoadedDocument) property from the code behind. The following code snippet explains how to add an ink annotation at runtime to the PDF document. @@ -51,7 +51,7 @@ private void AddAnnotation() Dim inkAnnotation As PdfInkAnnotation = New PdfInkAnnotation(rectangle, inkPoints) 'Add the ink annotation to the desired page of the PdfLoadedDocument property instance. - loadedDocument.Pages[0].Annotations.Add(inkAnnotation) + loadedDocument.Pages(0).Annotations.Add(inkAnnotation) } {% endhighlight %} {% endtabs %} @@ -201,7 +201,9 @@ private void PdfViewer_DocumentLoaded(object sender, EventArgs args) {% endtabs %} ## Modify an annotation +PDF Viewer allows users to modify annotations programmatically without user interaction with the below ways. +### Modify an annotation using annotation changed event settings Annotation’s properties can be modified programmatically through `Settings` in respective annotation changed event. The following code snippet explains how to modify the selected ink annotation’s properties. Similarly, we can implement for all other annotations. @@ -224,6 +226,48 @@ private void PdfViewer_InkAnnotationChanged(object sender, InkAnnotationChangedE {% endhighlight %} {% endtabs %} +### Modify an annotation using loadedDocument + +Annotations can be modified to the PDF document using the [PdfViewerControl’s loadedDocument](https://help.syncfusion.com/cr/wpf/Syncfusion.Windows.PdfViewer.PdfViewerControl.html#Syncfusion_Windows_PdfViewer_PdfViewerControl_LoadedDocument) property from the code behind. + +The following code snippet explains how to modify an ink annotation at runtime to the PDF document. + +{% tabs %} +{% highlight C# %} + +//Modify ink annotation at runtime to the PDF document. +private void ModifyAnnotation() +{ + //Get the instance of the loadedDocument from the PdfViewerControl. + PdfLoadedDocument loadedDocument = pdfViewer.LoadedDocument; + //Check whether the annotation in PdfInkAnnotation + if(loadedDocument.Pages[0].Annotations[0] is PdfInkAnnotation) + { + PdfInkAnnotation inkAnnotation = loadedDocument.Pages[0].Annotations[0] as PdfInkAnnotation; + //Modify the color of the ink annotation + inkAnnotation.Color = new PdfColor(System.Drawing.Color.Blue); + } +} + +{% endhighlight %} +{% highlight VB %} + +'Modify ink annotation at runtime to the PDF document. +private void ModifyAnnotation() +{ + 'Get the instance of the loadedDocument from the PdfViewerControl. + Dim loadedDocument As PdfLoadedDocument = pdfViewer.LoadedDocument + Dim inkAnnotation As PdfInkAnnotation = Nothing + 'Check whether the annotation in PdfInkAnnotation + If TypeOf loadedDocument.Pages(0).Annotations(1) Is PdfInkAnnotation Then + inkAnnotation = TryCast(loadedDocument.Pages(0).Annotations(1), PdfInkAnnotation) + 'Modify the color of the ink annotation + inkAnnotation.Color = New PdfColor(System.Drawing.Color.Blue) + End If +} +{% endhighlight %} +{% endtabs %} + ## Hide an annotation PDF Viewer allows the user to hide the annotation programmatically without user interaction. This functionality returns true if any annotation is found and hidden, otherwise it returns false. The annotation [Name](https://help.syncfusion.com/cr/wpf/Syncfusion.Windows.PdfViewer.AnnotationChangedEventArgs.html#Syncfusion_Windows_PdfViewer_AnnotationChangedEventArgs_Name) property is used to identify the annotation. Refer this [UG link](https://help.syncfusion.com/wpf/pdf-viewer/working-with-annotations/select-and-modify-annotations#how-to-get-and-set-name-of-an-annotation) to get and set an annotation Name property. From 91996c15932a41844ce28d016c3f9befddb5d6bd Mon Sep 17 00:00:00 2001 From: Krithika Date: Fri, 19 Jul 2024 15:22:33 +0530 Subject: [PATCH 7/8] 883474 Need to include adding annotation topic under programmatic support --- .../Working-with-Annotations-Programmatically.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/wpf/Pdf-Viewer/Working-with-Annotations/Working-with-Annotations-Programmatically.md b/wpf/Pdf-Viewer/Working-with-Annotations/Working-with-Annotations-Programmatically.md index 21aaa1340d..8b3c87e9fe 100644 --- a/wpf/Pdf-Viewer/Working-with-Annotations/Working-with-Annotations-Programmatically.md +++ b/wpf/Pdf-Viewer/Working-with-Annotations/Working-with-Annotations-Programmatically.md @@ -259,8 +259,8 @@ private void ModifyAnnotation() Dim loadedDocument As PdfLoadedDocument = pdfViewer.LoadedDocument Dim inkAnnotation As PdfInkAnnotation = Nothing 'Check whether the annotation in PdfInkAnnotation - If TypeOf loadedDocument.Pages(0).Annotations(1) Is PdfInkAnnotation Then - inkAnnotation = TryCast(loadedDocument.Pages(0).Annotations(1), PdfInkAnnotation) + If TypeOf loadedDocument.Pages(0).Annotations(0) Is PdfInkAnnotation Then + inkAnnotation = TryCast(loadedDocument.Pages(0).Annotations(0), PdfInkAnnotation) 'Modify the color of the ink annotation inkAnnotation.Color = New PdfColor(System.Drawing.Color.Blue) End If From 880a4fbffae322f66702ea0499cdc08ff2dc8d2f Mon Sep 17 00:00:00 2001 From: Krithika Date: Fri, 19 Jul 2024 18:46:58 +0530 Subject: [PATCH 8/8] 883474 Need to include adding annotation topic under programmatic support --- ...orking-with-Annotations-Programmatically.md | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/wpf/Pdf-Viewer/Working-with-Annotations/Working-with-Annotations-Programmatically.md b/wpf/Pdf-Viewer/Working-with-Annotations/Working-with-Annotations-Programmatically.md index 8b3c87e9fe..0cff613932 100644 --- a/wpf/Pdf-Viewer/Working-with-Annotations/Working-with-Annotations-Programmatically.md +++ b/wpf/Pdf-Viewer/Working-with-Annotations/Working-with-Annotations-Programmatically.md @@ -10,7 +10,7 @@ documentation: ug # Working with annotations programmatically ## Add an annotation -PDF Viewer allows users to add annotations programmatically without user interaction. Annotations can be added to the PDF document using the [PdfViewerControl’s loadedDocument](https://help.syncfusion.com/cr/wpf/Syncfusion.Windows.PdfViewer.PdfViewerControl.html#Syncfusion_Windows_PdfViewer_PdfViewerControl_LoadedDocument) property from the code behind. +The PDF Viewer allows users to add annotations programmatically without user interaction. Annotations can be added to the PDF document using the [PdfViewerControl’s loadedDocument](https://help.syncfusion.com/cr/wpf/Syncfusion.Windows.PdfViewer.PdfViewerControl.html#Syncfusion_Windows_PdfViewer_PdfViewerControl_LoadedDocument) property in the code behind. The following code snippet explains how to add an ink annotation at runtime to the PDF document. @@ -201,7 +201,7 @@ private void PdfViewer_DocumentLoaded(object sender, EventArgs args) {% endtabs %} ## Modify an annotation -PDF Viewer allows users to modify annotations programmatically without user interaction with the below ways. +The PDF Viewer allows users to modify annotations programmatically without user interaction in the following ways. ### Modify an annotation using annotation changed event settings Annotation’s properties can be modified programmatically through `Settings` in respective annotation changed event. @@ -228,19 +228,19 @@ private void PdfViewer_InkAnnotationChanged(object sender, InkAnnotationChangedE ### Modify an annotation using loadedDocument -Annotations can be modified to the PDF document using the [PdfViewerControl’s loadedDocument](https://help.syncfusion.com/cr/wpf/Syncfusion.Windows.PdfViewer.PdfViewerControl.html#Syncfusion_Windows_PdfViewer_PdfViewerControl_LoadedDocument) property from the code behind. +Annotations can be modified in the PDF document using the [PdfViewerControl’s loadedDocument](https://help.syncfusion.com/cr/wpf/Syncfusion.Windows.PdfViewer.PdfViewerControl.html#Syncfusion_Windows_PdfViewer_PdfViewerControl_LoadedDocument) property in the code behind. -The following code snippet explains how to modify an ink annotation at runtime to the PDF document. +The following code snippet demonstrates how to modify an ink annotation at runtime. {% tabs %} {% highlight C# %} -//Modify ink annotation at runtime to the PDF document. +//Modify the ink annotation in the PDF Viewer runtime. private void ModifyAnnotation() { //Get the instance of the loadedDocument from the PdfViewerControl. PdfLoadedDocument loadedDocument = pdfViewer.LoadedDocument; - //Check whether the annotation in PdfInkAnnotation + //Check whether the annotation is PdfInkAnnotation. if(loadedDocument.Pages[0].Annotations[0] is PdfInkAnnotation) { PdfInkAnnotation inkAnnotation = loadedDocument.Pages[0].Annotations[0] as PdfInkAnnotation; @@ -252,16 +252,16 @@ private void ModifyAnnotation() {% endhighlight %} {% highlight VB %} -'Modify ink annotation at runtime to the PDF document. +'Modify the ink annotation in the PDF Viewer runtime. private void ModifyAnnotation() { 'Get the instance of the loadedDocument from the PdfViewerControl. Dim loadedDocument As PdfLoadedDocument = pdfViewer.LoadedDocument Dim inkAnnotation As PdfInkAnnotation = Nothing - 'Check whether the annotation in PdfInkAnnotation + 'Check whether the annotation is PdfInkAnnotation. If TypeOf loadedDocument.Pages(0).Annotations(0) Is PdfInkAnnotation Then inkAnnotation = TryCast(loadedDocument.Pages(0).Annotations(0), PdfInkAnnotation) - 'Modify the color of the ink annotation + 'Modify the color of the ink annotation. inkAnnotation.Color = New PdfColor(System.Drawing.Color.Blue) End If }