Ejemplo n.º 1
0
        protected ViewModelBase(IUnityContainer contain, IRegionManager regman, IEventAggregator events, IChatModel cm,
            ICharacterManager manager)
        {
            try
            {
                Container = contain.ThrowIfNull("contain");
                RegionManager = regman.ThrowIfNull("regman");
                Events = events.ThrowIfNull("events");
                ChatModel = cm.ThrowIfNull("cm");
                CharacterManager = manager.ThrowIfNull("manager");

                RightClickMenuViewModel = new RightClickMenuViewModel(ChatModel.IsGlobalModerator, CharacterManager);
                CreateReportViewModel = new CreateReportViewModel(Events, ChatModel);
                ChatModel.SelectedChannelChanged += OnSelectedChannelChanged;

                Events.GetEvent<NewUpdateEvent>().Subscribe(UpdateRightClickMenu);
            }
            catch (Exception ex)
            {
                ex.Source = "Generic ViewModel, init";
                Exceptions.HandleException(ex);
            }
        }
Ejemplo n.º 2
0
        protected ViewModelBase(IChatState chatState)
        {
            try
            {
                Container        = chatState.Container;
                RegionManager    = chatState.RegionManager;
                Events           = chatState.EventAggregator;
                ChatModel        = chatState.ChatModel;
                CharacterManager = chatState.CharacterManager;
                ChatConnection   = chatState.Connection;

                RightClickMenuViewModel = new RightClickMenuViewModel(ChatModel.IsGlobalModerator, CharacterManager,
                                                                      Container.Resolve <IGetPermissions>());
                CreateReportViewModel             = new CreateReportViewModel(Events, ChatModel);
                ChatModel.SelectedChannelChanged += OnSelectedChannelChanged;

                Events.GetEvent <NewUpdateEvent>().Subscribe(UpdateRightClickMenu);
            }
            catch (Exception ex)
            {
                ex.Source = "Generic ViewModel, init";
                Exceptions.HandleException(ex);
            }
        }
Ejemplo n.º 3
0
        protected ViewModelBase(IChatState chatState)
        {
            try
            {
                Container = chatState.Container;
                RegionManager = chatState.RegionManager;
                Events = chatState.EventAggregator;
                ChatModel = chatState.ChatModel;
                CharacterManager = chatState.CharacterManager;
                ChatConnection = chatState.Connection;

                RightClickMenuViewModel = new RightClickMenuViewModel(ChatModel.IsGlobalModerator, CharacterManager,
                    Container.Resolve<IGetPermissions>());
                CreateReportViewModel = new CreateReportViewModel(Events, ChatModel);
                ChatModel.SelectedChannelChanged += OnSelectedChannelChanged;

                Events.GetEvent<NewUpdateEvent>().Subscribe(UpdateRightClickMenu);
            }
            catch (Exception ex)
            {
                ex.Source = "Generic ViewModel, init";
                Exceptions.HandleException(ex);
            }
        }