private void btnCurrentContact_Click(object sender, RoutedEventArgs e) { Button btn1 = (Button)sender; TextBlock tb = btn1.FindName("contactName") as TextBlock; DataContext = new CurrentContactModel(); CurrentContactViewModel control2 = new CurrentContactViewModel(tb.Text); ContactViewModel.control2.Children.Add(control2); }
private void btnContact_Click(object sender, RoutedEventArgs e) { Button btn = (Button)sender; TextBlock tbContactName = btn.FindName("tbContactName") as TextBlock; TextBlock tbContactEmail = btn.FindName("tbContactEmail") as TextBlock; DataContext = new CurrentContactModel(); CurrentContactViewModel ctrl = new CurrentContactViewModel(tbContactName.Text, tbContactEmail.Text); ContactViewModel.ctrl.Children.Add(ctrl); }
public ActionResult PersonalizedGreeting() { CurrentContactViewModel model; // If on-line marketing is disabled, CurrentContact is null if (CurrentContact != null) { model = new CurrentContactViewModel(CurrentContact); } else { model = null; } return(View(model)); }