Skip to content

Commit c740c65

Browse files
Merge pull request #1520 from Syncfusion-Content/hotfix/hotfix-v27.1.48
DOCINFRA-2341_merged_using_automation
2 parents 5944717 + daff0de commit c740c65

File tree

5 files changed

+49
-4
lines changed

5 files changed

+49
-4
lines changed

wpf/Docking/Pattern-and-Practices.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ documentation: ug
1010

1111
## MVVM
1212

13-
This section explains how to adapt the Syncfusion docking manager to an MVVM application. Since the WPF DockingManager is not an Items Control, it is not possible to have a traditional [ItemsSource](https://docs.microsoft.com/en-us/dotnet/api/system.windows.controls.itemscontrol.itemssource?view=netframework-4.7.2) binding to a collection of objects in the view model. However this can be achieved by creating a wrapper or adapter for the DockingManager.
13+
This section explains how to adapt the Syncfusion docking manager to an MVVM application. Since the WPF DockingManager is not an Items Control, it is not possible to have a traditional [ItemsSource](https://learn.microsoft.com/en-us/dotnet/api/system.windows.controls.itemscontrol.itemssource?view=netframework-4.7.2) binding to a collection of objects in the view model. However this can be achieved by creating a wrapper or adapter for the DockingManager.
1414

1515
Here a simple text-reader application is used to demonstrate this approach.
1616

@@ -27,7 +27,7 @@ Here a simple text-reader application is used to demonstrate this approach.
2727

2828

2929
### Docking Adapter
30-
The adapter is simply a user control that contains DockingManager as its content. The adapter has two properties — ItemsSource and ActiveDocument. Binding a collection of objects to the [ItemsSource](https://docs.microsoft.com/en-us/dotnet/api/system.windows.controls.itemscontrol.itemssource?view=netframework-4.7.2) property triggers a collection change where the adapter creates a corresponding Framework element, example: ContentControl in the DockingManager, setting the underlying data context of the control to the business model.
30+
The adapter is simply a user control that contains DockingManager as its content. The adapter has two properties — ItemsSource and ActiveDocument. Binding a collection of objects to the [ItemsSource](https://learn.microsoft.com/en-us/dotnet/api/system.windows.controls.itemscontrol.itemssource?view=netframework-4.7.2) property triggers a collection change where the adapter creates a corresponding Framework element, example: ContentControl in the DockingManager, setting the underlying data context of the control to the business model.
3131

3232
{% tabs %}
3333

@@ -54,14 +54,14 @@ The adapter user control also determines the state of the element, whether it sh
5454

5555
The adapter can be further customized to add elements as floating or auto-hidden.
5656

57-
The DockingManager provides an [ActiveWindowChanged](https://help.syncfusion.com/cr/wpf/Syncfusion.Windows.Tools.Controls.DockingManager.html) event. Using this, the [ActiveDocument](https://help.syncfusion.com/cr/wpf/Syncfusion.Windows.Tools.Controls.DocumentContainer.html#Syncfusion_Windows_Tools_Controls_DocumentContainer_ActiveDocument) property in the adapter needs to be updated every time focus changes to other panes.
57+
The DockingManager provides an [ActiveWindowChanged](https://help.syncfusion.com/cr/wpf/Syncfusion.Windows.Tools.Controls.DockingManager.html#Syncfusion_Windows_Tools_Controls_DockingManager_ActiveWindowChanged) event. Using this, the [ActiveDocument](https://help.syncfusion.com/cr/wpf/Syncfusion.Windows.Tools.Controls.DocumentContainer.html#Syncfusion_Windows_Tools_Controls_DocumentContainer_ActiveDocument) property in the adapter needs to be updated every time focus changes to other panes.
5858

5959
### Application structure
6060

6161
![WPF Docking Application Structure](PatternandPractices_images/wpf-docking-application-structure.jpeg)
6262

6363

64-
The view model has a collection of workspaces that is data-bound to the [ItemsSource](https://docs.microsoft.com/en-us/dotnet/api/system.windows.controls.itemscontrol.itemssource?view=netframework-4.7.2) property of the docking adapter. The adapter transforms the particular view model or business object into a corresponding dock element in the DockingManager.
64+
The view model has a collection of workspaces that is data-bound to the [ItemsSource](https://learn.microsoft.com/en-us/dotnet/api/system.windows.controls.itemscontrol.itemssource?view=netframework-4.7.2) property of the docking adapter. The adapter transforms the particular view model or business object into a corresponding dock element in the DockingManager.
6565

6666
Every dock element in the application is a workspace. There are three kinds of workspaces: the All Documents view, the Properties view, and the Document view. The docking adapter hooks up the “active window changed” event of the docking manager; the view model receives the message whenever the active document is changed.
6767

wpf/Licensing/licensing-faq/CI-license-validation.md

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,3 +147,48 @@ bool isValid = SyncfusionLicenseProvider.ValidateLicense(Platform.WPF);
147147

148148
* If the ValidateLicense() method returns false, there will be invalid license errors in deployment due to either an invalid license key or an incorrect assembly or package version that is referenced in the project. Please ensure that all the referenced Syncfusion assemblies or NuGet packages are all on the same version as the license key’s version before deployment.
149149

150+
## Validate the License Key By Using the Unit Test Project
151+
152+
* To create a unit test project in Visual Studio, choose **File -> New -> Project** from the menu. This opens a new dialog for creating a new project. Filtering the project type by Test or typing Test as a keyword in the search option can help you to find available unit test projects. Select the appropriate test framework (such as MSTest, NUnit, or xUnit) that best suits your need.
153+
154+
![Unit Test Projects](licensing-images/unit-test-projects.png)
155+
156+
* For more details on creating unit test projects in Visual Studio, refer to the [Getting Started with Unit Testing guide](https://learn.microsoft.com/en-us/visualstudio/test/getting-started-with-unit-testing?view=vs-2022&tabs=dotnet%2Cmstest#create-unit-tests).
157+
158+
* Register the license key by calling the RegisterLicense("Your License Key") method with the license key in the unit test project.
159+
160+
N> * Place the license key between double quotes. Also, ensure that Syncfusion.Licensing.dll is referenced in your project where the license key is being registered.
161+
162+
* Once the license key is registered, it can be validated by using the ValidateLicense("Platform.WPF", out var validationMessage) method. This ensures that the license key is valid for the platform and version you are using.
163+
164+
* For reference, please check the following example that demonstrates how to register and validate the license key in the unit test project.
165+
166+
{% tabs %}
167+
{% highlight c# %}
168+
public void TestSyncfusionWPFLicense()
169+
{
170+
var platform = Platform.WPF;
171+
// Register the Syncfusion license key
172+
SyncfusionLicenseProvider.RegisterLicense("Your License Key");
173+
174+
bool isValidLicense = SyncfusionLicenseProvider.ValidateLicense(platform, out var validationMessage);
175+
Assert.That(isValidLicense, Is.True, $"Validation failed for {platform}." + $" Validation Message: {validationMessage}");
176+
177+
// Log validation messages to TestContext output
178+
if (isValidLicense)
179+
{
180+
TestContext.Out.WriteLine($"Platform {platform} is correctly licensed for version " + $"{typeof(SyncfusionLicenseProvider).Assembly.GetName().Version}");
181+
}
182+
}
183+
{% endhighlight %}
184+
{% endtabs %}
185+
186+
* Once the unit test is executed, if the license key validation passes for the specified platform, the output similar to the following will be displayed in the Test Explorer window.
187+
188+
![License Validation Success Message](licensing-images/unit-test-success-message.png)
189+
190+
* If the license validation fails during unit testing, the following output will be displayed in the Test Explorer window.
191+
192+
![License Validation Failure Message](licensing-images/unit-test-failure-message.png)
193+
194+
* License validation fails due to either an invalid license key or an incorrect assembly or package version that is referenced in the project. In such cases, verify that you are using the valid license key for the platform, and ensure the assembly or package versions referenced in the project match the version of the license key.
Loading
Loading
Loading

0 commit comments

Comments
 (0)