Example #1
0
        /// <summary>
        ///     Radio Menu when a value is changed.
        /// </summary>
        /// <param name="sender">
        ///     The sender
        /// </param>
        /// <param name="args">
        ///     The event data
        /// </param>
        private void RadioMenuValueChanged(object sender, MenuValueChangedEventArgs args)
        {
            try
            {
                var menuBool = args.MenuItem as MenuBool;

                if (menuBool != null && menuBool.Value)
                {
                    foreach (var comp in this.Components)
                    {
                        var child = comp.Value as MenuBool;
                        if (child != null && child.Name != menuBool.Name)
                        {
                            child.Value = false;
                        }
                    }
                }
            }
            catch (Exception e)
            {
                Console.WriteLine(e.ToString());
            }
        }
        /// <summary>
        ///     Radio Menu when a value is changed.
        /// </summary>
        /// <param name="sender">
        ///     The sender
        /// </param>
        /// <param name="args">
        ///     The event data
        /// </param>
        private void RadioMenuValueChanged(object sender, MenuValueChangedEventArgs args)
        {
            try
            {
                var menuBool = args.MenuItem as MenuBool;

                if (menuBool != null && menuBool.Value)
                {
                    foreach (var comp in this.Components)
                    {
                        var child = comp.Value as MenuBool;
                        if (child != null && child.Name != menuBool.Name)
                        {
                            child.Value = false;
                        }
                    }
                }
            }
            catch (Exception e)
            {
                Console.WriteLine(e.ToString());
            }
        }