diff --git a/wpf/Add-Syncfusion-Controls.md b/wpf/Add-Syncfusion-Controls.md index f43457ac7..994964f78 100644 --- a/wpf/Add-Syncfusion-Controls.md +++ b/wpf/Add-Syncfusion-Controls.md @@ -8,19 +8,20 @@ documentation: ug --- # Add Syncfusion® WPF Controls -The Syncfusion® WPF controls can be added in a Visual Studio projects by using either of the following ways: +The Syncfusion® WPF controls can be added to a Visual Studio project by using any of the following ways: * Using Designer +* Using XAML * Using Code-Behind * Using Project Template ## Using Designer -Syncfusion® UI for WPF are added automatically to the Visual Studio Toolbox during installation. The following steps help you to add the required Essential® WPF control using drag and drop from the Toolbox. For example: **SfTextBoxExt** +Syncfusion® UI for WPF controls are added automatically to the Visual Studio Toolbox during the installation. The following steps help you to add the required Essential® WPF control using drag and drop from the Toolbox. For example: **SfTextBoxExt** 1. Create a WPF project in Visual Studio. -2. Find **SfTextBoxExt** by typing the name of the "SfTextBoxExt" in the search box. +2. Find **SfTextBoxExt** by typing "SfTextBoxExt" in the search box of the Toolbox. ![Drag and drop from toolbox](ThroughDragndDrop_images/AddSyncfusionControls_img1.jpeg) @@ -28,9 +29,9 @@ Syncfusion® UI for WPF are added automatically to the Visual Stud ![WPF TextBoxExt control](ThroughDragndDrop_images/AddSyncfusionControls_img2.jpeg) -### Using XAML +## Using XAML -The following steps help you to add a required Essential® WPF Control using XAML Code, for example: **SfTextBoxExt**. +The following steps help you to add the required Essential® WPF control using XAML, for example: **SfTextBoxExt**. 1. Create a WPF project in Visual Studio and refer the following assemblies: @@ -47,7 +48,7 @@ The following steps help you to add a required Essential® WPF Con + xmlns:syncfusion="http://schemas.syncfusion.com/wpf"> {% endhighlight %} @@ -55,7 +56,7 @@ The following steps help you to add a required Essential® WPF Con {% endcapture %} {{ codesnippet1 | OrderList_Indent_Level_1 }} -3. Now, add the SfTextBoxExt control with a required optimal name using the included namespace. +3. Now, add the SfTextBoxExt control with the required name using the included namespace. {% capture codesnippet2 %} {% tabs %} @@ -72,7 +73,7 @@ The following steps help you to add a required Essential® WPF Con ## Using Code-Behind -Syncfusion® UI for WPF can be added at runtime using C# / VB. The following steps help you to add required Essential® WPF control using code. For example: **SfTextBoxExt**. +Syncfusion® UI for WPF controls can be added at runtime using C# / VB. The following steps help you to add a required Essential® WPF control using code. For example: **SfTextBoxExt**. 1. Create a WPF project in Visual Studio and refer to the following assemblies: @@ -86,13 +87,17 @@ Syncfusion® UI for WPF can be added at runtime using C# / VB. The {% highlight C# %} -Syncfusion.Windows.Controls.Input.SfTextBoxExt textBoxExt1 = new Syncfusion.Windows.Controls.Input.SfTextBoxExt(); +using Syncfusion.Windows.Controls.Input; + +SfTextBoxExt textBoxExt1 = new SfTextBoxExt(); {% endhighlight %} {% highlight VB %} -Dim textBoxExt1 As New Syncfusion.Windows.Controls.Input.SfTextBoxExt() +Imports Syncfusion.Windows.Controls.Input + +Dim textBoxExt1 As New SfTextBoxExt() {% endhighlight %} @@ -100,7 +105,7 @@ Dim textBoxExt1 As New Syncfusion.Windows.Controls.Input.SfTextBoxExt() {% endcapture %} {{ codesnippet3 | OrderList_Indent_Level_1 }} -3. Set the Size and Alignment of the control with required value. +3. Set the Size and Alignment of the control with the required values. {% capture codesnippet4 %} {% tabs %} @@ -129,21 +134,24 @@ textBoxExt1.HorizontalAlignment = HorizontalAlignment.Center {% endcapture %} {{ codesnippet4 | OrderList_Indent_Level_1 }} -4. Add the created instance to the parent window (or the needed layout panels). +4. Add the created instance to the parent window (or to a layout panel such as a `Grid`). {% capture codesnippet5 %} {% tabs %} {% highlight C# %} -// Here this denotes parent Window -this.Content = textBoxExt1; +// Add to parent Window (replaces existing content) +this.Content = textBoxExt1; + +// Or add to an existing layout panel, e.g., a Grid named "rootGrid" +// rootGrid.Children.Add(textBoxExt1); {% endhighlight %} {% highlight VB %} -' Here this denotes parent Window +' Add to parent Window (replaces existing content) Me.Content = textBoxExt1 {% endhighlight %} @@ -156,21 +164,21 @@ Me.Content = textBoxExt1 ## Using Project Template -Syncfusion® provides the Visual Studio Project Templates for the Syncfusion® WPF platform to create Syncfusion® WPF Application. +Syncfusion® provides Visual Studio Project Templates for the Syncfusion® WPF platform to create a Syncfusion® WPF Application. I> The Syncfusion® WPF templates are available from v16.1.0.24. -### Create Syncfusion® WPF project +### Create a Syncfusion® WPF project -The following steps direct you to create the Syncfusion® WPF project using the Visual Studio Project Template. +The following steps direct you to create the Syncfusion® WPF project using the Visual Studio Project Template. -1. To create a Syncfusion® WPF project, choose New Project-> Syncfusion->Windows->Syncfusion WPF Application from Visual Studio. +1. To create a Syncfusion® WPF project, choose **New Project** -> **Syncfusion** -> **Windows** -> **Syncfusion WPF Application** from Visual Studio. ![Create WPF application](Add-Syncfusion-Control_images\Syncfusion-Project-Template-Gallery-1.png) -2. Name the Project, choose the destination location when required and set the framework of the project, then click OK. +2. Name the project, choose the destination location when required, set the framework of the project, then click **OK**. -N> Minimum target Framework is 4.0 for Syncfusion® WPF project templates. +N> Minimum target Framework is 4.0 for Syncfusion® WPF project templates. 3. Choose the options to configure the Syncfusion® WPF Application by using the following Project Configuration Wizard. @@ -178,11 +186,11 @@ N> Minimum target Framework is 4.0 for Syncfusion® WPF project te ### Project configurations -**Language:** Select the language, either C# or VB. +**Language:** Select the language, either C# or VB. ![Different language shows in WPF project](Add-Syncfusion-Control_images\Syncfusion-Project-Template-Gallery-3.png) -**Choose Theme:** Choose the required theme. +**Choose Theme:** Choose the required theme. ![Visual studio theme of WPF](Add-Syncfusion-Control_images\Syncfusion-Project-Template-Gallery-4.png) @@ -190,15 +198,15 @@ N> Minimum target Framework is 4.0 for Syncfusion® WPF project te ![Choosing assembly location for WPF project](Add-Syncfusion-Control_images\Syncfusion-Project-Template-Gallery-5.png) -**Select Control:** Choose the control based on your need. +**Select Control:** Choose the control based on your need. ![Select the WPF Control](Add-Syncfusion-Control_images\Syncfusion-Project-Template-Gallery-6.png) -4. Once the Project Configuration Wizard is done, the Syncfusion WPF project is created with required references and XAML. +4. Once the Project Configuration Wizard is done, the Syncfusion WPF project is created with the required references and XAML. ![Added assemblies for WPF control](Add-Syncfusion-Control_images\Syncfusion-Project-Template-Gallery-7.png) -![Shows project folder for added control](Add-Syncfusion-Control_images\Syncfusion-Project-Template-Gallery-8.png) +`![Shows project folder for added control](Add-Syncfusion-Control_images\Syncfusion-Project-Template-Gallery-8.png) 5. Then, Syncfusion® licensing registration required message box will be shown as follows, if you have installed the trial setup or NuGet packages since Syncfusion introduced the licensing system with the 2018 Volume 2 (v16.2.0.41) Essential Studio® release. Please navigate to the [help topic](https://help.syncfusion.com/common/essential-studio/licensing/license-key#how-to-generate-syncfusion-license-key), which is shown in the licensing message box to generate and register the Syncfusion® license key for your project. Refer to this [blog](https://blog.syncfusion.com/post/Whats-New-in-2018-Volume-2-Licensing-Changes-in-the-1620x-Version-of-Essential-Studio.aspx) post for understanding the licensing changes introduced in Essential Studio®. diff --git a/wpf/Blend-Support.md b/wpf/Blend-Support.md index 4f4a98433..0ab5e33bb 100644 --- a/wpf/Blend-Support.md +++ b/wpf/Blend-Support.md @@ -9,57 +9,52 @@ documentation: ug # Getting Started with Blend Support -Essential® WPF control's Style and Template can be editable in Expression Blend and this section explains the same. +Essential® WPF control's Style and Template can be edited in Expression Blend and this section explains the same. ## Edit Control Style in Expression Blend -1.Open an application in Expression Blend. +1. Open an application in Expression Blend. -2.Expand the Views, choose `Other Windows` and then choose `Objects` and `Timeline`. +2. Expand the `Views` menu, choose `Other Windows`, and then choose `Objects and Timeline`. 3.In the “Objects and Timeline” pane, select a Syncfusion® control to modify a style. ![Blend-Support_images1](Blend-Support_images/GettingStarted_img1.jpeg) -4.Expand the format, then choose `Edit Style` menu. +4. The `Edit Style` menu provides the following options: ![Blend-Support_images2](Blend-Support_images/GettingStarted_img2.jpeg) -5.It provides the following options: + * **Create Empty** – This option helps you to create an empty style for the selected control. When it is selected, the same Create Style Resource dialog box is opened and it is used to select the name for the style as well as choose the location. - * Edit Current – To edit the current style. This option is disabled when control do not have a Style. - * Edit a Copy – Helps you to edit a copy of default style. When it is selected, Create Style Resource dialog box is opened, this dialog box is used to select the name for style as well as the location where file is defined. +5. In the **Create Style Resource** dialog box, choose a name for the style and select **Define in: Application** (to make it available application-wide) or **Define in: this document** (to scope it to a specific resource dictionary or the current view), and then click **OK**. The style is added to the XAML and the designer surfaces it for editing. ![Blend-Support_images3](Blend-Support_images/GettingStarted_img3.jpeg) - - * Create Empty – This option helps you to create an empty style for selected control. When it is selected, the same Create Style Resource dialog box is opened and it is used to select the name for style as well as choose the location. - ## Edit ControlTemplate in Expression Blend -1.Open an application in Expression Blend. +1. Open an application in Expression Blend. -2.Expand the Views, choose `Other Windows` and then choose `Objects` and `Timeline`. +2. Expand the `Views` menu, choose `Other Windows`, and then choose `Objects and Timeline`. -3.In the “Objects and Timeline” pane, select a Syncfusion® control to modify a template. +3. In the "Objects and Timeline" pane, select a Syncfusion® control to modify a template. ![Blend-Support_images4](Blend-Support_images/GettingStarted_img4.jpeg) -4.Right-click the Syncfusion® control and choose `Edit` template +4. Right-click the Syncfusion® control and choose `Edit Template`. ![Blend-Support_images5](Blend-Support_images/GettingStarted_img5.jpeg) -5.It provides the following options: +5. The `Edit Template` menu provides the following options: -* Edit Current – To edit the current template of the control. This option is disabled when control do not have a template. -* Edit a Copy – Helps to edit the default template. When it is selected, Create ControlTemplate Resource dialog box is opened. This dialog box is used to select the name for template as well as the location where file is defined. + * **Edit Current** – To edit the current template of the control. This option is disabled when the control does not have a template. + * **Edit a Copy** – Helps you to edit a copy of the default template. When it is selected, the Create ControlTemplate Resource dialog box is opened. This dialog box is used to select the name for the template as well as the location where the template is defined. ![Blend-Support_images6](Blend-Support_images/GettingStarted_img6.jpeg) -* Create Empty – This option helps you to create an empty template for selected control. When it is selected, the same dialog box is opened. It is used to select the name for template as well as the location. - + * **Create Empty** – This option helps you to create an empty template for the selected control. When it is selected, the same Create ControlTemplate Resource dialog box is opened. It is used to select the name for the template as well as the location. diff --git a/wpf/Control-Dependencies.md b/wpf/Control-Dependencies.md index 13adf7b5c..656285425 100644 --- a/wpf/Control-Dependencies.md +++ b/wpf/Control-Dependencies.md @@ -1,7 +1,7 @@ --- layout: post -title: Control Dependencies and Dependency assembly | WPF | Syncfusion -description: Control and it's Dependency assembly or NuGet reference details for Syncfusion Essential Studio WPF products +title: Control Dependencies and Dependency Assemblies | WPF | Syncfusion +description: Control and its dependency assembly or NuGet reference details for Syncfusion Essential Studio WPF products platform: wpf control: Control Dependencies documentation: ug @@ -9,11 +9,11 @@ documentation: ug # Control Dependencies in Syncfusion®'s WPF Controls -This section contains a list of assembly or NuGet references required to use any control in the application. You can refer to the [installation and deployment section](https://help.syncfusion.com/wpf/installation-and-upgrade/system-requirements) to know about assembly installation location and [NuGet packages](https://help.syncfusion.com/wpf/installation/install-nuget-packages) section to know how to add NuGet reference. +This section contains a list of assembly or NuGet references required to use any control in the application. You can refer to the [installation and deployment section](https://help.syncfusion.com/wpf/installation-and-upgrade/system-requirements) to know where the assemblies are installed and the [NuGet packages](https://help.syncfusion.com/wpf/installation/install-nuget-packages) section to know how to add a NuGet reference. -You can refer to the [syncfusion controls section](https://help.syncfusion.com/wpf/add-syncfusion-controls) to learn how to add syncfusion® control. +You can refer to the [Syncfusion controls section](https://help.syncfusion.com/wpf/add-syncfusion-controls) to learn how to add a Syncfusion® control. -N> Starting with version 16.2(2018 Vol 2), the `Syncfusion.Licensing.dll` will be added as reference for all the Syncfusion WPF controls. Please refer to this [help topic](https://help.syncfusion.com/common/essential-studio/licensing/license-key), for more information. +N> Starting with version 16.2 (2018 Vol 2), the `Syncfusion.Licensing.dll` will be added as a reference for all the Syncfusion WPF controls. Please refer to this [help topic](https://help.syncfusion.com/common/essential-studio/licensing/license-key) for more information. ## AutoComplete @@ -555,7 +555,7 @@ Syncfusion.OlapChart.WPF ### Exporting OLAP chart to PDF, Word, and Image -In addition to the above assemblies, the following reference needs to be added to export OLAP chart contents to PDF, word, and image. +In addition to the above assemblies, the following reference needs to be added to export OLAP chart contents to PDF, Word, and Image. @@ -649,7 +649,7 @@ Syncfusion.OlapGrid.WPF ### Exporting OLAP grid to Excel, Word, PDF, and CSV -In addition to the above assemblies, the following reference needs to be added to export OLAP grid contents to excel, word, PDF, and CSV. +In addition to the above assemblies, the following reference needs to be added to export OLAP grid contents to Excel, Word, PDF, and CSV.
@@ -744,7 +744,7 @@ Syncfusion.PivotTable.Wpf ### Exporting pivot grid to Excel, Word, PDF, and CSV -In addition to the above assemblies, the following reference needs to be added to export pivot grid contents to excel, word, PDF, and CSV. +In addition to the above assemblies, the following reference needs to be added to export pivot grid contents to Excel, Word, PDF, and CSV.
@@ -859,10 +859,10 @@ Syncfusion.OfficeChart.Base
Syncfusion.RichTextBoxAdv.WPF
Syncfusion.Shared.WPF
-For 3.5 and 4.0 frameworks:
+For .NET Framework 3.5 and 4.0:
Syncfusion.DocIO.ClientProfile

