Ejemplo n.º 1
0
        public static FrameNavigation.Parameter GetNavigationParameter(String applicationTitle)
        {
            var parameter = new FrameNavigation.Parameter("title", applicationTitle);

            parameter.Add("version", SystemInfo.ApplicationPackageVersion.ToString());
            return(parameter);
        }
Ejemplo n.º 2
0
        protected override async void SetState(FrameNavigation.Parameter navigationParameter, FrameNavigation.Parameter stateParameter)
        {
            var changelogFile = await StorageFile.GetFileFromApplicationUriAsync(new Uri("ms-appx:///Changelog.json"));

            var changelogString = await FileIO.ReadTextAsync(changelogFile);

            var releases = new List <Release>();

            foreach (var releaseItem in JsonArray.Parse(changelogString))
            {
                var release  = releaseItem.GetObject();
                var version  = release["version"].GetString();
                var date     = DateTime.Parse(release["date"].GetString());
                var sections = new List <ReleaseSection>();
                foreach (var sectionItem in release["sections"].GetArray())
                {
                    var section = sectionItem.GetObject();
                    var title   = section["title"].GetString();
                    var changes = new List <String>();
                    foreach (var changeItem in section["changes"].GetArray())
                    {
                        changes.Add(changeItem.GetString());
                    }
                    sections.Add(new ReleaseSection(title, changes));
                }
                releases.Add(new Release(version, date, sections));
            }
            ReleaseListControl.ItemsSource = releases;
        }
Ejemplo n.º 3
0
        protected override async void SetState(FrameNavigation.Parameter navigationParameter, FrameNavigation.Parameter stateParameter)
        {
            base.SetState(navigationParameter, stateParameter);
            if (navigationParameter.Get() == "share")
            {
                PrimaryMenu.SelectedIndex = 3;
            }
            else
            {
                PrimaryMenu.Items.Remove(SharedLinkMenuItem);
                if (!App.Model.MapView.Available)
                {
                    var mapView = await Task.Run(async() => await App.Model.MapView.GetAsync().ConfigureAwait(false));

                    if (!App.Model.MapView.Available && (mapView != null))
                    {
                        Map.Center    = mapView.Location.ToGeopoint();
                        Map.ZoomLevel = mapView.ZoomLevel;
                    }
                }
                PrimaryMenu.SelectedIndex = 1;
            }

            await Context.InitializeAsync();

            await TryAskForReviewAsync();
        }
Ejemplo n.º 4
0
        private void OnAboutButtonClicked(Object sender, RoutedEventArgs args)
        {
            var parameter = new FrameNavigation.Parameter("title", Constants.ApplicationTitle).Add("version", Constants.ApplicationVersion);

            AboutPage.ExtendedContent = new ExtendedAboutPageContent();
            Navigation.Navigate(typeof(AboutPage), parameter);
        }
Ejemplo n.º 5
0
        protected override void SetState(FrameNavigation.Parameter navigationParameter, FrameNavigation.Parameter stateParameter)
        {
            var protocolFilter = new HttpBaseProtocolFilter();

            foreach (var cookie in protocolFilter.CookieManager.GetCookies(new Uri("https://oauth.vk.com")))
            {
                protocolFilter.CookieManager.DeleteCookie(cookie);
            }
            WebView.Source = VkAuthorization.GetOAuthUri();
        }
Ejemplo n.º 6
0
 protected override void SetState(FrameNavigation.Parameter navigationParameter, FrameNavigation.Parameter stateParameter)
 {
     ApplicationTitle = $"{navigationParameter.Get("title")} ({navigationParameter.Get("version")}), OS: {SystemInfo.OsVersion}";
 }
Ejemplo n.º 7
0
 protected override async void SetState(FrameNavigation.Parameter navigationParameter, FrameNavigation.Parameter stateParameter)
 {
     base.SetState(navigationParameter, stateParameter);
     await Context.InitializeAsync();
 }