Task - Binding Event Handlers to Events
You can download the base project by cloning the Github Repository.
The XAML file has 3 elements:
- "mainLabel", representing a Label, and text set to "Hello World".
- "sizeSlider", representing a Slider, with Minimum and Maximum values set to 10 and 100 respectively. The default value is 10.
- "setSizeBtn", representing a Button.
Your task is to bind the button's Clicked event handler to an event handler method which sets the FontSize property of the label to the value of the slider.
You only have to modify the C# file.
In summary, you will have to write the code for:
- A new method called
SetSizeand it should have the same signature as the EventHandler. - The method should set the
FontSizeproperty equal to theValueproperty of the slider. - Adding the
SetSizemethod to theClickedevent handler of the button element.
Bedankt voor je feedback!
Vraag AI
Vraag AI
Vraag wat u wilt of probeer een van de voorgestelde vragen om onze chat te starten.
Stel mij vragen over dit onderwerp
Vat dit hoofdstuk samen
Toon voorbeelden uit de praktijk
Awesome!
Completion rate improved to 3.7
Task - Binding Event Handlers to Events
Veeg om het menu te tonen
You can download the base project by cloning the Github Repository.
The XAML file has 3 elements:
- "mainLabel", representing a Label, and text set to "Hello World".
- "sizeSlider", representing a Slider, with Minimum and Maximum values set to 10 and 100 respectively. The default value is 10.
- "setSizeBtn", representing a Button.
Your task is to bind the button's Clicked event handler to an event handler method which sets the FontSize property of the label to the value of the slider.
You only have to modify the C# file.
In summary, you will have to write the code for:
- A new method called
SetSizeand it should have the same signature as the EventHandler. - The method should set the
FontSizeproperty equal to theValueproperty of the slider. - Adding the
SetSizemethod to theClickedevent handler of the button element.
Bedankt voor je feedback!