public PhoneWindow(PhoneWindowViewModel mobile) { InitializeComponent(); this.DataContext = mobile; mobile.AnswerCall += _phoneAnswerCall; addButton.Click += clearBoxes; }
private void AddNewClient() { if (NumberNewClient != null) { bool check = !mobileOperator.Phones.Any(x => x.Number == NumberNewClient); if (check) { PhoneWindowViewModel mobile = new PhoneWindowViewModel(mobileOperator) { Number = NumberNewClient }; PhoneWindow phoneView = new PhoneWindow(mobile); phoneView.Show(); } } }
public void AddPhone(PhoneWindowViewModel phone) { Phones.Add(phone); phone.Call += DialingNumber; this.Call += phone.ReceiveCall; }