private static void RefreshBindingExpression(BindingExpression bindingExpression) { if (bindingExpression != null) { bindingExpression.UpdateSource(); } }
public EditEventProperty() { InitializeComponent(); _appb = new EditPageSaveEditButton(this.ApplicationBar, VM); _delete = new EditPageDeleteButton(ApplicationBar, VM); _filterBinding = tbFilterString.GetBindingExpression(TextBox.TextProperty); Observable.FromEventPattern(tbFilterString, "TextChanged") .Subscribe(_ => _filterBinding.UpdateSource()); }
static DispatcherTimer BuildTimer(object control, BindingExpression exp, int milliseconds) { var timer = new DispatcherTimer(); timer.Interval = TimeSpan.FromMilliseconds(milliseconds); timer.Tick += (sender, e) => { exp.UpdateSource(); lock (Timers) { timer.Stop(); Timers.Remove(control); } }; return timer; }
private void OnEnterNewEarningsKeyDown(object sender, KeyEventArgs e) { if (e.Key == Key.Return) { if (_bindingExpression != null) { _bindingExpression.UpdateSource(); } else { TextBox tb = sender as TextBox; if (tb != null) { _bindingExpression = BindingOperations.GetBindingExpression(tb, TextBox.TextProperty); if (_bindingExpression != null) { _bindingExpression.UpdateSource(); } } } } }