Пример #1
0
        private void RemoveRibbonTab(IGoalCollection goalCollection)
        {
            var ribbonTabToRemove =
                (from ribbonTab in RibbonTabs
                where ribbonTab.DataContext is IRibbonTabViewModel
                where ((IRibbonTabViewModel)ribbonTab.DataContext).GoalCollection == goalCollection
                select ribbonTab)
                .FirstOrDefault();

            if (ribbonTabToRemove != null)
            {
               RibbonTabs.Remove(ribbonTabToRemove);
            }
        }
        public RibbonTabViewModel(IEventAggregator eventAggregator, IGoalCollection goalCollection, IAddGoalEventArgsFactory addGoalEventArgsFactory)
        {
            this.GoalCollection = goalCollection;

            AddCommand =
                new DelegateCommand(
                    () => eventAggregator.GetEvent<AddGoalEvent>()
                              .Publish(addGoalEventArgsFactory.Create(GoalCollection)),
                    () => true);

            CloseCommand =
                new DelegateCommand(
                    () => eventAggregator.GetEvent<CloseGoalCollectionEvent>()
                              .Publish(GoalCollection),
                    () => true);
        }
 public IRibbonTabViewModel Create(IGoalCollection goalCollection)
 {
     return new RibbonTabViewModel(eventAggregator, goalCollection, addGoalEventArgsFactory);
 }
Пример #4
0
 private void AddRibbonTab(IGoalCollection goalCollection)
 {
     RibbonTabs.Add(ribbonTabViewFactory.Create(goalCollection));
 }
 public RibbonTabView Create(IGoalCollection goalCollection)
 {
     return new RibbonTabView(ribbonTabViewModelFactory.Create(goalCollection));
 }
 public AddGoalEventArgs Create(IGoalCollection goalCollection)
 {
     return new AddGoalEventArgs(goalCollection, goalCollection.GoalList.Count());
 }