예제 #1
0
        public static ShareViewModel Parse(IDictionary <string, string> queryString)
        {
            ShareViewModel svm = new ShareViewModel();

            string s;

            if (queryString.TryGetValue("uri", out s))
            {
                Uri u;
                if (Uri.TryCreate(s, UriKind.Absolute, out u))
                {
                    svm.LinkUri = u;
                }
            }

            if (queryString.TryGetValue("title", out s))
            {
                svm.Title = s;
            }

            if (queryString.TryGetValue("message", out s))
            {
                svm.Message = s;
            }

            if (queryString.TryGetValue("footer", out s))
            {
                svm.Footer = s;
            }

            return(svm);
        }
        public static ShareViewModel Parse(IDictionary<string, string> queryString)
        {
            ShareViewModel svm = new ShareViewModel();

            string s;
            if (queryString.TryGetValue("uri", out s))
            {
                Uri u;
                if (Uri.TryCreate(s, UriKind.Absolute, out u))
                {
                    svm.LinkUri = u;
                }
            }

            if (queryString.TryGetValue("title", out s))
            {
                svm.Title = s;
            }

            if (queryString.TryGetValue("message", out s))
            {
                svm.Message = s;
            }

            if (queryString.TryGetValue("footer", out s))
            {
                svm.Footer = s;
            }

            return svm;
        }
예제 #3
0
        protected override void OnNavigatedTo(System.Windows.Navigation.NavigationEventArgs e)
        {
            base.OnNavigatedTo(e);

            if (_left)
            {
                LayoutRoot.Opacity = 0;
                Dispatcher.BeginInvoke(NavigationService.GoBack);
            }
            else
            {
                LayoutRoot.Opacity = 1.0;

                DataContext = ShareViewModel.Parse(NavigationContext.QueryString);
            }
        }