protected override void OnNavigatedTo(NavigationEventArgs e) { EngadgetModel = NavigationServices.CurrentViewModel as EngadgetViewModel; if (e.NavigationMode == NavigationMode.New && NavigationContext.QueryString.ContainsKey("id")) { string id = NavigationContext.QueryString["id"]; if (!String.IsNullOrEmpty(id)) { _isDeepLink = true; EngadgetModel = new EngadgetViewModel(); NavigationServices.CurrentViewModel = EngadgetModel; EngadgetModel.LoadItem(id); } } if (EngadgetModel != null) { EngadgetModel.ViewType = ViewTypes.Detail; } DataContext = EngadgetModel; base.OnNavigatedTo(e); }
public EngadgetPage() { InitializeComponent(); EngadgetModel = new EngadgetViewModel(); }