private static void SetText(DependencyObject d, DependencyPropertyChangedEventArgs e) { ContactControl control = d as ContactControl; if (control != null) { control.nameTextBlock.Text = ((Contact)e.NewValue).Name; control.phoneTextBlock.Text = ((Contact)e.NewValue).PhoneNum; control.emailTextBlock.Text = ((Contact)e.NewValue).Email; } }
private static void SetText(DependencyObject d, DependencyPropertyChangedEventArgs e) { ContactControl control = d as ContactControl; if (control != null) { control.txtBlockName.Text = (e.NewValue as Contact).Name; control.txtBlockEmail.Text = (e.NewValue as Contact).Email; control.txtBlockPhone.Text = (e.NewValue as Contact).Phone; } }