private void Window_Loaded_1(object sender, RoutedEventArgs e) { ViewModels.MyViewModel VM = new ViewModels.MyViewModel(null); DataContext = VM; var textChanged = Observable.FromEventPattern<TextChangedEventHandler, TextChangedEventArgs>( handler => handler.Invoke, h => textBox3.TextChanged += h, h => textBox3.TextChanged -= h); textChanged.Subscribe(_ => VM.TextInput = textBox3.Text); }
void Window_Loaded_1(object sender, RoutedEventArgs e) { ViewModels.MyViewModel VM = new ViewModels.MyViewModel(System.Reactive.Concurrency.Scheduler.Default); DataContext = VM; var textChanged = Observable.FromEventPattern <TextChangedEventHandler, TextChangedEventArgs>( handler => handler.Invoke, h => textBox3.TextChanged += h, h => textBox3.TextChanged -= h); textChanged.Subscribe(_ => VM.TextInput = textBox3.Text); }
private void Window_Loaded_1(object sender, RoutedEventArgs e) { ViewModels.MyViewModel VM = new ViewModels.MyViewModel(null); DataContext = VM; var textChanged = Observable.FromEventPattern <TextChangedEventHandler, TextChangedEventArgs>( handler => handler.Invoke, h => textBox3.TextChanged += h, h => textBox3.TextChanged -= h); textChanged.Subscribe(_ => VM.TextInput = textBox3.Text); }