private TopPanelItem AssignPluginButton(TopPanelWrapperItem item) { var button = new TopPanelItem() { DataContext = item }; return(button); }
private TopPanelItem AssignPanelButton(string contentTemplate, ContextMenu menu, string tooltip, out TopPanelWrapperItem panelItem) { panelItem = new TopPanelWrapperItem(new SDK.Plugins.TopPanelItem { Title = ResourceProvider.GetString(tooltip) }, mainModel); var item = new TopPanelItem() { DataContext = panelItem }; item.SetResourceReference(TopPanelItem.ContentTemplateProperty, contentTemplate); LeftClickContextMenuBehavior.SetEnabled(item, true); menu.SetResourceReference(ContextMenu.StyleProperty, "TopPanelMenu"); item.ContextMenu = menu; return(item); }
private TopPanelItem AssignPanelButton(string contentTemplate, RelayCommand <object> command, string tooltip, out TopPanelWrapperItem panelItem) { panelItem = new TopPanelWrapperItem(new SDK.Plugins.TopPanelItem { Title = tooltip }, mainModel) { Command = command }; var item = new TopPanelItem() { DataContext = panelItem }; item.SetResourceReference(TopPanelItem.ContentTemplateProperty, contentTemplate); return(item); }