private void ClientSocketOnVoteStarted(object sender, VoteStartedEventArgs e) { Application.Current.Dispatcher.Invoke(delegate { if (MessageBox.Show("Coffee time!", e.ClientProfile.Name + " started a coffee vote", MessageBoxButton.YesNo) == MessageBoxResult.Yes) { ClientSocket.SendCommand("start_vote", new StartVoteCommand()); this.MainFrame.Navigate(new WheelOfFortuneView(ClientSocket)); } }); }
protected virtual void VoteStartedEvent(VoteStartedEventArgs e) { EventHandler <VoteStartedEventArgs> handler = VoteStarted; handler?.Invoke(this, e); }