private void ReBindTranStatusTxt() { Binding myBinding = new Binding("Status"); myBinding.Source = SalesVM.TransactionData; ((FrameworkElement)SalesPad.FindName("TransStatusTxt")).SetBinding(TextBlock.TextProperty, myBinding); }
private void ReBindItemEditor() { Binding myBinding = new Binding("SelectedItem"); myBinding.Source = SalesView.SalesLst; myBinding.Mode = BindingMode.OneWay; ((FrameworkElement)SalesPad.FindName("ItemEditor")).SetBinding(ContentControl.ContentProperty, myBinding); }
private void ReBindTranStatusTxt() { Binding myBinding = new Binding("Status"); myBinding.Source = SalesVM.Instance.TransactionData; if (SalesPad != null) { var frameworkElement = (FrameworkElement)SalesPad.FindName("TransStatusTxt"); if (frameworkElement != null) { if (TextBlock.TextProperty != null) { frameworkElement.SetBinding(TextBlock.TextProperty, myBinding); } } } }
private void ReBindItemEditor() { try { ReBindTranStatusTxt(); Binding myBinding = new Binding("SelectedItem"); myBinding.Source = SalesView.SalesLst; myBinding.Mode = BindingMode.OneWay; if (ContentProperty != null) { ((FrameworkElement)SalesPad.FindName("ItemEditor")).SetBinding(ContentProperty, myBinding); } } catch (Exception ex) { Logger.Log(LoggingLevel.Error, GetCurrentMethodClass.GetCurrentMethod() + ": --- :" + ex.Message + ex.StackTrace); throw ex; } }