Пример #1
0
        /// <summary>
        /// C'tor for insert contact's details in the specific fields
        /// </summary>
        public AddEditContactWindow(Person person)
        {
            InitializeComponent();
            cmbGroupName.ItemsSource = pl.GroupsDisplay();

            this.person       = person;
            txtFirstName.Text = person.FirstName;
            txtLastName.Text  = person.LastName;
            txtID.Text        = person.ID.ToString();
            cmbGroupName.Text = person.GroupName;
            PhoneNumbersGrid.Children.Clear();
            foreach (var item in person.Phones)
            {
                PhoneControl pc = new PhoneControl();
                pc.PhoneNumber  = item.Number;
                pc.PhoneType    = item.TypeName;
                pc.PhoneID      = item.PhoneID;
                pc.RemovePhone += new PropertyChangedEventHandler(PhoneControl_RemovePhone);
                PhoneNumbersGrid.Children.Add(pc);
            }
        }
Пример #2
0
        void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target)
        {
            switch (connectionId)
            {
            case 1:
                this.winAddContact = ((GUI.AddEditContactWindow)(target));
                return;

            case 2:
                this.lblWindowHeader = ((System.Windows.Controls.Label)(target));
                return;

            case 3:
                this.lblID = ((System.Windows.Controls.Label)(target));
                return;

            case 4:
                this.txtID = ((System.Windows.Controls.TextBox)(target));
                return;

            case 5:
                this.lblFirstName = ((System.Windows.Controls.Label)(target));
                return;

            case 6:
                this.txtFirstName = ((System.Windows.Controls.TextBox)(target));
                return;

            case 7:
                this.lblLastName = ((System.Windows.Controls.Label)(target));
                return;

            case 8:
                this.txtLastName = ((System.Windows.Controls.TextBox)(target));
                return;

            case 9:
                this.lblPhoneNumber = ((System.Windows.Controls.Label)(target));
                return;

            case 10:
                this.PhoneNumbersGrid = ((System.Windows.Controls.StackPanel)(target));
                return;

            case 11:
                this.phoneControl = ((GUI.PhoneControl)(target));
                return;

            case 12:
                this.lblGroupName = ((System.Windows.Controls.Label)(target));
                return;

            case 13:
                this.cmbGroupName = ((System.Windows.Controls.ComboBox)(target));
                return;

            case 14:
                this.borderMenu = ((System.Windows.Controls.Border)(target));
                return;

            case 15:
                this.btnSave = ((System.Windows.Controls.Button)(target));

            #line 57 "..\..\..\AddEditContactWindow.xaml"
                this.btnSave.Click += new System.Windows.RoutedEventHandler(this.btnSave_Click);

            #line default
            #line hidden
                return;

            case 16:
                this.btnExit = ((System.Windows.Controls.Button)(target));

            #line 58 "..\..\..\AddEditContactWindow.xaml"
                this.btnExit.Click += new System.Windows.RoutedEventHandler(this.btnExit_Click);

            #line default
            #line hidden
                return;

            case 17:
                this.btnAddAnotherPhone = ((System.Windows.Controls.Button)(target));

            #line 61 "..\..\..\AddEditContactWindow.xaml"
                this.btnAddAnotherPhone.Click += new System.Windows.RoutedEventHandler(this.btnAddAnotherPhone_Click);

            #line default
            #line hidden
                return;
            }
            this._contentLoaded = true;
        }