Common Component Types
Introduction
StackPanel

Label



Button



CheckBox


ComboBox

Variable
Value
Variable
Value


ListBox


Menu and MenuItem





RadioButton



Slider


TextBox


Conclusion
Last updated
Was this helpful?
Was this helpful?
partial class TitleScreen
{
partial void CustomInitialize()
{
LabelInstance.Text = "I am set in code";
}
}partial class TitleScreen
{
partial void CustomInitialize()
{
+ LabelInstance.Text = "I am set in code";
}
}partial class TitleScreen
{
int clickCount = 0;
partial void CustomInitialize()
{
LabelInstance.Text = "I am set in code";
ButtonStandardInstance.Click += (_, _) =>
ButtonStandardInstance.Text = $"Clicked {++clickCount} Time(s)";
}
}partial class TitleScreen
{
+ int clickCount = 0;
partial void CustomInitialize()
{
LabelInstance.Text = "I am set in code";
+ ButtonStandardInstance.Click += (_, _) =>
+ ButtonStandardInstance.Text = $"Clicked {++clickCount} Time(s)";
}
}partial void CustomInitialize()
{
CheckBoxInstance.Click += (_, _) =>
{
CheckBoxInstance.Text = CheckBoxInstance.IsChecked == true
? "Checked"
: CheckBoxInstance.IsChecked == false
? "Unchecked"
: "Indeterminate";
};
}partial void CustomInitialize()
{
+ CheckBoxInstance.Click += (_, _) =>
+ {
+ CheckBoxInstance.Text = CheckBoxInstance.IsChecked == true
+ ? "Checked"
+ : CheckBoxInstance.IsChecked == false
+ ? "Unchecked"
+ : "Indeterminate";
+ };
}partial void CustomInitialize()
{
for(int i = 0; i < 10; i++)
{
ComboBoxInstance.Items.Add($"Item {i}");
}
ComboBoxInstance.SelectionChanged += (_, _) =>
{
var selectedObject = ComboBoxInstance.SelectedObject;
System.Diagnostics.Debug.WriteLine($"Selected object: {selectedObject}");
};
}partial void CustomInitialize()
{
+ for(int i = 0; i < 10; i++)
+ {
+ ComboBoxInstance.Items.Add($"Item {i}");
+ }
+ ComboBoxInstance.SelectionChanged += (_, _) =>
+ {
+ var selectedObject = ComboBoxInstance.SelectedObject;
+ System.Diagnostics.Debug.WriteLine($"Selected object: {selectedObject}");
+ };
}partial void CustomInitialize()
{
for(int i = 0; i < 10; i++)
{
ListBoxInstance.Items.Add($"Item {i}");
}
ListBoxInstance.SelectionChanged += (_, _) =>
{
var selectedObject = ListBoxInstance.SelectedObject;
System.Diagnostics.Debug.WriteLine($"Selected object: {selectedObject}");
};
}partial void CustomInitialize()
{
+ for(int i = 0; i < 10; i++)
+ {
+ ListBoxInstance.Items.Add($"Item {i}");
+ }
+ ListBoxInstance.SelectionChanged += (_, _) =>
+ {
+ var selectedObject = ListBoxInstance.SelectedObject;
+ System.Diagnostics.Debug.WriteLine($"Selected object: {selectedObject}");
+ };
}partial void CustomInitialize()
{
MenuItemInstance3.Clicked += (_, _) =>
System.Diagnostics.Debug.WriteLine("Menu Item Clicked");
}partial void CustomInitialize()
{
+ MenuItemInstance3.Clicked += (_, _) =>
+ System.Diagnostics.Debug.WriteLine("Menu Item Clicked");
}partial void CustomInitialize()
{
RadioButtonInstance.Checked += (_, _) =>
System.Diagnostics.Debug.WriteLine("Option 1 Checked");
RadioButtonInstance1.Checked += (_, _) =>
System.Diagnostics.Debug.WriteLine("Option 2 Checked");
RadioButtonInstance2.Checked += (_, _) =>
System.Diagnostics.Debug.WriteLine("Option 3 Checked");
}partial void CustomInitialize()
{
+ RadioButtonInstance.Checked += (_, _) =>
+ System.Diagnostics.Debug.WriteLine("Option 1 Checked");
+ RadioButtonInstance1.Checked += (_, _) =>
+ System.Diagnostics.Debug.WriteLine("Option 2 Checked");
+ RadioButtonInstance2.Checked += (_, _) =>
+ System.Diagnostics.Debug.WriteLine("Option 3 Checked");
}partial void CustomInitialize()
{
SliderInstance.Minimum = 0;
SliderInstance.Maximum = 100;
SliderInstance.ValueChanged += (_, _) =>
System.Diagnostics.Debug.WriteLine($"Slider Value: {SliderInstance.Value}");
}partial void CustomInitialize()
{
+ SliderInstance.Minimum = 0;
+ SliderInstance.Maximum = 100;
+ SliderInstance.ValueChanged += (_, _) =>
+ System.Diagnostics.Debug.WriteLine($"Slider Value: {SliderInstance.Value}");
}partial void CustomInitialize()
{
TextBoxInstance.TextChanged += (_,_) =>
System.Diagnostics.Debug.WriteLine($"TextBox text: '{TextBoxInstance.Text}'");
}partial void CustomInitialize()
{
+ TextBoxInstance.TextChanged += (_,_) =>
+ System.Diagnostics.Debug.WriteLine($"TextBox text: '{TextBoxInstance.Text}'");
}