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