Exemplo n.º 1
0
        public static object GetCommandParameter(this ImageToggleButton button)
        {
            var innerButtonField = button.GetType().GetField("innerButton", BindingFlags.Instance | BindingFlags.NonPublic);
            var innerButton      = innerButtonField.GetValue(button) as Button;

            return(innerButton.CommandParameter);
        }
Exemplo n.º 2
0
        public static void SetCommandParameter(this ImageToggleButton button, object commandParameter)
        {
            var innerButtonField = button.GetType().GetField("toggleInnerButton", BindingFlags.Instance | BindingFlags.NonPublic);
            var innerButton      = innerButtonField.GetValue(button) as System.Windows.Controls.Primitives.ToggleButton;

            innerButton.CommandParameter = commandParameter;
        }