상속: System.Windows.DependencyObject
        public static ActivityDesignerToggle Create(string collapseImageSourceUri, string collapseToolTip, string expandImageSourceUri, string expandToolTip, string automationID, DependencyObject target, DependencyProperty dp, bool autoReset = false)
        {
            var toggle = new ActivityDesignerToggle
            {
                CollapseImageSourceUri = collapseImageSourceUri,
                CollapseToolTip        = collapseToolTip,
                ExpandImageSourceUri   = expandImageSourceUri,
                ExpandToolTip          = expandToolTip,
                Image        = CreateImage(expandImageSourceUri),
                ToolTip      = expandToolTip,
                AutomationID = automationID,
                AutoReset    = autoReset
            };

            if (target != null && dp != null)
            {
                BindingOperations.SetBinding(target, dp, new Binding("IsChecked")
                {
                    Source = toggle,
                    Mode   = BindingMode.TwoWay
                });
            }

            return(toggle);
        }
예제 #2
0
        protected virtual void OnToggleCheckedChanged(string propertyName, bool isChecked)
        {
            if (this is ServiceDesignerViewModel && propertyName == "ShowLarge")
            {
                if (isChecked)
                {
                    ActivityDesignerToggle activityDesignerToggle = TitleBarToggles.FirstOrDefault(c => c.AutomationID == "HelpToggle");
                    if (activityDesignerToggle == null)
                    {
                        //AddTitleBarHelpToggle();
                    }
                }
                else
                {
                    RemoveHelpToggle();
                }
            }

            var isSelectedOrMouseOver = IsSelectedOrMouseOver;
            var showSmall             = ShowSmall;

            ThumbVisibility     = isSelectedOrMouseOver && !showSmall ? Visibility.Visible : Visibility.Collapsed;
            ConnectorVisibility = isSelectedOrMouseOver && showSmall ? Visibility.Visible : Visibility.Collapsed;

            if (!isChecked)
            {
                PreviousView = propertyName;
            }
            ClearErrors();
        }
예제 #3
0
        protected void AddTitleBarQuickVariableInputToggle()
        {
            var toggle = ActivityDesignerToggle.Create("pack://application:,,,/Dev2.Activities.Designers;component/Images/ServiceQuickVariableInput-32.png", "Close Quick Variable Input", "pack://application:,,,/Dev2.Activities.Designers;component/Images/ServiceQuickVariableInput-32.png", "Open Quick Variable Input", "QuickVariableInputToggle", this, ShowQuickVariableInputProperty
                                                       );

            TitleBarToggles.Add(toggle);
        }
예제 #4
0
        protected void AddTitleBarHelpToggle()
        {
            var toggle = ActivityDesignerToggle.Create("pack://application:,,,/Dev2.Activities.Designers;component/Images/ServiceHelp-32.png", "Close Help", "pack://application:,,,/Dev2.Activities.Designers;component/Images/ServiceHelp-32.png", "Open Help", "HelpToggle", this, ShowHelpProperty
                                                       );

            TitleBarToggles.Add(toggle);
        }
예제 #5
0
        public static ActivityDesignerToggle Create(string collapseImageSourceUri, string collapseToolTip, string expandImageSourceUri, string expandToolTip, string automationID, DependencyObject target, DependencyProperty dp, bool autoReset = false)
        {
            var toggle = new ActivityDesignerToggle
            {
                CollapseImageSourceUri = collapseImageSourceUri,
                CollapseToolTip = collapseToolTip,
                ExpandImageSourceUri = expandImageSourceUri,
                ExpandToolTip = expandToolTip,
                Image = CreateImage(expandImageSourceUri),
                ToolTip = expandToolTip,
                AutomationID = automationID,
                AutoReset = autoReset
            };

            if(target != null && dp != null)
            {
                BindingOperations.SetBinding(target, dp, new Binding("IsChecked")
                {
                    Source = toggle,
                    Mode = BindingMode.TwoWay
                });
            }

            return toggle;
        }
        protected void AddTitleBarQuickVariableInputToggle()
        {
            var toggle = ActivityDesignerToggle.Create("ServiceQuickVariableInput", "Close Quick Variable Input", "ServiceQuickVariableInput", "Open Quick Variable Input", "QuickVariableInputToggle", this, ShowQuickVariableInputProperty
                                                       );

            TitleBarToggles.Add(toggle);
        }
예제 #7
0
        protected void RemoveHelpToggle()
        {
            ActivityDesignerToggle activityDesignerToggle = TitleBarToggles.FirstOrDefault(c => c.AutomationID == "HelpToggle");

            if (activityDesignerToggle != null)
            {
                TitleBarToggles.Remove(activityDesignerToggle);
                ShowHelp = false;
            }
        }
        public static ActivityDesignerToggle Create(string collapseImageSourceUri, string collapseToolTip, string expandImageSourceUri, string expandToolTip, string automationID, bool autoReset = false)
        {
            var toggle = new ActivityDesignerToggle
            {
                CollapseImageSourceUri = collapseImageSourceUri,
                CollapseToolTip        = collapseToolTip,
                ExpandImageSourceUri   = expandImageSourceUri,
                ExpandToolTip          = expandToolTip,
                Image        = CreateImage(expandImageSourceUri),
                ToolTip      = expandToolTip,
                AutomationID = automationID,
                AutoReset    = autoReset
            };

            return(toggle);
        }
예제 #9
0
        public static ActivityDesignerToggle Create(string collapseImageSourceUri, string collapseToolTip, string expandImageSourceUri, string expandToolTip, string automationID, bool autoReset = false)
        {
            var toggle = new ActivityDesignerToggle
            {
                CollapseImageSourceUri = collapseImageSourceUri,
                CollapseToolTip = collapseToolTip,
                ExpandImageSourceUri = expandImageSourceUri,
                ExpandToolTip = expandToolTip,
                Image = CreateImage(expandImageSourceUri),
                ToolTip = expandToolTip,
                AutomationID = automationID,
                AutoReset = autoReset
            };

            return toggle;
        }