public AddPhoneInfo() { InitializeComponent(); if (viewModel == null) { viewModel = new PhoneInfoViewModel(this); } BindingContext = viewModel; }
public AddPhoneInfo(PhoneInformation Model) { InitializeComponent(); if (viewModel == null) { viewModel = new PhoneInfoViewModel(this, true); } BindingContext = viewModel; viewModel.Model = Model; }
public IActionResult List(string department = null) { PhoneInfoViewModel models = new PhoneInfoViewModel { Header = department ?? "Все отделы", Phones = _phoneBook.Phones .Where(p => department == null || p.Department == department) }; return(View(models)); }