Example #1
0
        private static object OnCoerceEditModeProperty(DependencyObject obj, object value)
        {
            EditModeSwitchButton modeSwitchButton = (EditModeSwitchButton)obj;

            if (!modeSwitchButton.SyncModeToOwningContainer || modeSwitchButton._owningContainer == null)
            {
                return(value);
            }
            PropertyContainer         propertyContainer = modeSwitchButton._owningContainer;
            PropertyContainerEditMode containerEditMode;

            switch (propertyContainer.ActiveEditMode)
            {
            case PropertyContainerEditMode.Inline:
                containerEditMode = !propertyContainer.SupportsEditMode(PropertyContainerEditMode.Dialog) ? (!propertyContainer.SupportsEditMode(PropertyContainerEditMode.ExtendedPopup) ? PropertyContainerEditMode.Inline : PropertyContainerEditMode.ExtendedPopup) : PropertyContainerEditMode.Dialog;
                break;

            case PropertyContainerEditMode.ExtendedPopup:
                containerEditMode = PropertyContainerEditMode.ExtendedPinned;
                break;

            case PropertyContainerEditMode.ExtendedPinned:
                containerEditMode = PropertyContainerEditMode.Inline;
                break;

            case PropertyContainerEditMode.Dialog:
                containerEditMode = modeSwitchButton.TargetEditMode;
                break;

            default:
                containerEditMode = (PropertyContainerEditMode)value;
                break;
            }
            return((object)containerEditMode);
        }
Example #2
0
 public void Invoke()
 {
     EditModeSwitchButton button = (EditModeSwitchButton)this.Owner;
     //button.Dispatcher.BeginInvoke((Delegate) (() => button.InvokePropertyValueEditorCommand()));
 }
Example #3
0
 public EditModeSwitchButtonAutomationPeer(EditModeSwitchButton owner)
     : base((Button)owner)
 {
 }