Ejemplo n.º 1
0
        protected override void AddAdditionalCommandGroups()
        {
            base.AddAdditionalCommandGroups();

            RibbonPageGroup group = new RibbonPageGroup();

            group.Caption = DefaultCommandGroupName;

            BarButtonItem buttonSave = new BarButtonItem();

            buttonSave.Content    = "Save";
            buttonSave.Glyph      = AppImageHelper.GetImageSource("Save", ImageSize.Size16x16);
            buttonSave.LargeGlyph = AppImageHelper.GetImageSource("Save", ImageSize.Size32x32);
            buttonSave.Command    = _viewModel.SaveCommand;

            BarButtonItem buttonEdit = new BarButtonItem();

            buttonEdit.Content    = "Edit";
            buttonEdit.Glyph      = AppImageHelper.GetImageSource("Edit", ImageSize.Size16x16);
            buttonEdit.LargeGlyph = AppImageHelper.GetImageSource("Edit", ImageSize.Size32x32);
            buttonEdit.Command    = _viewModel.EditCommand;

            BarButtonItem buttonCancel = new BarButtonItem();

            buttonCancel.Content    = "Cancel";
            buttonCancel.Glyph      = AppImageHelper.GetImageSource("Cancel", ImageSize.Size16x16);
            buttonCancel.LargeGlyph = AppImageHelper.GetImageSource("Cancel", ImageSize.Size32x32);
            buttonCancel.Command    = _viewModel.CancelCommand;

            group.ItemLinks.Add(buttonSave);
            group.ItemLinks.Add(buttonEdit);
            group.ItemLinks.Add(buttonCancel);
            ShellExtensionService.AddCommandGroupExtension(WorkItemName, DefaultCommandPageName, group);
        }
Ejemplo n.º 2
0
        public override void OnInitialized(IContainerProvider containerProvider)
        {
            base.OnInitialized(containerProvider);

            this._container     = containerProvider;
            this._regionManager = this._container.Resolve <IRegionManager>();

            NavBarGroup group = new NavBarGroup();

            group.Header = MenuGroups.ProductManagerGroup;
            NavBarItem item1 = new NavBarItem();

            item1.Content = Constants.UIConstants.ProductManagerWorkItemName;
            item1.Command = ToSecureCommand(OpenProductManagerWorkItem);

            NavBarItem item2 = new NavBarItem();

            item2.Content = Constants.UIConstants.BarndManagerWorkItemName;
            item2.Command = ToSecureCommand(OpenBrandManagerWorkItem);

            NavBarItem item3 = new NavBarItem();

            item3.Content = Constants.UIConstants.CategoriesWorkItemName;
            item3.Command = ToSecureCommand(OpenCategoriesWorkItem);
            group.Items.Add(item1);
            group.Items.Add(item2);
            group.Items.Add(item3);

            ShellExtensionService.AddNavigationGroupExtension(group);
        }
Ejemplo n.º 3
0
        public override void Run()
        {
            this._view      = ContainerProvider.Resolve <TView>();
            this._viewModel = (ContentViewModel <T, TViewModel>)_view.DataContext;
            base.Run();

            ShellExtensionService.ShowInContentRegion(this._view);
        }
Ejemplo n.º 4
0
 public override void Terminate()
 {
     base.Terminate();
     ShellExtensionService.RemoveFromContentRegion(this._detailsView);
     ShellExtensionService.RemoveFromDockRegion(this._listView);
     _detailsViewModel.Cleanup();
     _listViewModel.Cleanup();
 }
Ejemplo n.º 5
0
        public override void Run()
        {
            this._detailsView = new TDetailsView();
            ShellExtensionService.ShowInContentRegion(this._detailsView);
            this._detailsViewModel = (ObjectDetailViewModel <TDetail, TDetailViewModel>)_detailsView.DataContext;

            this._listView = ContainerProvider.Resolve <TListView>();
            ShellExtensionService.ShowInDockRegion(this._listView);
            this._listViewModel = (ObjectListViewModel <TInfo, TInfoViewModel>) this._listView.DataContext;

            base.Run();
        }
Ejemplo n.º 6
0
        protected virtual void AddCloseCommandGroups()
        {
            RibbonPageGroup group1 = new RibbonPageGroup();

            group1.Caption = "Close";
            BarButtonItem closeButton = new BarButtonItem();

            closeButton.Content    = "Close";
            closeButton.Glyph      = AppImageHelper.GetImageSource("Close", ImageSize.Size16x16);
            closeButton.LargeGlyph = AppImageHelper.GetImageSource("Close", ImageSize.Size32x32);
            closeButton.Command    = CloseCommand;
            group1.ItemLinks.Add(closeButton);

            ShellExtensionService.AddCommandGroupExtension(WorkItemName, DefaultCommandPageName, group1);
        }
Ejemplo n.º 7
0
        public override void OnInitialized(IContainerProvider containerProvider)
        {
            base.OnInitialized(containerProvider);
            this._container     = containerProvider;
            this._regionManager = this._container.Resolve <IRegionManager>();

            EventAggregator.GetEvent <AuthenticatedEvent>().Subscribe(HandleUserAuthenticated);

            BarButtonItem loginButton = new BarButtonItem();

            loginButton.Content    = "Login";
            loginButton.Command    = ToCommand(StartAuthenticationProccess);
            loginButton.Glyph      = AppImageHelper.GetImageSource("BOUser", ImageSize.Size16x16);
            loginButton.LargeGlyph = AppImageHelper.GetImageSource("BOUser", ImageSize.Size32x32);
            ShellExtensionService.AddCommandExtension(loginButton);
            StartAuthenticationProccess();
        }
Ejemplo n.º 8
0
        public override void OnInitialized(IContainerProvider containerProvider)
        {
            base.OnInitialized(containerProvider);
            this._container     = containerProvider;
            this._regionManager = this._container.Resolve <IRegionManager>();

            NavBarGroup group = new NavBarGroup();

            group.Header = "Test Group";
            NavBarItem item1 = new NavBarItem();

            item1.Content = "Messages";
            item1.Command = ToSecureCommand(OpenMesagesWorkItem);
            group.Items.Add(item1);


            ShellExtensionService.AddNavigationGroupExtension(group);
        }
Ejemplo n.º 9
0
 public override void Terminate()
 {
     base.Terminate();
     _viewModel.Cleanup();
     ShellExtensionService.RemoveFromContentRegion(this._view);
 }
Ejemplo n.º 10
0
 private void HandleUserAuthenticated()
 {
     ShellExtensionService.RemoveCommandExtension("Login");
 }
Ejemplo n.º 11
0
 public virtual void Terminate()
 {
     ShellExtensionService.RemoveCommandCategory(WorkItemName);
 }