예제 #1
0
        //private string _username;

        /// <summary>
        /// !+ Initializes a new instance of the MainViewModel class.
        /// </summary>
        public MainViewModel()
        {
            Security.Security.IpAddressAquired += SecurityIpAddressAquired;
            var locator = Application.Current.FindResource("Locator") as ViewModelLocator;

            this._h264ViewModel     = locator.H264Settings;
            this._metadataViewModel = locator.Metadata;
            this._recorderViewModel = locator.RecorderSettings;
            this._settingsViewModel = locator.Settings;
            this._securityViewModel = locator.Security;

            this._recorderViewModel.SetMainViewModel(this);

            StreamName          = Settings.Default.StreamName;
            SelectedVideoDevice = Settings.Default.VideoSource;
            SelectedAudioDevice = Settings.Default.AudioSource;
            ApplicationName     = Settings.Default.ApplicationName;

            this._settingsViewModel.DevicesUpdated  += SettingsDevicesUpdated;
            this._settingsViewModel.PropertyChanged += ViewModelPropertyChanged;
            this._h264ViewModel.PropertyChanged     += ViewModelPropertyChanged;
            this._metadataViewModel.PropertyChanged += ViewModelPropertyChanged;
            Security.Security.IpAddressAquired      += this.Security_IpAddressAquired;

            CheckBroadcastingAvailability();
        }
        /// <summary>
        /// Implements the RecorderSettingsViewModel.
        /// </summary>
        public RecorderSettingsViewModel()
        {
            var locator = Application.Current.FindResource("Locator") as ViewModelLocator;

            this._settingsViewModel = locator.Settings;
            this._securityViewModel = locator.Security;

            ResetModel();

            this._settingsViewModel.PropertyChanged += ViewModelPropertyChanged;
        }