IsEnabled
Introduction
Code Example - Disabling a Control
// Initialize
var button = new Button();
button.AddToRoot();
button.Text = "Purchase";
button.Width = 150;
button.Height = 40;
// Disable the button so it cannot be clicked
button.IsEnabled = false;Cascading to Child Controls
// Initialize
var panel = new StackPanel();
panel.AddToRoot();
panel.Width = 200;
panel.Height = 120;
var button1 = new Button();
button1.Text = "Button 1";
button1.Width = 180;
button1.Height = 40;
panel.AddChild(button1);
var button2 = new Button();
button2.Text = "Button 2";
button2.Width = 180;
button2.Height = 40;
panel.AddChild(button2);
// Disabling the parent panel disables all child controls
panel.IsEnabled = false;Visual State Change
Last updated
Was this helpful?

