Ejemplo n.º 1
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);
        }
Ejemplo n.º 2
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);
        }