using cAlgo.API;
namespace cAlgo
{
// この例は、RadioButtonEventArgs の使用方法を示しています
[Indicator(IsOverlay = true, TimeZone = TimeZones.UTC, AccessRights = AccessRights.None)]
public class RadioButtonEventArgsSample : Indicator
{
protected override void Initialize()
{
var firstRadioButton = new RadioButton
{
Text = "First Radio Button"
};
firstRadioButton.Checked += RadioButton_Changed;
firstRadioButton.Unchecked += RadioButton_Changed;
var secondRadioButton = new RadioButton
{
Text = "Second Radio Button"
};
secondRadioButton.Checked += RadioButton_Changed<span="p">;
secondRadioButton.Unchecked += RadioButton_Changed;
var panel = new StackPanel
{
Orientation = Orientation.Vertical<span="p">,
HorizontalAlignment = HorizontalAlignment.Center<span="p">,
VerticalAlignment = VerticalAlignment<span="p">.Center<span="p">,
};
panel.AddChild(firstRadioButton<span="p">);
panel<span="p">.AddChild<span="p">(secondRadioButton<span="p">);
Chart.AddControl(panel<span="p">);
<span="p">}
private void RadioButton_Changed(RadioButtonEventArgs obj<span="p">)
{
var state = obj.RadioButton<span="p">.IsChecked ? "Checked" : "Unchecked"<span="p">;
obj<span="p">.RadioButton<span="p">.Text = state<span="p">;
}
public <span