Exemple #1
0
        private async void Privacy_Click(object sender, RoutedEventArgs e)
        {
            var file = await StorageFile.GetFileFromApplicationUriAsync(new Uri("ms-appx:///Privacy.md"));

            var dialog = new MarkdownDialog(lang.GetString("About/Privacy"), await FileIO.ReadTextAsync(file));
            await dialog.ShowAsync();
        }
        private async Task ShowWhatsNew()
        {
            var ver = Version.Parse(SettingsStorage.GetObjectLocal("_version", new Version(0, 0, 0, 0).ToString()));

            if (!SettingsStorage.GetObjectLocal("WasUpdated", false) && ver == new Version(0, 0, 0, 0))
            {
                return;
            }
            SettingsStorage.DeleteObjectLocal("WasUpdated");
            SettingsStorage.DeleteObjectLocal("_version");

            if (Platform.Version.Revision != 0)
            {
                return;
            }

            var log = await Updates.GetChangelog(Platform.Version);

            if (string.IsNullOrEmpty(log.Name) || string.IsNullOrEmpty(log.Content))
            {
                return;
            }

            var dialog = new MarkdownDialog(lang.GetString("HostTab/ChangelogTitle"), log.Content);
            await dialog.ShowAsync();
        }
Exemple #3
0
        public void ShowMarkdownDialog(string title, string markdown)
        {
            var window = GetActiveWindow();

            if (window == null)
            {
                return;
            }

            window.Dispatcher.Invoke(() =>
            {
                var dialog = new MarkdownDialog(window)
                {
                    Markdown = markdown,
                    Title    = title
                };
                return(window.ShowMetroDialogAsync(dialog));
            });
        }
Exemple #4
0
        public async Task <bool?> ShowMarkdownDialog(string title, string markdown, MetroDialogSettings settings = null)
        {
            var result = false;
            var window = GetActiveWindow();

            if (window == null)
            {
                return(null);
            }

            var dialog = new MarkdownDialog(window, settings)
            {
                Markdown = markdown,
                Title    = title
            };

            dialog.PART_AffirmativeButton.Click += (sender, args) => result = true;

            await Execute.OnUIThreadAsync(() => GetActiveWindow().ShowMetroDialogAsync(dialog));

            await dialog.WaitUntilUnloadedAsync();

            return(result);
        }