Example #1
0
        /// <summary>
        /// Show a notification with the changelog to new users.
        /// </summary>
        private void ShowChangelog()
        {
            var v = Package.Current.Id.Version;
            var currentVersion = $"{v.Major}.{v.Minor}.{v.Build}";

            var lastVersion = App._LocalSettings.Get <string>(UserSettings.LastVersion);

            if (currentVersion == lastVersion)
            {
                return;
            }

            vm.InfoBarTitle   = $"Welcome to Crypto Tracker v{currentVersion}";
            vm.InfoBarMessage = "New in this version: \n";

            if (App._LocalSettings.Get <bool>(UserSettings.IsNewUser))
            {
                App._LocalSettings.Set(UserSettings.IsNewUser, false);
                vm.InfoBarMessage += Changelogs.FormatChangelog(Changelogs.MajorChangelog);
            }
            else
            {
                vm.InfoBarMessage += Changelogs.FormatChangelog(Changelogs.CurrentChangelog);
            }

            vm.InfoBarOpened = true;
            App._LocalSettings.Set(UserSettings.LastVersion, currentVersion);
        }
        private void SettingsChangelog_Loaded(object sender, RoutedEventArgs e)
        {
            var version = Package.Current.Id.Version;

            foreach (var changelog in Changelogs.LatestChangelogs)
            {
                var changes = Changelogs.FormatChangelog(changelog.Value);
                var s       = new StackPanel()
                {
                    Children =
                    {
                        new TextBlock()
                        {
                            Text = changelog.Key, Style = Resources["SettingsSectionSubtitle"] as Style
                        },
                        new TextBlock()
                        {
                            Text = changes
                        }
                    }
                };
                ChangeLogList.Children.Add(s);
            }
        }