public StreamViewModel(MainViewModel mainViewModel, bool addInitialProperties, MediaStreamModel model) { MediaStreamer = model; dialogService = ServiceLocator.GetInstance <IDialogService>(); MainViewModel = mainViewModel; StartCommand = new DelegateCommand(SwitchStreamingState); //EditModeCommand = new RelayCommand(() => MainViewModel.IsEdit = true); //EditModeCommand = new DelegateCommand(() => MainViewModel.IsEdit = true); EditModeCommand = new DelegateCommand(SetEditMode); EditNameCommand = new DelegateCommand(SwitchEditNameState); CopyUrlCommand = new DelegateCommand(CopyUrl); PreferencesCommand = new DelegateCommand <WindowViewModel>(ShowPreferencesDialog); HideBorderCommand = new DelegateCommand(HideBorder); ShowSettingsCommand = new DelegateCommand(ShowSettings); if (addInitialProperties) { VideoViewModel = new PropertyVideoViewModel(this, MediaStreamer.PropertyVideo); PropertyAudio = new PropertyAudioViewModel(this, MediaStreamer.PropertyAudio); PropertyNetwork = new PropertyNetworkViewModel(this, MediaStreamer.PropertyNetwork); Properties.Add(VideoViewModel); Properties.Add(PropertyAudio); Properties.Add(PropertyNetwork); // Properties.Add(PropertyQuality = new PropertyQualityViewModel(this, Model.PropertyQuality)); // Properties.Add(PropertyCursor = new PropertyCursorViewModel(this, Model.PropertyCursor)); //Properties.Add(PropertyBorder = new PropertyBorderViewModel(this, Model.PropertyBorder)); } AdvancedSettingsViewModel = new AdvancedSettingsViewModel(MediaStreamer.AdvancedSettings, this); BorderViewModel = new BorderViewModel(this, MediaStreamer.PropertyBorder); DesignBorderViewModel = new DesignBorderViewModel(this, MediaStreamer.PropertyBorder); VideoViewModel.SetupDisplayRegion(); dispatcher = Dispatcher.CurrentDispatcher; dispatcher.BeginInvoke( DispatcherPriority.Loaded, new Action(() => OnStreamStateChanged(IsStarted))); MediaStreamer.StateChanged += MediaStreamer_StateChanged; MediaStreamer.ErrorOccurred += MediaStreamer_ErrorOccurred; }
public NetworkSettingsViewModel(PropertyNetworkViewModel property, TrackableViewModel parent) : base(property, parent) { UnicastProtocols.AddRange(NetworkHelper.GetUnicastProtocolTypes()); Networks.AddRange(NetworkHelper.GetNetworkInfos()); }