public ModuleSelectorPresententaionModel(IEventAggregator eventAggregator, ModuleSelectorView view, IServerContextService serverContextService)
        {
            this.eventAggregator = eventAggregator;
            this.serverContextService = serverContextService;

            View = view;
            View.DataContext = this;

            // Defines Execute and CanExecute methods for radio buttons
            foreach (ImageRadioButton button in CommandSources((Panel)View.FindName(RadioButtonContainer)))
            {
                button.Command = new DelegateCommand<string>(SelectModule, CanSelectModule);
            }

            eventAggregator.GetEvent<ServerContextChangedEvent>().Subscribe(ServerContextChanged, ThreadOption.UIThread, true);
            eventAggregator.GetEvent<ServerContextClearedEvent>().Subscribe(ServerContextCleared, ThreadOption.UIThread, true);
        }
        public DocumentsPresentationModel(IUnityContainer container, IServerContextService serverContextService)
        {
            this.container = container;
            this.serverContextService = serverContextService;

            view = container.Resolve<DocumentsView>();
            view.Menu.DataContext = this;

            view.Text = serverContextService.CurrentServerContext.Name;

            NewDocumentCommand = new DelegateCommand<object>(NewDocument, CanExecuteCommand);
            CutCommand = new DelegateCommand<object>(Cut, CanExecuteCommand);
            CopyCommand = new DelegateCommand<object>(Copy, CanExecuteCommand);
            DeleteCommand = new DelegateCommand<object>(Delete, CanExecuteCommand);
            RenameCommand = new DelegateCommand<object>(Rename, CanExecuteCommand);
            PropertiesCommand = new DelegateCommand<object>(Properties, CanExecuteCommand);
        }
Exemplo n.º 3
0
 public ServerController(IEventAggregator eventAggregator, IServerContextService serverContextService)
 {
     this.eventAggregator = eventAggregator;
     this.serverContextService = serverContextService;
 }
Exemplo n.º 4
0
 public ServerChatService(IServerContextService server)
 {
     _server = server;
     RegisterToService();
 }