Exemplo n.º 1
0
        protected override void OnNavigatedTo(System.Windows.Navigation.NavigationEventArgs e)
        {
            string id;

            if (NavigationContext.QueryString.TryGetValue("photoid", out id))
            {
                this.DataContext = DataManager.Current.Load <PhotoVm>(id);
            }

            string type;

            if (NavigationContext.QueryString.TryGetValue("collection", out id) && NavigationContext.QueryString.TryGetValue("type", out type))
            {
                Type collectionType = Type.GetType(type);

                if (collectionType != null)
                {
                    var identifier = PhotoCollectionLoadContext.FromString(id);

                    _collectionVm = (PhotoCollectionVmBase)DataManager.Current.Load(collectionType, identifier);
                }
            }
            base.OnNavigatedTo(e);
        }
Exemplo n.º 2
0
        protected override void OnNavigatedTo(System.Windows.Navigation.NavigationEventArgs e)
        {
            string id;

            if (NavigationContext.QueryString.TryGetValue("photoid", out id))
            {
                this.DataContext = DataManager.Current.Load<PhotoVm>(id);
            }

            string type;

            if (NavigationContext.QueryString.TryGetValue("collection", out id) && NavigationContext.QueryString.TryGetValue("type", out type))
            {
                Type collectionType = Type.GetType(type);

                if (collectionType != null)
                {
                    var identifier = PhotoCollectionLoadContext.FromString(id);

                    _collectionVm = (PhotoCollectionVmBase)DataManager.Current.Load(collectionType, identifier);
                }
            }
            base.OnNavigatedTo(e);
        }