Esempio n. 1
0
 private void ShowStartBroadcast()
 {
     var window = new StartBroadcast();
     var viewModel = new StartBroadcastViewModel();
     viewModel.OnClose += roomId => {
         uiDispatcher.BeginInvoke(new Action(() => {
             window.Close();
             if (String.IsNullOrWhiteSpace(roomId)) {
                 return;
             }
             this.JoinRoom(roomId);
         }));
     };
     window.DataContext = viewModel;
     window.ShowDialog();
 }
Esempio n. 2
0
		private async void ShowStartBroadcast() {
			try {
				var window = new StartBroadcast();
				var viewModel = await StartBroadcastViewModel.CreateInstance();
				viewModel.OnStreamStart += roomId => {
					uiDispatcher.BeginInvoke(new Action(() => {
						window.Close();
						if (String.IsNullOrWhiteSpace(roomId)) {
							return;
						}
						this.JoinRoom(roomId);
					}));
				};
				window.Closed += (sender, e) => {
					viewModel.Dispose();
				};
				window.DataContext = viewModel;
				window.ShowDialog();
			} catch (CommentException e) {
				logger.Error(e);
				return;
			}
		}