|
|
|
|
|
- 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, ... field (WPF) by programming
Attention: The Xaml field present until WINDEV 15 is now called the .NET 3.0, 4.0, ... field. (WPF) FIELD.. In this documentation, we will be using the term of ".Net control (WPF)".WINDEV lets you manipulate a DotNet (WPF) field programmatically. 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. When theOK button is clicked, the "ProcedureClic" procedure is executed and displays "Click OK button". // -- 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 PROCÉDURE 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.
DOTNET_Xaml_OK = [
OK
]
Info("Control name: ", XamlProperty(DOTNET_Xaml_OK, "ButtonOK", "Name"))
Info("Font size: ", XamlProperty(DOTNET_Xaml_OK, "ButtonOK", "FontSize"))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|