Пример #1
0
        private void Choose_ReadyButtonClicked(object sender, EventArgs e)
        {
            ChoosePerson choose = (ChoosePerson)sender;

            PersonModel selectedPerson = choose.SelectedPersons.First();

            SelectedPerson      = selectedPerson;
            senderLabel.Content = selectedPerson.FullName;

            _parent.mainCanvas.Children.Remove(choose);

            AdditionalChoose addChoose = new AdditionalChoose(selectedPerson.PhoneNumbers.Cast <object>().ToList(), "Wybierz numer telefonu");

            addChoose.ReadyButtonClicked += (s2, ea2) =>
            {
                PhoneNumberModel selectedNumber = (PhoneNumberModel)addChoose.SelectedItems[0];
                SelectedPhoneNumber  = selectedNumber;
                senderLabel.Content += " (" + selectedNumber.Number + ")";
                _parent.mainCanvas.Children.Remove(addChoose);
                Darkened = false;
            };

            addChoose.CancelButtonClicked += (s2, ea2) =>
            {
                _parent.mainCanvas.Children.Remove(addChoose);
                Darkened            = false;
                senderLabel.Content = "";
            };

            _parent.mainCanvas.Children.Add(addChoose);
        }
Пример #2
0
        private void ChooseSender_Clicked(object sender, EventArgs e)
        {
            Darkened = true;
            ChoosePerson choose = new ChoosePerson(_parent, _parent.Persons.Where(obj => !_conversation.Members.Contains(obj) || obj.IsInternalUser || !obj.PhoneNumbers.Any()).ToList(), false, ChoosePersonMode.ChoosePhoneNumber);

            _parent.mainCanvas.Children.Add(choose);

            choose.ReadyButtonClicked += Choose_ReadyButtonClicked;

            choose.CancelButtonClicked += (s, ea) =>
            {
                _parent.mainCanvas.Children.Remove(choose);
                Darkened            = false;
                senderLabel.Content = "";
            };
        }