예제 #1
0
        private TopPanelItem AssignPluginButton(TopPanelWrapperItem item)
        {
            var button = new TopPanelItem()
            {
                DataContext = item
            };

            return(button);
        }
예제 #2
0
        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);
        }
예제 #3
0
        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);
        }