private static void OnCommandChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) { RibbonTextBox textBox = (RibbonTextBox)d; ICommand oldCommand = (ICommand)e.OldValue; ICommand newCommand = (ICommand)e.NewValue; if (oldCommand != null) { textBox.UnhookCommand(oldCommand); } if (newCommand != null) { textBox.HookCommand(newCommand); } RibbonHelper.OnCommandChanged(d, e); }
private static Control MapQatDataToControl(VM.QatItem qatItem) { string typeName = qatItem.Instance.GetType().Name; Control control = null; switch (typeName) { case "ButtonData": { control = new RibbonButton(); control.DataContext = qatItem.Instance; break; } case "ToggleButtonData": { control = new RibbonToggleButton(); control.DataContext = qatItem.Instance; break; } case "RadioButtonData": { control = new RibbonRadioButton(); control.DataContext = qatItem.Instance; break; } case "CheckBoxData": { control = new RibbonCheckBox(); control.DataContext = qatItem.Instance; break; } case "TextBoxData": { control = new RibbonTextBox(); control.DataContext = qatItem.Instance; break; } case "MenuButtonData": { control = new RibbonMenuButton(); control.DataContext = qatItem.Instance; break; } case "SplitButtonData": { if (!qatItem.IsSplitHeader) { control = new RibbonSplitButton(); } else { VM.SplitButtonData splitButtonData = (VM.SplitButtonData)qatItem.Instance; if (splitButtonData.IsCheckable) { control = new RibbonToggleButton(); } else { control = new RibbonButton(); } } control.DataContext = qatItem.Instance; break; } case "ComboBoxData": { control = new RibbonComboBox(); control.DataContext = qatItem.Instance; break; } case "MenuItemData": { VM.MenuItemData menuItemData = (VM.MenuItemData)qatItem.Instance; if (menuItemData.ControlDataCollection.Count > 0) { control = new RibbonMenuButton(); } else { control = new RibbonButton(); } control.DataContext = qatItem.Instance; break; } case "SplitMenuItemData": { VM.SplitMenuItemData splitMenuItemData = (VM.SplitMenuItemData)qatItem.Instance; if (!qatItem.IsSplitHeader) { if (splitMenuItemData.ControlDataCollection.Count > 0) { control = new RibbonSplitButton(); } else if (splitMenuItemData.IsCheckable) { control = new RibbonToggleButton(); } else { control = new RibbonButton(); } } else { control = new RibbonToggleButton(); } control.DataContext = qatItem.Instance; break; } case "GalleryData": { RibbonGallery gallery = new RibbonGallery(); RibbonMenuButton menuButton = new RibbonMenuButton(); menuButton.ItemsSource = new object[] { gallery }; control = menuButton; control.DataContext = qatItem.Instance; break; } case "GroupData": { control = new RibbonGroup(); control.DataContext = qatItem.Instance; break; } } return control; }
/// <summary> /// Initialize Automation Peer for RibbonTextBox. /// </summary> public RibbonTextBoxAutomationPeer(RibbonTextBox owner) : base(owner) { }
void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target) { switch (connectionId) { case 1: this._Editor = ((TextEditor.MainWindow)(target)); return; case 2: #line 29 "..\..\MainWindow.xaml" ((System.Windows.Input.CommandBinding)(target)).Executed += new System.Windows.Input.ExecutedRoutedEventHandler(this.new_ButonClick); #line default #line hidden return; case 3: #line 34 "..\..\MainWindow.xaml" ((System.Windows.Input.CommandBinding)(target)).Executed += new System.Windows.Input.ExecutedRoutedEventHandler(this.open_ButonClick); #line default #line hidden return; case 4: #line 39 "..\..\MainWindow.xaml" ((System.Windows.Input.CommandBinding)(target)).Executed += new System.Windows.Input.ExecutedRoutedEventHandler(this.save_ButonClick); #line default #line hidden return; case 5: this.menuLanguage = ((System.Windows.Controls.Menu)(target)); return; case 6: #line 59 "..\..\MainWindow.xaml" ((System.Windows.Input.CommandBinding)(target)).Executed += new System.Windows.Input.ExecutedRoutedEventHandler(this.new_ButonClick); #line default #line hidden return; case 7: #line 65 "..\..\MainWindow.xaml" ((System.Windows.Input.CommandBinding)(target)).Executed += new System.Windows.Input.ExecutedRoutedEventHandler(this.open_ButonClick); #line default #line hidden return; case 8: #line 71 "..\..\MainWindow.xaml" ((System.Windows.Input.CommandBinding)(target)).Executed += new System.Windows.Input.ExecutedRoutedEventHandler(this.save_ButonClick); #line default #line hidden return; case 9: #line 78 "..\..\MainWindow.xaml" ((Microsoft.Windows.Controls.Ribbon.RibbonButton)(target)).Click += new System.Windows.RoutedEventHandler(this.Button_Click); #line default #line hidden return; case 10: this.cb = ((System.Windows.Controls.ComboBox)(target)); return; case 11: this._fSizeSlider = ((System.Windows.Controls.Slider)(target)); return; case 12: this._fontSize = ((System.Windows.Controls.TextBlock)(target)); return; case 13: this._numbOfChar = ((System.Windows.Controls.TextBox)(target)); return; case 14: #line 105 "..\..\MainWindow.xaml" ((Microsoft.Windows.Controls.Ribbon.RibbonButton)(target)).Click += new System.Windows.RoutedEventHandler(this.MinusButton_Click); #line default #line hidden return; case 15: this._ScaleSlider = ((System.Windows.Controls.Slider)(target)); return; case 16: #line 107 "..\..\MainWindow.xaml" ((Microsoft.Windows.Controls.Ribbon.RibbonButton)(target)).Click += new System.Windows.RoutedEventHandler(this.PlusButton_Click); #line default #line hidden return; case 17: this._ScaleValue = ((Microsoft.Windows.Controls.Ribbon.RibbonTextBox)(target)); return; case 18: this.richTextBox = ((System.Windows.Controls.RichTextBox)(target)); #line 111 "..\..\MainWindow.xaml" this.richTextBox.PreviewDragEnter += new System.Windows.DragEventHandler(this.RichTextBox_DragEnter); #line default #line hidden #line 111 "..\..\MainWindow.xaml" this.richTextBox.PreviewDragOver += new System.Windows.DragEventHandler(this.RichTextBox_DragOver); #line default #line hidden #line 111 "..\..\MainWindow.xaml" this.richTextBox.PreviewDrop += new System.Windows.DragEventHandler(this.RichTextBox_Drop); #line default #line hidden return; } this._contentLoaded = true; }
private static void translateLabel(RibbonTextBox button, string name, params string[] variables) { StringCollection str = Strings.getInterfaceString(name); if (str[StringType.Label].HasHotKey) { button.KeyTip = str[StringType.Label].HotKey; } button.Label = str[StringType.Label].interpret(variables); if (str.ContainsKey(StringType.ToolTip)) { button.ToolTip = str[StringType.ToolTip].interpret(variables); } }
private static void translateLabel(RibbonTextBox button) { if (button.Label == null) return; string string_title = button.Label.ToString(); translateLabel(button, string_title); }
void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target) { switch (connectionId) { case 1: #line 9 "..\..\Moon.xaml" ((Moon.Window1)(target)).Loaded += new System.Windows.RoutedEventHandler(this.Window_Loaded); #line default #line hidden return; case 2: #line 24 "..\..\Moon.xaml" ((Microsoft.Windows.Controls.Ribbon.RibbonCommand)(target)).Executed += new System.Windows.Input.ExecutedRoutedEventHandler(this.SearchByTag_Executed); #line default #line hidden return; case 3: #line 32 "..\..\Moon.xaml" ((Microsoft.Windows.Controls.Ribbon.RibbonCommand)(target)).Executed += new System.Windows.Input.ExecutedRoutedEventHandler(this.SearchByResource_Executed); #line default #line hidden return; case 4: #line 40 "..\..\Moon.xaml" ((Microsoft.Windows.Controls.Ribbon.RibbonCommand)(target)).Executed += new System.Windows.Input.ExecutedRoutedEventHandler(this.OpenResource_Executed); #line default #line hidden return; case 5: #line 48 "..\..\Moon.xaml" ((Microsoft.Windows.Controls.Ribbon.RibbonCommand)(target)).Executed += new System.Windows.Input.ExecutedRoutedEventHandler(this.RelationCreated_Excuted); #line default #line hidden return; case 6: #line 56 "..\..\Moon.xaml" ((Microsoft.Windows.Controls.Ribbon.RibbonCommand)(target)).Executed += new System.Windows.Input.ExecutedRoutedEventHandler(this.goBack_Excuted); #line default #line hidden return; case 7: #line 64 "..\..\Moon.xaml" ((Microsoft.Windows.Controls.Ribbon.RibbonCommand)(target)).Executed += new System.Windows.Input.ExecutedRoutedEventHandler(this.goForward_Excuted); #line default #line hidden return; case 8: #line 72 "..\..\Moon.xaml" ((Microsoft.Windows.Controls.Ribbon.RibbonCommand)(target)).Executed += new System.Windows.Input.ExecutedRoutedEventHandler(this.AddTag_Excuted); #line default #line hidden return; case 9: #line 80 "..\..\Moon.xaml" ((Microsoft.Windows.Controls.Ribbon.RibbonCommand)(target)).Executed += new System.Windows.Input.ExecutedRoutedEventHandler(this.ModifyTag_Excuted); #line default #line hidden return; case 10: #line 131 "..\..\Moon.xaml" ((Microsoft.Windows.Controls.Ribbon.RibbonButton)(target)).Click += new System.Windows.RoutedEventHandler(this.RibbonButton_Click); #line default #line hidden return; case 11: this.tagName = ((Microsoft.Windows.Controls.Ribbon.RibbonTextBox)(target)); return; case 12: this.goBack = ((Microsoft.Windows.Controls.Ribbon.RibbonButton)(target)); return; case 13: this.goForward = ((Microsoft.Windows.Controls.Ribbon.RibbonButton)(target)); #line 172 "..\..\Moon.xaml" this.goForward.Click += new System.Windows.RoutedEventHandler(this.RibbonButton_Click); #line default #line hidden return; case 14: this.Context = ((System.Windows.Controls.Grid)(target)); return; case 15: this.ResourceGrid = ((System.Windows.Controls.Grid)(target)); return; case 16: this.resourceList = ((System.Windows.Controls.ListBox)(target)); #line 198 "..\..\Moon.xaml" this.resourceList.KeyUp += new System.Windows.Input.KeyEventHandler(this.resourceList_KeyUp); #line default #line hidden #line 199 "..\..\Moon.xaml" this.resourceList.MouseRightButtonUp += new System.Windows.Input.MouseButtonEventHandler(this.resourceList_MouseRightButtonUp); #line default #line hidden #line 199 "..\..\Moon.xaml" this.resourceList.MouseDoubleClick += new System.Windows.Input.MouseButtonEventHandler(this.resourceList_MouseDoubleClick); #line default #line hidden #line 199 "..\..\Moon.xaml" this.resourceList.MouseLeftButtonUp += new System.Windows.Input.MouseButtonEventHandler(this.resourceList_MouseLeftButtonUp); #line default #line hidden return; case 17: this.popMenu = ((System.Windows.Controls.Primitives.Popup)(target)); return; case 18: this.textOnPopmenu = ((System.Windows.Controls.TextBox)(target)); return; case 19: this.buttonOnPopmenu = ((System.Windows.Controls.Button)(target)); #line 217 "..\..\Moon.xaml" this.buttonOnPopmenu.Click += new System.Windows.RoutedEventHandler(this.buttonOnPopmenu_Click); #line default #line hidden return; case 20: this.TagGrid = ((System.Windows.Controls.Grid)(target)); return; case 21: this.tagList = ((System.Windows.Controls.ListBox)(target)); #line 230 "..\..\Moon.xaml" this.tagList.KeyUp += new System.Windows.Input.KeyEventHandler(this.tagList_KeyUp); #line default #line hidden #line 230 "..\..\Moon.xaml" this.tagList.MouseDoubleClick += new System.Windows.Input.MouseButtonEventHandler(this.tagList_MouseDoubleClick); #line default #line hidden return; } this._contentLoaded = true; }
void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target) { switch (connectionId) { case 1: this.This = ((DBMgrRibbon.MainWindow)(target)); #line 8 "..\..\..\UIMain.xaml" this.This.Closing += new System.ComponentModel.CancelEventHandler(this.This_Closing); #line default #line hidden return; case 2: this.LayoutRoot = ((System.Windows.Controls.Grid)(target)); return; case 3: this.Ribbon = ((Microsoft.Windows.Controls.Ribbon.Ribbon)(target)); #line 34 "..\..\..\UIMain.xaml" this.Ribbon.SelectionChanged += new System.Windows.Controls.SelectionChangedEventHandler(this.Ribbon_SelectionChanged); #line default #line hidden return; case 4: this.MenuItem1 = ((Microsoft.Windows.Controls.Ribbon.RibbonApplicationMenuItem)(target)); return; case 5: this.HomeTab = ((Microsoft.Windows.Controls.Ribbon.RibbonTab)(target)); return; case 6: this.Group1 = ((Microsoft.Windows.Controls.Ribbon.RibbonGroup)(target)); return; case 7: this.Button1 = ((Microsoft.Windows.Controls.Ribbon.RibbonButton)(target)); return; case 8: this.Button2 = ((Microsoft.Windows.Controls.Ribbon.RibbonButton)(target)); return; case 9: this.Button3 = ((Microsoft.Windows.Controls.Ribbon.RibbonButton)(target)); return; case 10: this.Button4 = ((Microsoft.Windows.Controls.Ribbon.RibbonButton)(target)); return; case 11: this.newSliceName = ((Microsoft.Windows.Controls.Ribbon.RibbonTextBox)(target)); return; case 12: #line 76 "..\..\..\UIMain.xaml" ((Microsoft.Windows.Controls.Ribbon.RibbonButton)(target)).Click += new System.Windows.RoutedEventHandler(this.newSliceBtnClick); #line default #line hidden return; case 13: this.addCanvasSliceItemBtn = ((Microsoft.Windows.Controls.Ribbon.RibbonButton)(target)); #line 80 "..\..\..\UIMain.xaml" this.addCanvasSliceItemBtn.Click += new System.Windows.RoutedEventHandler(this.newCanvasSliceItem); #line default #line hidden return; case 14: this.moveSlotUpBtn = ((Microsoft.Windows.Controls.Ribbon.RibbonButton)(target)); #line 81 "..\..\..\UIMain.xaml" this.moveSlotUpBtn.Click += new System.Windows.RoutedEventHandler(this.moveUpCanvasSliceItem); #line default #line hidden return; case 15: this.moveSlotDownBtn = ((Microsoft.Windows.Controls.Ribbon.RibbonButton)(target)); #line 82 "..\..\..\UIMain.xaml" this.moveSlotDownBtn.Click += new System.Windows.RoutedEventHandler(this.moveDownCanvasSliceItem); #line default #line hidden return; case 16: this.removeCanvasSliceItemBtn = ((Microsoft.Windows.Controls.Ribbon.RibbonButton)(target)); #line 83 "..\..\..\UIMain.xaml" this.removeCanvasSliceItemBtn.Click += new System.Windows.RoutedEventHandler(this.removeCanvasSliceItem); #line default #line hidden return; case 17: this.in_artist = ((System.Windows.Controls.TextBox)(target)); return; case 18: this.in_title = ((System.Windows.Controls.TextBox)(target)); return; case 19: this.in_category = ((System.Windows.Controls.ComboBox)(target)); #line 120 "..\..\..\UIMain.xaml" this.in_category.SelectionChanged += new System.Windows.Controls.SelectionChangedEventHandler(this.in_category_SelectionChanged); #line default #line hidden return; case 20: #line 134 "..\..\..\UIMain.xaml" ((Microsoft.Windows.Controls.Ribbon.RibbonButton)(target)).Click += new System.Windows.RoutedEventHandler(this.RibbonButton_Click_Save); #line default #line hidden return; case 21: #line 135 "..\..\..\UIMain.xaml" ((Microsoft.Windows.Controls.Ribbon.RibbonButton)(target)).Click += new System.Windows.RoutedEventHandler(this.RibbonButton_Click_Cancel); #line default #line hidden return; case 22: this.libraryTree = ((System.Windows.Controls.TreeView)(target)); return; case 23: this.scheduleCalendar = ((System.Windows.Controls.Calendar)(target)); #line 146 "..\..\..\UIMain.xaml" this.scheduleCalendar.SelectedDatesChanged += new System.EventHandler<System.Windows.Controls.SelectionChangedEventArgs>(this.scheduleCalendar_SelectedDatesChanged); #line default #line hidden return; case 24: this.tb1 = ((System.Windows.Controls.Primitives.ToggleButton)(target)); #line 148 "..\..\..\UIMain.xaml" this.tb1.Checked += new System.Windows.RoutedEventHandler(this.ToggleButton_Checked); #line default #line hidden return; case 25: this.tb2 = ((System.Windows.Controls.Primitives.ToggleButton)(target)); #line 149 "..\..\..\UIMain.xaml" this.tb2.Checked += new System.Windows.RoutedEventHandler(this.ToggleButton_Checked); #line default #line hidden return; case 26: this.tb3 = ((System.Windows.Controls.Primitives.ToggleButton)(target)); #line 150 "..\..\..\UIMain.xaml" this.tb3.Checked += new System.Windows.RoutedEventHandler(this.ToggleButton_Checked); #line default #line hidden return; case 27: this.grid = ((System.Windows.Controls.DataGrid)(target)); #line 153 "..\..\..\UIMain.xaml" this.grid.SelectionChanged += new System.Windows.Controls.SelectionChangedEventHandler(this.grid_SelectionChanged); #line default #line hidden #line 153 "..\..\..\UIMain.xaml" this.grid.MouseRightButtonDown += new System.Windows.Input.MouseButtonEventHandler(this.GridRightBtnDown); #line default #line hidden #line 153 "..\..\..\UIMain.xaml" this.grid.KeyDown += new System.Windows.Input.KeyEventHandler(this.grid_KeyDown); #line default #line hidden return; case 28: this.loggrid = ((System.Windows.Controls.DataGrid)(target)); return; case 29: this.ProgressBar = ((System.Windows.Controls.ProgressBar)(target)); return; } this._contentLoaded = true; }