示例#1
0
        public AppViewModel()
        {
            // Create LoginInfoModel
            LoginInfoModel = new LoginInfoModel
            {
                ButtonLoginOrLogoutCommand = new RelayCommand <object>(new Action <object>(LoginOrLogoutCommand), new Predicate <object>(LoginOrLogoutCommandCanExecute))
            };

            // Create ConversationModel
            ConversationModel = new ConversationModel
            {
                ButtonRejectCommand        = new RelayCommand <object>(new Action <object>(RejectCommand), new Predicate <object>(RejectCommandCanExecute)),
                ButtonHangUpCommand        = new RelayCommand <object>(new Action <object>(HangUpCommand), new Predicate <object>(HangUpCommandCanExecute)),
                ButtonAnswerCommand        = new RelayCommand <object>(new Action <object>(AnswerCommand), new Predicate <object>(AnswerCommandCanExecute)),
                ButtonCallCommand          = new RelayCommand <object>(new Action <object>(CallCommand), new Predicate <object>(CallCommandCanExecute)),
                ButtonSelectDevicesCommand = new RelayCommand <object>(new Action <object>(SelectDevicesCommand), new Predicate <object>(SelectDevicesCommandCanExecute)),

                ButtonMuteUnmuteAudioCommand   = new RelayCommand <object>(new Action <object>(MuteUnmuteAudioCommand), new Predicate <object>(MuteUnmuteAudioCommandCanExecute)),
                ButtonMuteUnmuteVideoCommand   = new RelayCommand <object>(new Action <object>(MuteUnmuteVideoCommand), new Predicate <object>(MuteUnmuteVideoCommandCanExecute)),
                ButtonMuteUnmuteSharingCommand = new RelayCommand <object>(new Action <object>(MuteUnmuteSharingCommand), new Predicate <object>(MuteUnmuteSharingCommandCanExecute)),

                ButtonAddAudioCommand         = new RelayCommand <object>(new Action <object>(AddAudioCommand), new Predicate <object>(AddAudioCommandCanExecute)),
                ButtonAddRemoveVideoCommand   = new RelayCommand <object>(new Action <object>(AddRemoveVideoCommand), new Predicate <object>(AddRemoveVideoCommandCanExecute)),
                ButtonAddRemoveSharingCommand = new RelayCommand <object>(new Action <object>(AddRemoveSharingCommand), new Predicate <object>(AddRemoveSharingCommandCanExecute)),
            };

            // Create LayoutModel
            LayoutModel = new LayoutModel();
            LayoutModel.LocalVideo.ButtonSetCommand = new RelayCommand <object>(new Action <object>(SetLocalVideoCommand));
            LayoutModel.LocalVideo.ButtonPictureInPictureSwitchCommand = new RelayCommand <object>(new Action <object>(SwitchPictureInPictureModeOnLocalVideoCommand));
            LayoutModel.RemoteVideo.ButtonSetCommand = new RelayCommand <object>(new Action <object>(SetRemoteVideoCommand));
            LayoutModel.RemoteVideo.ButtonPictureInPictureSwitchCommand = new RelayCommand <object>(new Action <object>(SwitchPictureInPictureModeOnRemoteVideoCommand));
            LayoutModel.Sharing.ButtonSetCommand = new RelayCommand <object>(new Action <object>(SetSharingCommand));
            LayoutModel.Sharing.ButtonPictureInPictureSwitchCommand = new RelayCommand <object>(new Action <object>(SwitchPictureInPictureModeOnSharingCommand));

            LayoutModel.PropertyChanged += LayoutModel_PropertyChanged;

            // Create DevicesModel
            DevicesModel = new DevicesModel();

            // Create UsersModel
            UsersModel = new UsersModel();

            // Create LanguagesModel
            LanguagesModel = new LanguagesModel()
            {
                ButtonSetCommand = new RelayCommand <object>(new Action <object>(SetLanguageCommand))
            };

            // Get Rainbow Languages service
            rbLanguages = Rainbow.Common.Languages.Instance;
            SetLanguagesList(rbLanguages.GetLanguagesIdList());

            // Create ConstraintModel
            ConstraintModel = new ConstraintModel()
            {
                MaxFrameRateValue          = "10",
                WidthValue                 = "640",
                HeightValue                = "480",
                VideoConstraint            = true,
                ButtonSetConstraintCommand = new RelayCommand <object>(new Action <object>(SetConstraintCommand), new Predicate <object>(SetConstraintCommandCanExecute))
            };
        }