|
|
|
|
- Overview
- Associating some WLanguage procedures with an event of a ".Net control (WPF)"
- Finding out or modifying the value of a .NET property of a .Net control (WPF)
Handling a .NET 3.0, 4.0 control, ... (WPF) through programming
Caution: The Xaml control found in the earlier WINDEV versions (up to version 15) is now called the .NET 3.0, 4.0 control, ... (WPF). In this documentation, we will be using the term of ".Net control (WPF)".WINDEV enables you to handle a .Net control (WPF) through programming. To do so, use the control variable in the code. The variable of the.Net control (WPF) corresponds to the name of the.Net control (WPF). The Net control (WPF) uses the XamlXXX functions. Associating some WLanguage procedures with an event of a ".Net control (WPF)" To associate a procedure written in WLanguage with a specific event of a.Net control (WPF), use XamlEvent. The following example is used to associate a procedure with the click event of the "OKButton" button. During a click on the OKButton button, the "ClickProcedure" procedure will be run and it will display "The OK button was clicked". // -- Initialization code of "DOTNET_Xaml_OK" DOTNET_Xaml_OK = [ OK ] // Associate the "ClickProcedure" procedure // with the "Click" event on the "OKButton" button XamlEvent(DOTNET_Xaml_OK, "OKButton", "Click", ClickProcedure)
// -- ClickProcedure procedure PROCEDURE ClickProcedure Info("The OK button was clicked")
Finding out or modifying the value of a .NET property of a .Net control (WPF) To get or modify the value of a property, use the XamlPropertyfunction. The following example is used to display the "Name" and "FontSize" properties of the control, that respectively define the name of the control and the size of the font for this control. // -- Initialization code of "DOTNET_Xaml_OK" DOTNET_Xaml_OK = [ OK ] // Display the values of the "Name" and "FontSize" properties Info("Name of control: ", XamlProperty(DOTNET_Xaml_OK, "OKButton", "Name")) Info("Size of font: ", XamlProperty(DOTNET_Xaml_OK, "OKButton", "FontSize"))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|