Exemplo n.º 1
0
        protected override void OnNavigatedTo(NavigationEventArgs e)
        {
            base.OnNavigatedTo(e);

            if (isNewInstance)
            {
                if (viewModel == null)
                {
                    if (State.Count > 0)
                    {
                        viewModel = (SessionViewModel)State["viewModel"];
                    }
                    else
                    {
                        viewModel = new SessionViewModel();
                        viewModel.Load(this.QueryStringInt("sessionid"));
                    }
                    DataContext = viewModel;
                }
            }
            isNewInstance = false;
        }