Exemplo n.º 1
0
        /// <inheritdoc/>
        protected override void OnChecked()
        {
            var parent = LogicalTreeHelper.GetParent(this);

            if (parent != null)
            {
                var children = LogicalTreeHelper.GetChildrenCount(parent);
                for (int i = 0; i < children; i++)
                {
                    var sibling = LogicalTreeHelper.GetChild(parent, i);
                    if (sibling == this)
                    {
                        continue;
                    }

                    var radioButton = sibling as RadioButton;
                    if (radioButton == null)
                    {
                        continue;
                    }

                    radioButton.IsChecked = false;
                }
            }

            base.OnChecked();
        }