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 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(); }
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); }
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); }
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); }
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); }
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; }