示例#1
0
        protected virtual async void OnXamlCode()
        {
            await this.Content.FadeOutAsync(100);

            var control = new PrettifyControl();

            control.XamlSource = await ReadContent(new Uri($"ms-appx:///Pages/{SampleName}/Docs/{SampleName}Xaml.xml"));

            this.Content = control;
        }
示例#2
0
        protected virtual async void OnJson()
        {
            await this.Content.FadeOutAsync(100);

            var control = new PrettifyControl();

            control.JsonSource = await ReadContent(new Uri($"ms-appx:///Pages/{SampleName}/Docs/{SampleName}Json.json"));

            this.Content = control;
        }
        protected virtual async void OnSourceCode()
        {
            await this.Content.FadeOutAsync(100);

            var control = new PrettifyControl();

            control.CSharpSource = await ReadContent(new Uri($"ms-appx:///{_path}/{SampleName}/Docs/{SampleName}CSharp.cs"));

            this.Content = control;
        }
示例#4
0
        protected virtual async void OnHelp()
        {
            string typeName = $"AppStudio.Uwp.Samples.{SampleName}Help";

            if (IsTypePresent(typeName))
            {
                var border = new Border
                {
                    Padding         = new Thickness(0, 0, 0, 12),
                    Background      = new SolidColorBrush(Colors.White),
                    BorderBrush     = new SolidColorBrush(Colors.LightGray),
                    BorderThickness = new Thickness(0, 0, 0, 1),
                    Child           = Activator.CreateInstance(Type.GetType(typeName)) as Control
                };
                AppShell.Current.Shell.ShowTopPane(border);
            }
            else
            {
                var control = new PrettifyControl();
                AppShell.Current.Shell.ShowTopPane(control);
                control.HtmlSource = await ReadContent(new Uri($"ms-appx:///Pages/{SampleName}/Docs/{SampleName}Help.html"));
            }
        }
示例#5
0
        protected virtual async void OnJson()
        {
            await this.Content.FadeOutAsync(100);

            var control = new PrettifyControl();
            control.JsonSource = await ReadContent(new Uri($"ms-appx:///{_path}/{SampleName}/Docs/{SampleName}Json.json"));
            this.Content = control;
        }
示例#6
0
        protected virtual async void OnXamlCode()
        {
            await this.Content.FadeOutAsync(100);

            var control = new PrettifyControl();
            control.XamlSource = await ReadContent(new Uri($"ms-appx:///{_path}/{SampleName}/Docs/{SampleName}Xaml.xml"));
            this.Content = control;
        }
示例#7
0
 protected virtual async void OnHelp()
 {
     string typeName = $"{_nmspc}.{SampleName}Help";
     if (IsTypePresent(typeName))
     {
         var border = new Border
         {
             Padding = new Thickness(0, 0, 0, 12),
             Background = new SolidColorBrush(Colors.White),
             BorderBrush = new SolidColorBrush(Colors.LightGray),
             BorderThickness = new Thickness(0, 0, 0, 1),
             Child = Activator.CreateInstance(Type.GetType(typeName)) as Control
         };
         AppShell.Current.Shell.ShowTopPane(border);
     }
     else
     {
         var control = new PrettifyControl();
         AppShell.Current.Shell.ShowTopPane(control);
         control.HtmlSource = await ReadContent(new Uri($"ms-appx:///{_path}/{SampleName}/Docs/{SampleName}Help.html"));
     }
 }