public PPersonalForm() { this.InitializeComponent(); XAvatarImage.Source = new BitmapImage(new Uri(DataSaver.Path + "camera_a.png", UriKind.Absolute)); //==initialize personal properties this.XPersonalListBox.Items.Add(new PersonalProperyShower( new PersonalProperty("Фамилия", DataSaver.CurrentUser.FirstName, PropertyType.Name), this)); this.XPersonalListBox.Items.Add(new PersonalProperyShower( new PersonalProperty("Имя", DataSaver.CurrentUserLastName, PropertyType.Name), this)); this.XPersonalListBox.Items.Add(new PersonalProperyShower( new PersonalProperty("Отчество", DataSaver.CurrentUserMidleName, PropertyType.Name), this)); this.XPersonalListBox.Items.Add(new PersonalProperyShower( new PersonalProperty("Дата рождения", DataSaver.CurrentUserBirthDate, PropertyType.Birthdate), this)); this.XPersonalListBox.Items.Add(new PersonalProperyShower( new PersonalProperty("Адрес", DataSaver.CurrentUser.Position, PropertyType.Address), this)); foreach (Contact contact in DataSaver.CurrentUser.Contacts) { _lastContactIndex = XPersonalListBox.Items.Count + 1; this.XPersonalListBox.Items.Add(new PersonalProperyShower( new PersonalProperty(contact.Type, contact.Value, PropertyType.Contact), this)); } CAddContactButton = new Button(); CAddContactButton.FontSize = 18; CAddContactButton.Content = "Добавить контакт"; CAddContactButton.Click += CAddContactButton_Click; XPersonalListBox.Items.Add(CAddContactButton); XAvatarImage.MouseLeftButtonDown += XAvatarImage_MouseLeftButtonDown; XPersonalListBox.KeyDown += XPersonalListBox_KeyDown; //===initialize manager's corner int num = DataBaseInterface.GetNumNewMessages(DataSaver.UId, DataSaver.PasswordHash); if (num > 0) { XNumNewMessages.Text = "(" + num + ")"; } }