public AddUrlView(HomeViewModel homeViewModel) { WindowStartupLocation = WindowStartupLocation.CenterScreen; InitializeComponent(); var addUrlViewModel = new AddUrlViewModel(homeViewModel); DataContext = addUrlViewModel; addUrlViewModel.Closing += (s, e) => Close(); }
public ActionResult Add(AddUrlViewModel userInput) { if (ModelState.IsValid) { // store the data // ... //return RedirectToAction("Index", "Home"); return(View(userInput)); } return(View()); }
/// <summary> /// Initializes a new instance of the <see cref="AddUrlContent"/> class. /// </summary> /// <param name="addUrlViewModel">The model view.</param> public AddUrlContent(AddUrlViewModel addUrlViewModel) { DataContext = addUrlViewModel; }