Exemple #1
0
 public AddPhoneInfo()
 {
     InitializeComponent();
     if (viewModel == null)
     {
         viewModel = new PhoneInfoViewModel(this);
     }
     BindingContext = viewModel;
 }
Exemple #2
0
 public AddPhoneInfo(PhoneInformation Model)
 {
     InitializeComponent();
     if (viewModel == null)
     {
         viewModel = new PhoneInfoViewModel(this, true);
     }
     BindingContext  = viewModel;
     viewModel.Model = Model;
 }
Exemple #3
0
        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));
        }