This section describes adding the C1ToggleButton control to your portable or shared application and changing color of the control on the basis of change in state of the control.
Complete the following steps to change color of the control on changing its state.
C# |
Copy Code
|
---|---|
public override void ViewDidLoad() { base.ViewDidLoad(); C1ToggleButton tb = new C1ToggleButton(); if (tb.IsChecked == true) { tb.BackgroundColor = UIColor.Green; } else if (tb.IsChecked == false) { tb.BackgroundColor = UIColor.Red; } } |
Press F5 to run your application