コード例 #1
0
 private static void RefreshBindingExpression(BindingExpression bindingExpression)
 {
     if (bindingExpression != null)
     {
         bindingExpression.UpdateSource();
     }
 }
コード例 #2
0
        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());
        }
コード例 #3
0
        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;
        }
コード例 #4
0
 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();
                 }
             }
         }
     }
 }