Example #1
0
        private static void SetText(DependencyObject d, DependencyPropertyChangedEventArgs e)
        {
            ContactControl control = d as ContactControl;

            if (control != null)
            {
                control.nameTextBlock.Text  = (e.NewValue as Contact).Name;
                control.emailTextBlock.Text = (e.NewValue as Contact).Email;
                control.phoneTextBlock.Text = (e.NewValue as Contact).Phone;
            }
        }
Example #2
0
        private static void SetText(DependencyObject d, DependencyPropertyChangedEventArgs e)
        {
            ContactControl control = d as ContactControl;

            if (control != null)
            {
                control.textblockName.Text        = (e.NewValue as Contact).Name;
                control.textblockEmail.Text       = (e.NewValue as Contact).Email;
                control.textblockPhoneNumber.Text = (e.NewValue as Contact).PhoneNumber;
            }
        }
Example #3
0
        // The "Event handler" which sets our setText when the text is changed
        // d sets control as our Contact Control dependency object which will give us control of the textBlocks
        private static void SetText(DependencyObject d, DependencyPropertyChangedEventArgs e)
        {
            ContactControl control = d as ContactControl;

            if (control != null)
            {
                control.nameTextBlock.Text  = (e.NewValue as ContactModel).Name; // Everytime the text is changed, the new value is assigned to Name
                control.emailTextBlock.Text = (e.NewValue as ContactModel).Email;
                control.phoneTextBlock.Text = (e.NewValue as ContactModel).Phone;
            }
        }
Example #4
0
        private static void SetText(DependencyObject d, DependencyPropertyChangedEventArgs e)
        {
            ContactControl control = d as ContactControl;

            if (control != null)
            {
                control.nameTextBlock.Text     = (e.NewValue as Customer).Name;
                control.emailTextBlock.Text    = (e.NewValue as Customer).Email;
                control.phoneTextBlock.Text    = (e.NewValue as Customer).Phone;
                control.addressTextBlock.Text  = (e.NewValue as Customer).Address;
                control.dateTextBlock.Text     = "Last Service Date: " + (e.NewValue as Customer).DateLastTuned.ToShortDateString();
                control.nextApptTextBlock.Text = "Next Scheduled Appt: " + (e.NewValue as Customer).NextApptDate.ToShortDateString()
                                                 + " at " + (e.NewValue as Customer).NextApptTime;
                control.notesTextBlock.Text = "Notes: " + (e.NewValue as Customer).Notes;
            }
        }