Example #1
0
        public override void OnApplyTemplate()
        {
            base.OnApplyTemplate();

            True = (RadioButton)GetTemplateChild("PART_True");
            True.SetBinding(RadioButton.IsCheckedProperty, new Binding {
                Source = this, Path = new PropertyPath(CurrentValueProperty), Mode = BindingMode.TwoWay
            });
            True.Checked += Checked;
            False         = (RadioButton)GetTemplateChild("PART_False");
            False.SetBinding(RadioButton.IsCheckedProperty, new Binding {
                Source = this, Path = new PropertyPath(CurrentValueProperty), Mode = BindingMode.TwoWay, Converter = new BooleanReverseValueConverter()
            });
            False.Checked += Checked;
        }