-For 4.5 and higher frameworks:
+For .NET Framework 4.5 and higher:
Syncfusion.DocIO.Base
Assembly references @@ -1120,7 +1120,7 @@ Syncfusion.SfGrid.WPF
### Exporting DataGrid to Excel, PDF, and CSV -The following reference needs to be added in your application for exporting DataGrid to excel, pdf, and csv. +The following reference needs to be added in your application for exporting DataGrid to Excel, PDF, and CSV. @@ -1576,9 +1576,9 @@ Syncfusion.Compression.Base
Syncfusion.OfficeChart.Base
Syncfusion.Shared.WPF
-For 3.5 and 4.0 frameworks:
+For .NET Framework 3.5 and 4.0:
Syncfusion.DocIO.ClientProfile
-For 4.5 and higher frameworks:
+For .NET Framework 4.5 and higher:
Syncfusion.DocIO.Base
@@ -1603,9 +1603,9 @@ Syncfusion.SfRichTextBoxAdv.WPF
Syncfusion.Shared.WPF
Syncfusion.Tools.WPF
-For 3.5 and 4.0 frameworks:
+For .NET Framework 3.5 and 4.0:
Syncfusion.DocIO.ClientProfile
-For 4.5 and higher frameworks:
+For .NET Framework 4.5 and higher:
Syncfusion.DocIO.Base
@@ -1716,7 +1716,7 @@ Syncfusion.SfSpreadsheetHelper.WPF ### Exporting SfSpreadsheet to PDF -The following references need to be added in your application for exporting SfSpreadsheet to pdf. +The following references need to be added in your application for exporting SfSpreadsheet to PDF. @@ -1798,7 +1798,7 @@ Syncfusion.SfInput.WPF Syncfusion.SfTextInputLayout.WPF
-Syncfusion.SfTextInputLayout.WPF +Syncfusion.SfTextInputLayout.WPF
@@ -1860,7 +1860,7 @@ Syncfusion.SfGrid.WPF ### Exporting TreeGrid to Excel, PDF, and CSV -The following references need to be added in your application for exporting TreeGrid to excel, pdf, and csv. +The following references need to be added in your application for exporting TreeGrid to Excel, PDF, and CSV. diff --git a/wpf/Localization.md b/wpf/Localization.md index d4cf41ea2..fc3fa18b8 100644 --- a/wpf/Localization.md +++ b/wpf/Localization.md @@ -1,7 +1,7 @@ --- layout: post title: Localization in Syncfusion WPF UI Controls | Syncfusion -description: Learn about Localization support in Syncfusion WPF UI Contorls using .RESX files and also explains editing default strings of WPF controls. +description: Learn about Localization support in Syncfusion WPF UI Controls using .RESX files and also explains editing default strings of WPF controls. platform: wpf control: Localization documentation: ug @@ -9,7 +9,7 @@ documentation: ug # Localization of Syncfusion® WPF Controls -Localization is the process of translating the application resources into different language for the specific cultures. You can localize the syncfusion® WPF controls by adding a resource file for each language. +Localization is the process of translating the application resources into different languages for specific cultures. You can localize the Syncfusion® WPF controls by adding a resource file for each language. ## Changing application culture @@ -54,7 +54,7 @@ N> You can get the default resource files of all Syncfusion® WPF 2) Add the [default resource files](https://github.com/syncfusion/wpf-controls-localization-resx-files) to the libraries you are using to the `Resources` folder and ensure `AccessModifier` is specified as `Public`. -N> Consider, you are using `SfDataGrid` and `Ribbon` in your application. Then, you need to copy and include `Syncfusion.SfGrid.WPF.resx` (since `SfDataGrid` present in `Syncfusion.SfGrid.WPF` library) and `Syncfusion.Tools.Wpf.resx` (since `Ribbon` present in `Syncfusion.Tools.WPF` library) files in your application under `Resources` folder. So, now you can know the key names and values of default stings used in `Syncfusion.Tools.WPF.dll` and `Syncfusion.SfGrid.WPF.dll` libraries. +N> Consider, you are using `SfDataGrid` and `Ribbon` in your application. Then, you need to copy and include `Syncfusion.SfGrid.WPF.resx` (since `SfDataGrid` present in `Syncfusion.SfGrid.WPF` library) and `Syncfusion.Tools.Wpf.resx` (since `Ribbon` present in `Syncfusion.Tools.WPF` library) files in your application under `Resources` folder. So, now you can know the key names and values of default strings used in `Syncfusion.Tools.WPF.dll` and `Syncfusion.SfGrid.WPF.dll` libraries. ![WPF DataGrid Localization](localization-images/wpf-default-resx-file.png) @@ -75,4 +75,4 @@ N> Download demo from the [GitHub](https://github.com/SyncfusionExamples/wpf-dat ## Editing default culture strings -You can change default string of any control by adding the default .resx files ([from GitHub](https://github.com/syncfusion/wpf-controls-localization-resx-files)) to `Resources` folder of your application. If it is added, Syncfusion® WPF controls reads the default string from the .resx files of application. +You can change default strings of any control by adding the default .resx files ([from GitHub](https://github.com/syncfusion/wpf-controls-localization-resx-files)) to the `Resources` folder of your application. If added, Syncfusion® WPF controls read the default strings from the .resx files of the application. \ No newline at end of file diff --git a/wpf/Pattern-and-Practices.md b/wpf/Pattern-and-Practices.md index 68a26baa0..91802307c 100644 --- a/wpf/Pattern-and-Practices.md +++ b/wpf/Pattern-and-Practices.md @@ -1,6 +1,6 @@ --- layout: post -title: Pattern and Practices for Syncfusion Essential WPF controls +title: Pattern and Practices for Syncfusion Essential WPF controls | Syncfusion description: Learn here about how to use MVVM Commands, Patterns, and Events of the Syncfusion Essential WPF controls platform: wpf control: Pattern and Practices @@ -10,9 +10,11 @@ documentation: ug ## Getting Started with MVVM -Essential® WPF controls are suitable for MVVM Pattern. Since, the controls are provided with built-in commands. +Essential® WPF controls are suitable for the MVVM pattern. The controls provide built-in commands for MVVM support. -The `DataContext` property specifies the default source for Data Binding in MVVM pattern. +The `DataContext` property specifies the default source for data binding in the MVVM pattern. + +### Setting the DataContext {% tabs %} @@ -39,19 +41,19 @@ public partial class MainWindow : Window {% endtabs %} -This section explains how to perform TabControlExt’s `selectionChanged` event by creating a ViewModel and defining a Model collection that is used to bind with the TabControl’s `ItemSource` property. +This section explains how to handle the TabControlExt `SelectionChanged` event by creating a ViewModel and defining a Model collection that is used to bind with the TabControl's `ItemsSource` property. {% tabs %} {% highlight XAML %} - - - - - - + + + + + + {% endhighlight %} @@ -62,61 +64,53 @@ This section explains how to perform TabControlExt’s `selectionChanged` event {% highlight C# %} -public class ViewModel:NotificationObject +public class ViewModel : NotificationObject { - private ObservableCollection _tabcollection; - public ObservableCollection tabcollection - { - get - { - return _tabcollection; - } - set - { - _tabcollection = value; - } - } - private void Collection() - { - model model = new model() - { - HeaderName = "item1" - }; - model model1 = new model() - { - HeaderName = "item2" - }; - model model2 = new model() - { - HeaderName = "item3" - }; - tabcollection.Add(model); - tabcollection.Add(model1); - tabcollection.Add(model2); - } - public ViewModel() - { - tabcollection=new ObservableCollection(); - Collection(); - } + private ObservableCollection _tabCollection; + public ObservableCollection TabCollection + { + get + { + return _tabCollection; + } + set + { + _tabCollection = value; + this.RaisePropertyChanged("TabCollection"); + } + } + private void PopulateCollection() + { + var model1 = new Model() { HeaderName = "item1" }; + var model2 = new Model() { HeaderName = "item2" }; + var model3 = new Model() { HeaderName = "item3" }; + TabCollection.Add(model1); + TabCollection.Add(model2); + TabCollection.Add(model3); + } + public ViewModel() + { + TabCollection = new ObservableCollection(); + PopulateCollection(); + } } -public class model:NotificationObject +public class Model : NotificationObject { - public model() {} - private string _headername; - public string HeaderName - { - get - { - return _headername; - } - set - { - _headername = value; - this.RaisePropertyChanged("HeaderName"); - } - } + public Model() { } + private string _headerName; + public string HeaderName + { + get + { + return _headerName; + } + set + { + _headerName = value; + this.RaisePropertyChanged("HeaderName"); + } + } } {% endhighlight %} @@ -124,64 +118,65 @@ public class model:NotificationObject {% highlight VB %} Public Class ViewModel - Inherits NotificationObject - Private _tabcollection As ObservableCollection(Of model) - Public Property tabcollection() As ObservableCollection(Of model) - Get - Return _tabcollection - End Get - Set(ByVal value As ObservableCollection(Of model)) - _tabcollection = value - End Set - End Property - Private Sub Collection() - Dim model As New model() With {.HeaderName = "item1"} - Dim model1 As New model() With {.HeaderName = "item2"} - Dim model2 As New model() With {.HeaderName = "item3"} - tabcollection.Add(model) - tabcollection.Add(model1) - tabcollection.Add(model2) - End Sub - Public Sub New() - tabcollection = New ObservableCollection(Of model)() - Collection() - End Sub + Inherits NotificationObject + Private _tabCollection As ObservableCollection(Of Model) + Public Property TabCollection() As ObservableCollection(Of Model) + Get + Return _tabCollection + End Get + Set(ByVal value As ObservableCollection(Of Model)) + _tabCollection = value + Me.RaisePropertyChanged("TabCollection") + End Set + End Property + Private Sub PopulateCollection() + Dim model1 As New Model() With {.HeaderName = "item1"} + Dim model2 As New Model() With {.HeaderName = "item2"} + Dim model3 As New Model() With {.HeaderName = "item3"} + TabCollection.Add(model1) + TabCollection.Add(model2) + TabCollection.Add(model3) + End Sub + Public Sub New() + TabCollection = New ObservableCollection(Of Model)() + PopulateCollection() + End Sub End Class -Public Class model - Inherits NotificationObject - Public Sub New() - End Sub - Private _headername As String - Public Property HeaderName() As String - Get - Return _headername - End Get - Set(ByVal value As String) - _headername = value - Me.RaisePropertyChanged("HeaderName") - End Set - End Property +Public Class Model + Inherits NotificationObject + Public Sub New() + End Sub + Private _headerName As String + Public Property HeaderName() As String + Get + Return _headerName + End Get + Set(ByVal value As String) + _headerName = value + Me.RaisePropertyChanged("HeaderName") + End Set + End Property End Class {% endhighlight %} {% endtabs %} -To handle the `SelectionChanged` event of the TabControlExt in ViewModel, use `TabControlExtSelectionChangedCommand` and define a SelectionChanged command using `ICommand`. -The `TabControlExtSelectionChangedCommand` command is available in `Syncfusion.Tools.MVVM.WPF` assembly. It also requires `Syncfusion.Shared.MVVM.WPF` as a dependency assembly. +To handle the `SelectionChanged` event of the TabControlExt in the ViewModel, use `TabControlExtSelectionChangedCommand` and define a `SelectionChanged` command using `ICommand`. +The `TabControlExtSelectionChangedCommand` command is available in the `Syncfusion.Tools.MVVM.WPF` assembly. It also requires `Syncfusion.Shared.MVVM.WPF` as a dependency assembly. {% tabs %} {% highlight XAML %} - - - - - - + + + + + {% endhighlight %} @@ -193,39 +188,39 @@ The `TabControlExtSelectionChangedCommand` command is available in `Syncfusion.T {% highlight C# %} -private ICommand selectionchanged; +private ICommand selectionChanged; public ICommand SelectionChanged { get - { - return selectionchanged; - } + { + return selectionChanged; + } } public ViewModel() { - selectionchanged = new DelegateCommand(PropertyChangedHandled); + selectionChanged = new DelegateCommand(OnSelectionChanged); } -private void PropertyChangedHandled (object obj) +private void OnSelectionChanged(object obj) { - MessageBox.Show("Command Executed"); + MessageBox.Show("Command Executed"); } {% endhighlight %} {% highlight VB %} -Private selectionchanged_Renamed As ICommand +Private _selectionChanged As ICommand Public ReadOnly Property SelectionChanged() As ICommand - Get - Return selectionchanged_Renamed - End Get + Get + Return _selectionChanged + End Get End Property Public Sub New() - selectionchanged_Renamed = New DelegateCommand(Of Object)(AddressOf PropertyChangedHandled) + _selectionChanged = New DelegateCommand(Of Object)(AddressOf OnSelectionChanged) +End Sub +Private Sub OnSelectionChanged(ByVal obj As Object) + MessageBox.Show("Command Executed") End Sub -Private Sub PropertyChangedHandled(ByVal obj As Object) - MessageBox.Show("Command Executed") -End Sub {% endhighlight %} @@ -240,14 +235,14 @@ The following section covers how to use commands in code-behind using ViewModel. ### CommandParameter -`CommandParameter` can easily pass an object or bind it to a property of another control. The following code example passes a string using CommandParameter. +`CommandParameter` can be used to easily pass an object or bind it to a property of another control. The following code example passes a string using `CommandParameter`. {% tabs %} {% highlight XAML %} - @@ -260,17 +255,17 @@ The following section covers how to use commands in code-behind using ViewModel. {% highlight C# %} -private void PropertyChangedHandled (object obj) +private void OnSelectionChanged(object obj) { - MessageBox.Show(obj.ToString()); + MessageBox.Show(obj.ToString()); } {% endhighlight %} {% highlight VB %} -Private Sub PropertyChangedHandled(ByVal obj As Object) - MessageBox.Show(obj.ToString()) +Private Sub OnSelectionChanged(ByVal obj As Object) + MessageBox.Show(obj.ToString()) End Sub {% endhighlight %} @@ -282,17 +277,22 @@ End Sub #### Pass a property value through Command parameter -Any property can bind with the `CommandParameter` to pass it as command in ViewModel. +Any property can be bound to `CommandParameter` to pass its value to the command in the ViewModel. {% tabs %} {% highlight XAML %} - - + Syncfusion:TabControlExtSelectionChangedCommand.CommandParameter="{Binding Path=SelectedItem.HeaderName, + RelativeSource={RelativeSource Self}}"> + + + + + + {% endhighlight %} @@ -302,18 +302,18 @@ Any property can bind with the `CommandParameter` to pass it as command in ViewM {% highlight C# %} -private void PropertyChangedHandled (object obj) +private void OnSelectionChanged(object obj) { - MessageBox.Show("SelectedItem" +obj.ToString()); + MessageBox.Show("SelectedItem: " + obj.ToString()); } {% endhighlight %} {% highlight VB %} -Private Sub PropertyChangedHandled(ByVal obj As Object) - MessageBox.Show("SelectedItem" & obj.ToString()) -End Sub +Private Sub OnSelectionChanged(ByVal obj As Object) + MessageBox.Show("SelectedItem: " & obj.ToString()) +End Sub {% endhighlight %} diff --git a/wpf/Themes/Fluent-Theme.md b/wpf/Themes/Fluent-Theme.md index aa87c8b5f..fa621f450 100644 --- a/wpf/Themes/Fluent-Theme.md +++ b/wpf/Themes/Fluent-Theme.md @@ -9,12 +9,14 @@ documentation: ug # Getting Started with WPF Fluent Theme -[Fluent Theme](https://help.syncfusion.com/cr/wpf/Syncfusion.SfSkinManager.FluentTheme.html) provides an elegant UI design with reveal animation, [high visibility keyboard visual](https://help.syncfusion.com/wpf/themes/keyboard-focus-visual), and acrylic effect for Windows in WPF application. The following theme variants are supported: +[Fluent Theme](https://help.syncfusion.com/cr/wpf/Syncfusion.SfSkinManager.FluentTheme.html) provides an elegant UI design with reveal animation, [high visibility keyboard visual](https://help.syncfusion.com/wpf/themes/keyboard-focus-visual), and acrylic effect for Windows in a WPF application. The following theme variants are supported: -* Fluent Light Theme -* Fluent Dark Theme +* Fluent Light Theme (theme name: `FluentLight`) +* Fluent Dark Theme (theme name: `FluentDark`) -The following example shows how to apply fluent dark theme for WPF Window using [skin manager](https://help.syncfusion.com/wpf/themes/skin-manager). When applying the theme to Window, the same theme will be applied to all of its child elements. +## Applying the Fluent theme + +The following example shows how to apply the Fluent Dark theme to a WPF Window using the [Skin Manager](https://help.syncfusion.com/wpf/themes/skin-manager). When applying the theme to the Window, the same theme will be applied to all of its child elements. To apply the Fluent Light theme instead, change the `ThemeName` value to `FluentLight`. {% tabs %} @@ -25,7 +27,7 @@ The following example shows how to apply fluent dark theme for WPF Window using xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:local="clr-namespace:DataGrid_Themes" xmlns:syncfusion="http://schemas.syncfusion.com/wpf" - xmlns:syncfusionskin ="clr-namespace:Syncfusion.SfSkinManager;assembly=Syncfusion.SfSkinManager.WPF" + xmlns:syncfusionskin="clr-namespace:Syncfusion.SfSkinManager;assembly=Syncfusion.SfSkinManager.WPF" Icon="App.ico" Title="Getting Started" WindowStartupLocation="CenterScreen" @@ -45,25 +47,22 @@ SfSkinManager.SetTheme(this, new FluentTheme("FluentDark")); ## Reveal animation -The reveal animation for WPF controls can be enabled or disabled using the [HoverEffectMode](https://help.syncfusion.com/cr/wpf/Syncfusion.SfSkinManager.FluentTheme.html#Syncfusion_SfSkinManager_FluentTheme_HoverEffectMode) and [PressedEffectMode](https://help.syncfusion.com/cr/wpf/Syncfusion.SfSkinManager.FluentTheme.html#Syncfusion_SfSkinManager_FluentTheme_PressedEffectMode) properties. +The reveal animation for WPF controls can be enabled or disabled using the [HoverEffectMode](https://help.syncfusion.com/cr/wpf/Syncfusion.SfSkinManager.FluentTheme.html#Syncfusion_SfSkinManager_FluentTheme_HoverEffectMode) and [PressedEffectMode](https://help.syncfusion.com/cr/wpf/Syncfusion.SfSkinManager.FluentTheme.html#Syncfusion_SfSkinManager_FluentTheme_PressedEffectMode) properties. -N> The reveal animation is enabled by default. +N> The reveal animation is enabled by default. ### Hover reveal effect -By using the [HoverEffectMode](https://help.syncfusion.com/cr/wpf/Syncfusion.SfSkinManager.FluentTheme.html#Syncfusion_SfSkinManager_FluentTheme_HoverEffectMode) property, you can enable or disable the reveal animation while hovering over the controls. - -The [HoverEffect](https://help.syncfusion.com/cr/wpf/Syncfusion.SfSkinManager.HoverEffect.html) enum contains following values: - -* `Background` - The hover reveal animation effect will be applied only for control Background. +Use the [HoverEffectMode](https://help.syncfusion.com/cr/wpf/Syncfusion.SfSkinManager.FluentTheme.html#Syncfusion_SfSkinManager_FluentTheme_HoverEffectMode) property to enable or disable the reveal animation while hovering over the controls. -* `BackgroundAndBorder` - The hover reveal animation effect will be applied for both control Border and Background. - -* `Border` - The hover reveal animation effect will be applied only for control Border. +The [HoverEffect](https://help.syncfusion.com/cr/wpf/Syncfusion.SfSkinManager.HoverEffect.html) enum contains the following values: +* `Background` - The hover reveal animation effect will be applied only for the control Background. +* `BackgroundAndBorder` - The hover reveal animation effect will be applied for both the control Border and Background. +* `Border` - The hover reveal animation effect will be applied only for the control Border. * `None` - The hover reveal animation effect will be disabled. -N> The default value is `HoverEffect.BackgroundAndBorder`. +N> The default value is `HoverEffect.BackgroundAndBorder`. {% tabs %} @@ -74,7 +73,7 @@ N> The default value is `HoverEffect.BackgroundAndBorder`. xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:local="clr-namespace:DataGrid_Themes" xmlns:syncfusion="http://schemas.syncfusion.com/wpf" - xmlns:syncfusionskin ="clr-namespace:Syncfusion.SfSkinManager;assembly=Syncfusion.SfSkinManager.WPF" + xmlns:syncfusionskin="clr-namespace:Syncfusion.SfSkinManager;assembly=Syncfusion.SfSkinManager.WPF" Icon="App.ico" Title="Getting Started" WindowStartupLocation="CenterScreen" @@ -86,7 +85,7 @@ N> The default value is `HoverEffect.BackgroundAndBorder`. {% highlight C# %} - SfSkinManager.SetTheme(this, new FluentTheme() { ThemeName = "FluentDark", HoverEffectMode = HoverEffect.Border }); +SfSkinManager.SetTheme(this, new FluentTheme() { ThemeName = "FluentDark", HoverEffectMode = HoverEffect.Border }); {% endhighlight %} @@ -94,15 +93,15 @@ N> The default value is `HoverEffect.BackgroundAndBorder`. ### Pressed effect -The [PressedEffectMode](https://help.syncfusion.com/cr/wpf/Syncfusion.SfSkinManager.FluentTheme.html#Syncfusion_SfSkinManager_FluentTheme_PressedEffectMode) property can be used to enable or disable the reveal animation when a control is pressed with the mouse or a touch. +The [PressedEffectMode](https://help.syncfusion.com/cr/wpf/Syncfusion.SfSkinManager.FluentTheme.html#Syncfusion_SfSkinManager_FluentTheme_PressedEffectMode) property can be used to enable or disable the reveal animation when a control is pressed with the mouse or touch. The [PressedEffect](https://help.syncfusion.com/cr/wpf/Syncfusion.SfSkinManager.PressedEffect.html) enum contains the following values: -* `Glow` - The glow animation effect will be applied when pressed with the mouse or touch. -* `Reveal` - The reveal animation effect will be applied when pressed with the mouse or touch. -* `None` - The pressed animation effect will be disabled. +* `Glow` - Applies a glow animation effect when pressed. +* `Reveal` - Applies a reveal animation effect when pressed. +* `None` - Disables the pressed animation effect. -N> The default value is `PressedEffect.Reveal`. +N> The default value is `PressedEffect.Reveal`. {% tabs %} @@ -113,7 +112,7 @@ N> The default value is `PressedEffect.Reveal`. xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:local="clr-namespace:DataGrid_Themes" xmlns:syncfusion="http://schemas.syncfusion.com/wpf" - xmlns:syncfusionskin ="clr-namespace:Syncfusion.SfSkinManager;assembly=Syncfusion.SfSkinManager.WPF" + xmlns:syncfusionskin="clr-namespace:Syncfusion.SfSkinManager;assembly=Syncfusion.SfSkinManager.WPF" Icon="App.ico" Title="Getting Started" WindowStartupLocation="CenterScreen" @@ -125,7 +124,7 @@ N> The default value is `PressedEffect.Reveal`. {% highlight C# %} - SfSkinManager.SetTheme(this, new FluentTheme() { ThemeName = "FluentDark", PressedEffectMode = PressedEffect.Reveal }); +SfSkinManager.SetTheme(this, new FluentTheme() { ThemeName = "FluentDark", PressedEffectMode = PressedEffect.Reveal }); {% endhighlight %} @@ -133,15 +132,31 @@ N> The default value is `PressedEffect.Reveal`. ## Acrylic window background -The transparent blurred acrylic background can be enabled or disabled for windows using the [ShowAcrylicBackground](https://help.syncfusion.com/cr/wpf/Syncfusion.SfSkinManager.FluentTheme.html#Syncfusion_SfSkinManager_FluentTheme_ShowAcrylicBackground) property. +A translucent blurred acrylic background can be enabled or disabled for windows using the [ShowAcrylicBackground](https://help.syncfusion.com/cr/wpf/Syncfusion.SfSkinManager.FluentTheme.html#Syncfusion_SfSkinManager_FluentTheme_ShowAcrylicBackground) property. N> The default value is `false`. - {% tabs %} +{% highlight XAML %} + + + + + +{% endhighlight %} + {% highlight C# %} - SfSkinManager.SetTheme(this, new FluentTheme() { ThemeName = "FluentDark", ShowAcrylicBackground = true }); +SfSkinManager.SetTheme(this, new FluentTheme() { ThemeName = "FluentDark", ShowAcrylicBackground = true }); {% endhighlight %} diff --git a/wpf/Themes/Skin-Manager.md b/wpf/Themes/Skin-Manager.md index e17d00fd3..7db32acf4 100644 --- a/wpf/Themes/Skin-Manager.md +++ b/wpf/Themes/Skin-Manager.md @@ -8,7 +8,7 @@ documentation: ug --- # Getting Started with WPF Skin Manager -The [SfSkinManager](https://help.syncfusion.com/cr/wpf/Syncfusion.SfSkinManager.SfSkinManager.html) helps you to apply the themes for both Syncfusion® and Framework controls. +The [SfSkinManager](https://help.syncfusion.com/cr/wpf/Syncfusion.SfSkinManager.SfSkinManager.html) helps you apply themes for both Syncfusion® and Framework controls. ## Themes list @@ -124,7 +124,7 @@ Syncfusion.Themes.SystemTheme.Wpf.dll
Assembly references
-## Apply a theme to a control +## Apply a Theme to a Control ### Add SkinManager reference @@ -151,14 +151,14 @@ There are several ways to include the Syncfusion® [SfSkinManager] ### Add a theme assembly reference -The [SfSkinManager](https://help.syncfusion.com/cr/wpf/Syncfusion.SfSkinManager.SfSkinManager.html) supports to apply themes listed in [themes list](https://help.syncfusion.com/wpf/themes/skin-manager#themes-list). To use a theme in the application, add Reference to the corresponding theme assembly. For example, to apply `Windows11Light` theme, attach `Syncfusion.Themes.Windows11Light.Wpf` assembly or [NuGet](https://www.nuget.org/packages/Syncfusion.Themes.Windows11Light.WPF/) reference to the project. While applying a theme to a Window, SkinManager inherits the same theme to all the elements inside the Window. +The [SfSkinManager](https://help.syncfusion.com/cr/wpf/Syncfusion.SfSkinManager.SfSkinManager.html) supports applying themes listed in [themes list](https://help.syncfusion.com/wpf/themes/skin-manager#themes-list). To use a theme in the application, add Reference to the corresponding theme assembly. For example, to apply `Windows11Light` theme, attach `Syncfusion.Themes.Windows11Light.Wpf` assembly or [NuGet](https://www.nuget.org/packages/Syncfusion.Themes.Windows11Light.WPF/) reference to the project. While applying a theme to a Window, SkinManager inherits the same theme to all the elements inside the Window. ![Add theme assembly reference](Skin-Manager_images/Add-Windows11Light-Theme-Assembly-Reference.png) ### Set theme -Themes will be applied to both Syncfusion® and Framework controls by using [Theme](https://help.syncfusion.com/cr/wpf/Syncfusion.SfSkinManager.SfSkinManager.html#Syncfusion_SfSkinManager_SfSkinManager_ThemeProperty) attached property of the [SfSkinManager](https://help.syncfusion.com/cr/wpf/Syncfusion.SfSkinManager.SfSkinManager.html). Also Ensure that the `ApplyThemeAsDefaultStyle` property is set to `true` before calling the SetTheme method +Themes will be applied to both Syncfusion® and Framework controls by using [Theme](https://help.syncfusion.com/cr/wpf/Syncfusion.SfSkinManager.SfSkinManager.html#Syncfusion_SfSkinManager_SfSkinManager_ThemeProperty) attached property of the [SfSkinManager](https://help.syncfusion.com/cr/wpf/Syncfusion.SfSkinManager.SfSkinManager.html). Also ensure that the `ApplyThemeAsDefaultStyle` property is set to `true` before calling the SetTheme method. N> While applying the theme to a Window or any element, `SkinManager` inherits the same theme to all its descendants. @@ -190,7 +190,7 @@ N> While applying the theme to a Window or any element, `SkinManager` inherits t ItemsSource="{Binding EmployeeDetails}"> - + {% endhighlight %} @@ -207,7 +207,7 @@ SfSkinManager.SetTheme(this, new Theme("Windows11Light")); N> [View sample in GitHub](https://github.com/SyncfusionExamples/wpf-themes-demo-using-skinmanager). -## Apply a theme globally in the application +## Apply a Theme Globally in the Application To apply a theme globally in an application, set the theme using `ApplicationTheme` attached property of the SfSkinManager in the constructor of your MainWindow. This ensures that the selected theme is automatically applied to any new windows when they are loaded. @@ -215,7 +215,7 @@ If you set the theme using the `ApplicationTheme` attached property of [SfSkinMa Also ensure that the `ApplyThemeAsDefaultStyle` property is set to `true` -N> The `SfSkinManager.ApplicationTheme` static property should be set before `InitializeComponent` of the window or during application start up, when applying for multiple windows. +N> The `SfSkinManager.ApplicationTheme` static property should be set before `InitializeComponent` of the window or during application startup, when applying for multiple windows. {% tabs %} @@ -239,13 +239,13 @@ public partial class MainWindow : Window ## Customization -### Customize theme colors and fonts in the application +### Customize Theme Colors and Fonts in the Application To customize the theme colors and fonts in the application, call [RegisterThemeSettings](https://help.syncfusion.com/cr/wpf/Syncfusion.SfSkinManager.SfSkinManager.html#Syncfusion_SfSkinManager_SfSkinManager_RegisterThemeSettings_System_String_Syncfusion_SfSkinManager_IThemeSetting_) method and pass the theme name and respective theme setting instance as parameters. -Each theme supported by the theme studio has its own theme settings class, which begins with the prefix of the themes' name. For example, if the theme name is `Windows11Light`, then there will be theme settings class called `Windows11LightThemeSettings`. +Each theme supported by the theme studio has its own theme settings class, which begins with the theme name as a prefix. For example, if the theme name is `Windows11Light`, then there will be theme settings class called `Windows11LightThemeSettings`. -N> Need to register theme settings before setting respective themes for window or control. +N> You need to register theme settings before setting respective themes for window or control. Please find the complete list of theme names, respective theme settings class, and supported palette. @@ -515,13 +515,31 @@ In the example below, a ComboBox is used to toggle between the Windows11Light an {% highlight XAML %} - - - + + + + + + + + + {% endhighlight %} +{% highlight C# %} + +private void themeCombo_SelectionChanged(object sender, SelectionChangedEventArgs e) +{ + if (themeCombo.SelectedIndex == 0) + SfSkinManager.SetTheme(this, new Theme("Windows11Light")); + else if (themeCombo.SelectedIndex == 1) + SfSkinManager.SetTheme(this, new Theme("Windows11Dark")); +} + +{% endhighlight %} + {% endtabs %} This creates two buttons styled dynamically based on the active theme. One reflects an error state background; the other adopts the primary button style. @@ -548,7 +566,7 @@ The StyleVariant attached property is used to apply theme styles automatically b xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:syncfusionskin ="clr-namespace:Syncfusion.SfSkinManager;assembly=Syncfusion.SfSkinManager.WPF" - xmlns:syncfusion="http://schemas.syncfusion.com/wpf" /> + xmlns:syncfusion="http://schemas.syncfusion.com/wpf" >