Ejemplo n.º 1
0
        private void LoadToolbar()
        {
            eventAggregator.GetEvent <SplashMessageUpdateEvent>().Publish(new SplashMessageUpdateEvent {
                Message = "Toolbar.."
            });
            IToolbarService toolbarService = containerProvider.Resolve <IToolbarService>();
            IMenuService    menuService    = containerProvider.Resolve <IMenuService>();
            ICommandManager manager        = containerProvider.Resolve <ICommandManager>();

            toolbarService.Add(new ToolbarViewModel("Standard", 1)
            {
                Band = 1, BandIndex = 1
            });
            toolbarService.Get("Standard").Add(menuService.Get("_File").Get("_New"));
            toolbarService.Get("Standard").Add(menuService.Get("_File").Get("_Open"));

            toolbarService.Add(new ToolbarViewModel("Edit", 1)
            {
                Band = 1, BandIndex = 2
            });
            toolbarService.Get("Edit").Add(menuService.Get("_Edit").Get("_Undo"));
            toolbarService.Get("Edit").Add(menuService.Get("_Edit").Get("_Redo"));
            toolbarService.Get("Edit").Add(menuService.Get("_Edit").Get("Cut"));
            toolbarService.Get("Edit").Add(menuService.Get("_Edit").Get("Copy"));
            toolbarService.Get("Edit").Add(menuService.Get("_Edit").Get("_Paste"));

            toolbarService.Add(new ToolbarViewModel("Debug", 1)
            {
                Band = 1, BandIndex = 3
            });
            toolbarService.Get("Debug").Add(new MenuItemViewModel("Debug", 1, new BitmapImage(new Uri(@"pack://*****:*****@"pack://application:,,,/WiderMD.Core;component/Icons/Play.png")), manager.GetCommand("OPEN")));
            toolbarService.Get("Debug").Get("Debug").Add(new MenuItemViewModel("Debug with FireFox", 2, new BitmapImage(new Uri(@"pack://*****:*****@"pack://application:,,,/WiderMD.Core;component/Icons/Play.png")), manager.GetCommand("OPEN")));

            if (toolbarService.ContextMenuItems != null)
            {
                menuService.Get("_Tools").Add(toolbarService.ContextMenuItems);
            }

            //Initiate the position settings changes for toolbar
            containerProvider.Resolve <IToolbarPositionSettings>();
        }
Ejemplo n.º 2
0
        private void LoadToolbar()
        {
            IMenuService    menuService    = Container.Resolve <IMenuService>();
            IToolbarService toolbarService = Container.Resolve <IToolbarService>();

            toolbarService.Add(new ToolbarViewModel("Standard", 1)
            {
                Band = 1, BandIndex = 1
            });
            toolbarService.Get("Standard").Add(menuService.Get("_Refersh"));
            toolbarService.Get("Standard").Add(new MenuItemViewModel("Clipboard", 201));
        }