Merge pull request #1 from nventive/dev/madi/add-banner-and-popup
142253 add baner and popup RoslynQuoter
This commit is contained in:
Коммит
2633b934c2
14
nuget.config
14
nuget.config
|
@ -1,14 +0,0 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<configuration>
|
||||
<activePackageSource>
|
||||
<add key="All" value="(Aggregate source)" />
|
||||
</activePackageSource>
|
||||
<packageSources>
|
||||
<add key="LocalCache" value=".\PackageCache" />
|
||||
<add key="api.nuget.org" value="https://api.nuget.org/v3/index.json" />
|
||||
<add key="Microsoft and .NET" value="https://www.nuget.org/api/v2/curated-feeds/microsoftdotnet/" />
|
||||
</packageSources>
|
||||
<disabledPackageSources>
|
||||
<add key="Microsoft and .NET" value="true" />
|
||||
</disabledPackageSources>
|
||||
</configuration>
|
Двоичный файл не отображается.
После Ширина: | Высота: | Размер: 920 B |
Двоичный файл не отображается.
После Ширина: | Высота: | Размер: 13 KiB |
Двоичный файл не отображается.
После Ширина: | Высота: | Размер: 773 B |
Двоичный файл не отображается.
После Ширина: | Высота: | Размер: 12 KiB |
Двоичный файл не отображается.
После Ширина: | Высота: | Размер: 5.6 KiB |
Двоичные данные
src/uno/RoslynQuoter.Shared/Assets/splashscreen.scale-200.png
Двоичные данные
src/uno/RoslynQuoter.Shared/Assets/splashscreen.scale-200.png
Двоичный файл не отображается.
До Ширина: | Высота: | Размер: 22 KiB |
|
@ -4,92 +4,152 @@
|
|||
xmlns:wasm="http://uno/wasm"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:local="using:RoslynQuoter"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
mc:Ignorable="d xamarin wasm">
|
||||
mc:Ignorable="xamarin wasm">
|
||||
|
||||
<Page.Resources>
|
||||
<ResourceDictionary>
|
||||
<ResourceDictionary.MergedDictionaries>
|
||||
<ResourceDictionary Source="UnoPlatformShell.xaml" />
|
||||
</ResourceDictionary.MergedDictionaries>
|
||||
</ResourceDictionary>
|
||||
</Page.Resources>
|
||||
|
||||
<Grid>
|
||||
|
||||
<Grid Background="{ThemeResource ApplicationPageBackgroundThemeBrush}"
|
||||
Margin="15">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="*" />
|
||||
<ColumnDefinition Width="*" />
|
||||
</Grid.ColumnDefinitions>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="auto" />
|
||||
<RowDefinition />
|
||||
<RowDefinition Height="auto" />
|
||||
<RowDefinition />
|
||||
<RowDefinition Height="auto" />
|
||||
</Grid.RowDefinitions>
|
||||
<StackPanel Grid.ColumnSpan="2"
|
||||
Margin="0,0,0,15">
|
||||
<TextBlock FontWeight="Bold"
|
||||
FontSize="20"
|
||||
TextWrapping="Wrap">
|
||||
<Run Text="Welcome to the" />
|
||||
<Hyperlink NavigateUri="https://platform.uno">Uno Platform </Hyperlink>
|
||||
<Hyperlink NavigateUri="https://github.com/nventive/Uno.RoslynQuoter">fork</Hyperlink>
|
||||
<Run Text="of Kirill Osenkov's" />
|
||||
<Hyperlink NavigateUri="https://github.com/KirillOsenkov/RoslynQuoter">Roslyn Quoter App</Hyperlink>
|
||||
<xamarin:Run Text="running on" />
|
||||
<wasm:Run Text="WebAssembly" />
|
||||
</TextBlock>
|
||||
<TextBlock Margin="0,0,0,10" TextWrapping="Wrap">This application is running <Bold>entirely locally</Bold> on your machine, no code is being sent out to the wire.</TextBlock>
|
||||
<TextBlock FontStyle="Italic" TextWrapping="Wrap">
|
||||
Note that this app is running the mono interpreted mode
|
||||
(which is about <Hyperlink NavigateUri="https://github.com/stefan-schweiger/dotWasmBenchmark">50x slower
|
||||
than it should be</Hyperlink>), and is for the time being best experienced in Microsoft Edge or Firefox.
|
||||
</TextBlock>
|
||||
</StackPanel>
|
||||
<TextBox AcceptsReturn="true"
|
||||
Grid.Row="1"
|
||||
ScrollViewer.VerticalScrollBarVisibility="Auto"
|
||||
x:Name="inputCode"
|
||||
PlaceholderText="Input some C# code"
|
||||
TextChanged="OnCodeChanged"
|
||||
Margin="0,0,10,10" />
|
||||
<StackPanel Grid.Row="2">
|
||||
<StackPanel Orientation="Horizontal" Spacing="10">
|
||||
<Button Content="Generate"
|
||||
Click="OnGenerateCode"
|
||||
HorizontalAlignment="Left"
|
||||
Margin="0,0,0,0"
|
||||
VerticalAlignment="Center" />
|
||||
<Button Content="Generate LINQPad File"
|
||||
Click="OnGenerateLinqPadCode"
|
||||
HorizontalAlignment="Left"
|
||||
Margin="0,0,0,0"
|
||||
VerticalAlignment="Center" />
|
||||
<!-- UnoPlatformShell -->
|
||||
<local:UnoPlatformShell AppName="Roslyn Quoter App"
|
||||
AppAuthor="Kirill Osenkov"
|
||||
LinkToOriginalApp="https://github.com/KirillOsenkov/RoslynQuoter"
|
||||
LinkToAppAuthor="https://github.com/KirillOsenkov"
|
||||
LinkToUnoPlatformApp="https://github.com/nventive/Uno.RoslynQuoter"
|
||||
VersionNumber="buildVersion">
|
||||
|
||||
<!-- About Content -->
|
||||
<local:UnoPlatformShell.AboutContent>
|
||||
<StackPanel>
|
||||
|
||||
<!-- About Content Line 1 -->
|
||||
<TextBlock TextWrapping="Wrap"
|
||||
Foreground="{StaticResource Color02Brush}"
|
||||
FontStyle="Italic"
|
||||
FontSize="14">
|
||||
|
||||
This application is running
|
||||
<Bold>
|
||||
entirely locally
|
||||
</Bold>
|
||||
on your machine, no code is being sent out to the wire.
|
||||
</TextBlock>
|
||||
|
||||
<!-- About Content Line 2 -->
|
||||
<TextBlock TextWrapping="Wrap"
|
||||
Foreground="{StaticResource Color02Brush}"
|
||||
FontStyle="Italic"
|
||||
FontSize="12"
|
||||
Margin="0,16,0,0">
|
||||
|
||||
The Mono runtime is using the interpreted mode (which is currently about
|
||||
|
||||
<!-- Link to WASM Benchmark -->
|
||||
<Hyperlink NavigateUri="https://github.com/stefan-schweiger/dotWasmBenchmark"
|
||||
Foreground="{StaticResource Color02Brush}">
|
||||
<Bold>
|
||||
<Underline>
|
||||
50x slower than it should be
|
||||
</Underline>
|
||||
</Bold>
|
||||
</Hyperlink>
|
||||
). For a better experience run it in Microsoft Edge or Mozilla Firefox.
|
||||
</TextBlock>
|
||||
</StackPanel>
|
||||
<ComboBox x:Name="comboParseAs"
|
||||
Header="Parse as:">
|
||||
</ComboBox>
|
||||
<CheckBox x:Name="checkBoxOpenParenthesis"
|
||||
Content="Open parenthesis on a new line" />
|
||||
<CheckBox x:Name="checkBoxCloseParenthesis"
|
||||
Content="Closing parenthesis on a new line " />
|
||||
<CheckBox x:Name="checkBoxPreserveWhiteSpace"
|
||||
Content="Preserve original whitespace " />
|
||||
<CheckBox x:Name="checkBoxKeepRedundant"
|
||||
Content="Keep redundant API calls " />
|
||||
<CheckBox x:Name="checkBoxNoSyntaxFactory"
|
||||
Content="Do not require 'using static Microsoft.CodeAnalysis.CSharp.SyntaxFactory;' " />
|
||||
</StackPanel>
|
||||
<TextBox x:Name="result"
|
||||
Grid.Column="1"
|
||||
Grid.Row="1"
|
||||
Grid.RowSpan="3"
|
||||
AcceptsReturn="True"
|
||||
FontFamily="Courier New"
|
||||
Grid.ColumnSpan="2" />
|
||||
<TextBlock x:Name="buildVersion" Grid.Row="4" FontSize="10" Foreground="Gray" Text="Unknown" />
|
||||
</Grid>
|
||||
<Image Source="https://s3.amazonaws.com/github/ribbons/forkme_right_green_007200.png"
|
||||
Stretch="None"
|
||||
VerticalAlignment="Top"
|
||||
HorizontalAlignment="Right"
|
||||
Tapped="OnForkMe" />
|
||||
</local:UnoPlatformShell.AboutContent>
|
||||
|
||||
<!-- App Content -->
|
||||
<local:UnoPlatformShell.AppContent>
|
||||
|
||||
<Grid Background="{StaticResource Color02Brush}"
|
||||
Margin="15"
|
||||
Grid.Row="1">
|
||||
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="*" />
|
||||
<ColumnDefinition Width="*" />
|
||||
</Grid.ColumnDefinitions>
|
||||
|
||||
<!-- Left Side -->
|
||||
<Grid Grid.Column="0">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="*" />
|
||||
<RowDefinition Height="auto" />
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<!-- C# Input -->
|
||||
<TextBox x:Name="inputCode"
|
||||
PlaceholderText="Input some C# code"
|
||||
TextChanged="OnCodeChanged"
|
||||
AcceptsReturn="true"
|
||||
ScrollViewer.VerticalScrollBarVisibility="Auto"
|
||||
VerticalAlignment="Stretch"
|
||||
Margin="0,0,16,16"
|
||||
Grid.Row="0" />
|
||||
|
||||
<StackPanel Grid.Row="1">
|
||||
<StackPanel Orientation="Horizontal"
|
||||
Spacing="16">
|
||||
|
||||
<!-- Generate Button -->
|
||||
<Button Content="Generate"
|
||||
Background="{StaticResource Color01Brush}"
|
||||
Foreground="{StaticResource Color02Brush}"
|
||||
Click="OnGenerateCode"
|
||||
VerticalAlignment="Center" />
|
||||
|
||||
<!-- Generate LINQPad File Button -->
|
||||
<Button Content="Generate LINQPad File"
|
||||
Background="{StaticResource Color01Brush}"
|
||||
Foreground="{StaticResource Color02Brush}"
|
||||
Click="OnGenerateLinqPadCode"
|
||||
VerticalAlignment="Center" />
|
||||
</StackPanel>
|
||||
|
||||
<!-- Parse as ComboBox -->
|
||||
<ComboBox x:Name="comboParseAs"
|
||||
Header="Parse as:"
|
||||
Margin="0,16,0,0" />
|
||||
|
||||
<!-- Open parenthesis CheckBox -->
|
||||
<CheckBox x:Name="checkBoxOpenParenthesis"
|
||||
Content="Open parenthesis on a new line"
|
||||
Margin="0,16,0,0" />
|
||||
|
||||
<!-- Close Parenthesis CheckBox -->
|
||||
<CheckBox x:Name="checkBoxCloseParenthesis"
|
||||
Content="Closing parenthesis on a new line " />
|
||||
|
||||
<!-- Preserve white space CheckBox -->
|
||||
<CheckBox x:Name="checkBoxPreserveWhiteSpace"
|
||||
Content="Preserve original whitespace " />
|
||||
|
||||
<!-- BoxKeep Redundant CheckBox -->
|
||||
<CheckBox x:Name="checkBoxKeepRedundant"
|
||||
Content="Keep redundant API calls " />
|
||||
|
||||
<!-- NoSyntaxFactory checkBox -->
|
||||
<CheckBox x:Name="checkBoxNoSyntaxFactory"
|
||||
Content="Do not require 'using static Microsoft.CodeAnalysis.CSharp.SyntaxFactory;' " />
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
|
||||
<!-- Result (right side) -->
|
||||
<TextBox x:Name="result"
|
||||
FontFamily="Courier New"
|
||||
AcceptsReturn="True"
|
||||
Grid.Column="1"
|
||||
Grid.Row="0"
|
||||
Grid.RowSpan="4" />
|
||||
</Grid>
|
||||
</local:UnoPlatformShell.AppContent>
|
||||
</local:UnoPlatformShell>
|
||||
</Grid>
|
||||
</Page>
|
||||
|
|
|
@ -26,12 +26,13 @@ namespace RoslynQuoter
|
|||
public sealed partial class MainPage : Page
|
||||
{
|
||||
private readonly NodeKind[] _kinds;
|
||||
public string buildVersion;
|
||||
|
||||
public MainPage()
|
||||
{
|
||||
this.InitializeComponent();
|
||||
|
||||
buildVersion.Text = $"Build: {this.GetType().GetTypeInfo().Assembly.GetCustomAttribute<AssemblyInformationalVersionAttribute>()?.InformationalVersion ?? "Unkown"}";
|
||||
buildVersion = $"Version: {this.GetType().GetTypeInfo().Assembly.GetCustomAttribute<AssemblyInformationalVersionAttribute>()?.InformationalVersion ?? "Unkown"}";
|
||||
|
||||
_kinds = new[] {
|
||||
NodeKind.CompilationUnit,
|
||||
|
@ -170,10 +171,5 @@ namespace RoslynQuoter
|
|||
|
||||
return responseText;
|
||||
}
|
||||
|
||||
private async void OnForkMe(object sender, TappedRoutedEventArgs e)
|
||||
{
|
||||
await Windows.System.Launcher.LaunchUriAsync(new Uri("https://github.com/nventive/Uno.RoslynQuoter"));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -21,23 +21,32 @@
|
|||
<Compile Include="$(MSBuildThisFileDirectory)MainPage.xaml.cs">
|
||||
<DependentUpon>MainPage.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="$(MSBuildThisFileDirectory)UnoPlatformShell.cs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Page Include="$(MSBuildThisFileDirectory)MainPage.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
</Page>
|
||||
<Page Include="$(MSBuildThisFileDirectory)UnoPlatformShell.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
</Page>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Content Include="$(MSBuildThisFileDirectory)Assets\GithubLogo.png" />
|
||||
<Content Include="$(MSBuildThisFileDirectory)Assets\lockscreenlogo.scale-200.png" />
|
||||
<Content Include="$(MSBuildThisFileDirectory)Assets\SplashScreen.png" />
|
||||
<Content Include="$(MSBuildThisFileDirectory)Assets\square150x150logo.scale-200.png" />
|
||||
<Content Include="$(MSBuildThisFileDirectory)Assets\square44x44logo.scale-200.png" />
|
||||
<Content Include="$(MSBuildThisFileDirectory)Assets\square44x44logo.targetsize-24_altform-unplated.png" />
|
||||
<Content Include="$(MSBuildThisFileDirectory)Assets\storelogo.png" />
|
||||
<Content Include="$(MSBuildThisFileDirectory)Assets\TwitterLogo.png" />
|
||||
<Content Include="$(MSBuildThisFileDirectory)Assets\UnoLogo.png" />
|
||||
<Content Include="$(MSBuildThisFileDirectory)Assets\UnoLogo_small.png" />
|
||||
<Content Include="$(MSBuildThisFileDirectory)Assets\wide310x150logo.scale-200.png" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<PRIResource Include="$(MSBuildThisFileDirectory)Strings\en\Resources.resw" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Content Include="$(MSBuildThisFileDirectory)Assets\LockScreenLogo.scale-200.png" />
|
||||
<Content Include="$(MSBuildThisFileDirectory)Assets\SplashScreen.scale-200.png" />
|
||||
<Content Include="$(MSBuildThisFileDirectory)Assets\Square150x150Logo.scale-200.png" />
|
||||
<Content Include="$(MSBuildThisFileDirectory)Assets\Square44x44Logo.scale-200.png" />
|
||||
<Content Include="$(MSBuildThisFileDirectory)Assets\Square44x44Logo.targetsize-24_altform-unplated.png" />
|
||||
<Content Include="$(MSBuildThisFileDirectory)Assets\StoreLogo.png" />
|
||||
<Content Include="$(MSBuildThisFileDirectory)Assets\Wide310x150Logo.scale-200.png" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<PRIResource Include="$(MSBuildThisFileDirectory)Strings\en\Resources.resw" />
|
||||
</ItemGroup>
|
||||
</Project>
|
|
@ -0,0 +1,184 @@
|
|||
using System;
|
||||
using Windows.UI.Xaml;
|
||||
using Windows.UI.Xaml.Controls;
|
||||
|
||||
namespace RoslynQuoter
|
||||
{
|
||||
public partial class UnoPlatformShell : Control
|
||||
{
|
||||
private Button _UnoButton;
|
||||
private Button _appButton;
|
||||
private Button _authorButton;
|
||||
private Button _TwitterButton;
|
||||
private Button _GithubButton;
|
||||
private Button _openAboutButton;
|
||||
private Button _closeAboutButton;
|
||||
private Button _softDismissAboutButton;
|
||||
private Button _visitUnoWebsiteButton;
|
||||
|
||||
protected override void OnApplyTemplate()
|
||||
{
|
||||
base.OnApplyTemplate();
|
||||
|
||||
_UnoButton = GetTemplateChild("UnoButton") as Button;
|
||||
_UnoButton.Click += openUnoWebsite;
|
||||
|
||||
_appButton = GetTemplateChild("appButton") as Button;
|
||||
_appButton.Click += openOriginalGitHubProject;
|
||||
|
||||
_authorButton = GetTemplateChild("authorButton") as Button;
|
||||
_authorButton.Click += openAuthorGitHubProfile;
|
||||
|
||||
_TwitterButton = GetTemplateChild("TwitterButton") as Button;
|
||||
_TwitterButton.Click += openTwitterLink;
|
||||
|
||||
_GithubButton = GetTemplateChild("GithubButton") as Button;
|
||||
_GithubButton.Click += openUnoGitHubProject;
|
||||
|
||||
_openAboutButton = GetTemplateChild("openAboutButton") as Button;
|
||||
_openAboutButton.Click += showAbout;
|
||||
|
||||
_closeAboutButton = GetTemplateChild("closeAboutButton") as Button;
|
||||
_closeAboutButton.Click += hideAbout;
|
||||
|
||||
_softDismissAboutButton = GetTemplateChild("softDismissAboutButton") as Button;
|
||||
_softDismissAboutButton.Click += hideAbout;
|
||||
|
||||
_visitUnoWebsiteButton = GetTemplateChild("visitUnoWebsiteButton") as Button;
|
||||
_visitUnoWebsiteButton.Click += openUnoWebsite;
|
||||
}
|
||||
|
||||
// openOriginalGitHubProject
|
||||
private async void openOriginalGitHubProject(object sender, RoutedEventArgs e)
|
||||
{
|
||||
await Windows.System.Launcher.LaunchUriAsync(new Uri(LinkToOriginalApp));
|
||||
}
|
||||
|
||||
// openUnoGitHubProject
|
||||
private async void openUnoGitHubProject(object sender, RoutedEventArgs e)
|
||||
{
|
||||
await Windows.System.Launcher.LaunchUriAsync(new Uri(LinkToUnoPlatformApp));
|
||||
}
|
||||
|
||||
// openAuthorGitHubProfile
|
||||
private async void openAuthorGitHubProfile(object sender, RoutedEventArgs e)
|
||||
{
|
||||
await Windows.System.Launcher.LaunchUriAsync(new Uri(LinkToAppAuthor));
|
||||
}
|
||||
|
||||
// openTwitterLink
|
||||
private async void openTwitterLink(object sender, RoutedEventArgs e)
|
||||
{
|
||||
await Windows.System.Launcher.LaunchUriAsync(new Uri("https://twitter.com/UnoPlatform"));
|
||||
}
|
||||
|
||||
// showAbout
|
||||
private void showAbout(object sender, RoutedEventArgs e)
|
||||
{
|
||||
AboutVisibility = Visibility.Visible;
|
||||
}
|
||||
|
||||
// hideAbout
|
||||
private void hideAbout(object sender, RoutedEventArgs e)
|
||||
{
|
||||
AboutVisibility = Visibility.Collapsed;
|
||||
}
|
||||
|
||||
// openUnoWebsite
|
||||
private async void openUnoWebsite(object sender, RoutedEventArgs e)
|
||||
{
|
||||
await Windows.System.Launcher.LaunchUriAsync(new Uri("https://platform.uno"));
|
||||
}
|
||||
|
||||
// App Name
|
||||
public string AppName
|
||||
{
|
||||
get { return (string)GetValue(AppNameProperty); }
|
||||
set { SetValue(AppNameProperty, value); }
|
||||
}
|
||||
|
||||
public static readonly DependencyProperty AppNameProperty =
|
||||
DependencyProperty.Register("AppName", typeof(string), typeof(UnoPlatformShell), new PropertyMetadata(null));
|
||||
|
||||
// App Author
|
||||
public string AppAuthor
|
||||
{
|
||||
get { return (string)GetValue(AppAuthorProperty); }
|
||||
set { SetValue(AppAuthorProperty, value); }
|
||||
}
|
||||
|
||||
public static readonly DependencyProperty AppAuthorProperty =
|
||||
DependencyProperty.Register("AppAuthor", typeof(string), typeof(UnoPlatformShell), new PropertyMetadata(null));
|
||||
|
||||
// Link to Original App
|
||||
public string LinkToOriginalApp
|
||||
{
|
||||
get { return (string)GetValue(LinkToOriginalAppProperty); }
|
||||
set { SetValue(LinkToOriginalAppProperty, value); }
|
||||
}
|
||||
|
||||
public static readonly DependencyProperty LinkToOriginalAppProperty =
|
||||
DependencyProperty.Register("LinkToOriginalApp", typeof(string), typeof(UnoPlatformShell), new PropertyMetadata(null));
|
||||
|
||||
// Link to Original App
|
||||
public string LinkToAppAuthor
|
||||
{
|
||||
get { return (string)GetValue(LinkToAppAuthorProperty); }
|
||||
set { SetValue(LinkToAppAuthorProperty, value); }
|
||||
}
|
||||
|
||||
public static readonly DependencyProperty LinkToAppAuthorProperty =
|
||||
DependencyProperty.Register("LinkToAppAuthor", typeof(string), typeof(UnoPlatformShell), new PropertyMetadata(null));
|
||||
|
||||
// Link to Uno Platforml App
|
||||
public string LinkToUnoPlatformApp
|
||||
{
|
||||
get { return (string)GetValue(LinkToUnoPlatformAppProperty); }
|
||||
set { SetValue(LinkToUnoPlatformAppProperty, value); }
|
||||
}
|
||||
|
||||
public static readonly DependencyProperty LinkToUnoPlatformAppProperty =
|
||||
DependencyProperty.Register("LinkToUnoPlatformApp", typeof(string), typeof(UnoPlatformShell), new PropertyMetadata(null));
|
||||
|
||||
// VersionNumber
|
||||
public string VersionNumber
|
||||
{
|
||||
get { return (string)GetValue(VersionNumberProperty); }
|
||||
set { SetValue(VersionNumberProperty, value); }
|
||||
}
|
||||
|
||||
public static readonly DependencyProperty VersionNumberProperty =
|
||||
DependencyProperty.Register("VersionNumber", typeof(string), typeof(UnoPlatformShell), new PropertyMetadata(null));
|
||||
|
||||
// About Content
|
||||
public object AboutContent
|
||||
{
|
||||
get { return (object)GetValue(AboutContentProperty); }
|
||||
set { SetValue(AboutContentProperty, value); }
|
||||
}
|
||||
|
||||
public static readonly DependencyProperty AboutContentProperty =
|
||||
DependencyProperty.Register("AboutContent", typeof(object), typeof(UnoPlatformShell), new PropertyMetadata(null));
|
||||
|
||||
// App Content
|
||||
public object AppContent
|
||||
{
|
||||
get { return (object)GetValue(AppContentProperty); }
|
||||
set { SetValue(AppContentProperty, value); }
|
||||
}
|
||||
|
||||
public static readonly DependencyProperty AppContentProperty =
|
||||
DependencyProperty.Register("AppContent", typeof(object), typeof(UnoPlatformShell), new PropertyMetadata(null));
|
||||
|
||||
|
||||
// AboutIsVisible
|
||||
public Visibility AboutVisibility
|
||||
{
|
||||
get { return (Visibility)GetValue(AboutVisibilityProperty); }
|
||||
set { SetValue(AboutVisibilityProperty, value); }
|
||||
}
|
||||
|
||||
public static readonly DependencyProperty AboutVisibilityProperty =
|
||||
DependencyProperty.Register("AboutVisibility", typeof(Visibility), typeof(UnoPlatformShell), new PropertyMetadata(Visibility.Collapsed));
|
||||
}
|
||||
}
|
|
@ -0,0 +1,431 @@
|
|||
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:local="using:RoslynQuoter">
|
||||
|
||||
<!-- Colors -->
|
||||
<Color x:Key="Color01">#FF242424</Color>
|
||||
<Color x:Key="Color02">#FFFFFFFF</Color>
|
||||
<Color x:Key="Color03">#FF9b9b9b</Color>
|
||||
|
||||
<SolidColorBrush x:Key="Color01Brush"
|
||||
Color="{StaticResource Color01}" />
|
||||
<SolidColorBrush x:Key="Color02Brush"
|
||||
Color="{StaticResource Color02}" />
|
||||
<SolidColorBrush x:Key="Color03Brush"
|
||||
Color="{StaticResource Color03}" />
|
||||
<SolidColorBrush x:Key="TransparentColorBrush"
|
||||
Color="Transparent" />
|
||||
|
||||
<!-- Empty Button Style -->
|
||||
<Style x:Key="BasicEmptyButtonStyle"
|
||||
TargetType="Button">
|
||||
|
||||
<Setter Property="Background"
|
||||
Value="{StaticResource TransparentColorBrush}" />
|
||||
<Setter Property="BorderThickness"
|
||||
Value="0" />
|
||||
<Setter Property="Padding"
|
||||
Value="0" />
|
||||
<Setter Property="HorizontalAlignment"
|
||||
Value="Stretch" />
|
||||
<Setter Property="VerticalAlignment"
|
||||
Value="Stretch" />
|
||||
<Setter Property="VerticalContentAlignment"
|
||||
Value="Stretch" />
|
||||
<Setter Property="HorizontalContentAlignment"
|
||||
Value="Stretch" />
|
||||
|
||||
<Setter Property="Template">
|
||||
<Setter.Value>
|
||||
<ControlTemplate TargetType="Button">
|
||||
|
||||
<Grid x:Name="RootGrid"
|
||||
Background="{TemplateBinding Background}">
|
||||
|
||||
<VisualStateManager.VisualStateGroups>
|
||||
<VisualStateGroup x:Name="CommonStates">
|
||||
<VisualState x:Name="Normal" />
|
||||
<VisualState x:Name="PointerOver" />
|
||||
|
||||
<VisualState x:Name="Pressed">
|
||||
<VisualState.Setters>
|
||||
<Setter Target="RootGrid.Opacity"
|
||||
Value="0.6" />
|
||||
</VisualState.Setters>
|
||||
</VisualState>
|
||||
|
||||
<VisualState x:Name="Disabled">
|
||||
<VisualState.Setters>
|
||||
<Setter Target="RootGrid.Opacity"
|
||||
Value="0.6" />
|
||||
</VisualState.Setters>
|
||||
</VisualState>
|
||||
</VisualStateGroup>
|
||||
</VisualStateManager.VisualStateGroups>
|
||||
|
||||
<ContentPresenter x:Name="ContentPresenter"
|
||||
AutomationProperties.AccessibilityView="Raw"
|
||||
ContentTemplate="{TemplateBinding ContentTemplate}"
|
||||
ContentTransitions="{TemplateBinding ContentTransitions}"
|
||||
Content="{TemplateBinding Content}"
|
||||
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
|
||||
Margin="{TemplateBinding Padding}"
|
||||
VerticalAlignment="{TemplateBinding VerticalContentAlignment}" />
|
||||
</Grid>
|
||||
</ControlTemplate>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
</Style>
|
||||
|
||||
<!-- Primary Button Style -->
|
||||
<Style x:Key="PrimaryButtonStyle"
|
||||
TargetType="Button">
|
||||
|
||||
<Setter Property="Background"
|
||||
Value="Transparent" />
|
||||
<Setter Property="BorderThickness"
|
||||
Value="0" />
|
||||
<Setter Property="Padding"
|
||||
Value="16" />
|
||||
<Setter Property="HorizontalAlignment"
|
||||
Value="Stretch" />
|
||||
<Setter Property="VerticalAlignment"
|
||||
Value="Stretch" />
|
||||
<Setter Property="VerticalContentAlignment"
|
||||
Value="Stretch" />
|
||||
<Setter Property="HorizontalContentAlignment"
|
||||
Value="Stretch" />
|
||||
|
||||
<!-- TextBlock Styling -->
|
||||
<Setter Property="Foreground"
|
||||
Value="{StaticResource Color03Brush}" />
|
||||
<Setter Property="FontSize"
|
||||
Value="12" />
|
||||
<Setter Property="FontWeight"
|
||||
Value="SemiBold" />
|
||||
|
||||
<Setter Property="Template">
|
||||
<Setter.Value>
|
||||
<ControlTemplate TargetType="Button">
|
||||
|
||||
<Grid x:Name="RootGrid"
|
||||
Background="{TemplateBinding Background}">
|
||||
|
||||
<VisualStateManager.VisualStateGroups>
|
||||
<VisualStateGroup x:Name="CommonStates">
|
||||
<VisualState x:Name="Normal" />
|
||||
<VisualState x:Name="PointerOver" />
|
||||
<VisualState x:Name="Pressed">
|
||||
<VisualState.Setters>
|
||||
<Setter Target="ContentPresenter.Opacity"
|
||||
Value="0.6" />
|
||||
</VisualState.Setters>
|
||||
</VisualState>
|
||||
<VisualState x:Name="Disabled">
|
||||
<VisualState.Setters>
|
||||
<Setter Target="ContentPresenter.Opacity"
|
||||
Value="0.6" />
|
||||
</VisualState.Setters>
|
||||
</VisualState>
|
||||
</VisualStateGroup>
|
||||
</VisualStateManager.VisualStateGroups>
|
||||
|
||||
<!-- Label -->
|
||||
<TextBlock x:Name="ContentPresenter"
|
||||
Text="{TemplateBinding Content}"
|
||||
FontSize="{TemplateBinding FontSize}"
|
||||
VerticalAlignment="Center"
|
||||
HorizontalAlignment="Center"
|
||||
Margin="{TemplateBinding Padding}" />
|
||||
</Grid>
|
||||
</ControlTemplate>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
</Style>
|
||||
|
||||
<!-- UnoPlatformShell -->
|
||||
<Style TargetType="local:UnoPlatformShell">
|
||||
|
||||
<Setter Property="Template">
|
||||
<Setter.Value>
|
||||
<ControlTemplate TargetType="local:UnoPlatformShell">
|
||||
<Grid>
|
||||
<VisualStateManager.VisualStateGroups>
|
||||
<VisualStateGroup>
|
||||
|
||||
<VisualState x:Name="narrow">
|
||||
<VisualState.StateTriggers>
|
||||
<AdaptiveTrigger MinWindowWidth="0" />
|
||||
</VisualState.StateTriggers>
|
||||
<VisualState.Setters>
|
||||
<Setter Target="RegularUnoPlatformLogo.Visibility"
|
||||
Value="Collapsed" />
|
||||
<Setter Target="SmallUnoPlatformLogo.Visibility"
|
||||
Value="Visible" />
|
||||
</VisualState.Setters>
|
||||
</VisualState>
|
||||
|
||||
<VisualState x:Name="medium">
|
||||
<VisualState.StateTriggers>
|
||||
<AdaptiveTrigger MinWindowWidth="600" />
|
||||
</VisualState.StateTriggers>
|
||||
<VisualState.Setters>
|
||||
<Setter Target="RegularUnoPlatformLogo.Visibility"
|
||||
Value="Visible" />
|
||||
<Setter Target="SmallUnoPlatformLogo.Visibility"
|
||||
Value="Collapsed" />
|
||||
<Setter Target="AppInfo.Orientation"
|
||||
Value="Vertical" />
|
||||
</VisualState.Setters>
|
||||
</VisualState>
|
||||
|
||||
<VisualState x:Name="wide">
|
||||
<VisualState.StateTriggers>
|
||||
<AdaptiveTrigger MinWindowWidth="700" />
|
||||
</VisualState.StateTriggers>
|
||||
<VisualState.Setters>
|
||||
<Setter Target="AppInfo.Orientation"
|
||||
Value="Horizontal" />
|
||||
</VisualState.Setters>
|
||||
</VisualState>
|
||||
</VisualStateGroup>
|
||||
</VisualStateManager.VisualStateGroups>
|
||||
|
||||
<Grid>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="auto" />
|
||||
<RowDefinition Height="*" />
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<!-- Header -->
|
||||
<Grid Background="{StaticResource Color01Brush}"
|
||||
Height="90"
|
||||
Grid.Row="0">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="Auto" />
|
||||
<ColumnDefinition Width="*" />
|
||||
<ColumnDefinition Width="Auto" />
|
||||
</Grid.ColumnDefinitions>
|
||||
|
||||
<!-- Uno Button -->
|
||||
<Button x:Name="UnoButton"
|
||||
Style="{StaticResource BasicEmptyButtonStyle}"
|
||||
VerticalAlignment="Center"
|
||||
Margin="23,0,0,0"
|
||||
Grid.Column="0">
|
||||
|
||||
<Grid>
|
||||
<!-- Icon -->
|
||||
<Image x:Name="RegularUnoPlatformLogo"
|
||||
Source="ms-appx:///Assets/UnoLogo.png"
|
||||
Height="42"
|
||||
Width="107" />
|
||||
|
||||
<!-- Icon small -->
|
||||
<Image x:Name="SmallUnoPlatformLogo"
|
||||
Source="ms-appx:///Assets/UnoLogo_small.png"
|
||||
Height="42"
|
||||
Width="44"
|
||||
Visibility="Collapsed" />
|
||||
</Grid>
|
||||
</Button>
|
||||
|
||||
<!-- App Name and Author -->
|
||||
<StackPanel x:Name="AppInfo"
|
||||
VerticalAlignment="Center"
|
||||
Grid.Column="1"
|
||||
Margin="20,0,16,0">
|
||||
|
||||
<!-- App Button -->
|
||||
<Button x:Name="appButton"
|
||||
Style="{StaticResource BasicEmptyButtonStyle}"
|
||||
Margin="0,0,4,0">
|
||||
|
||||
<!-- App Name -->
|
||||
<TextBlock Text="{TemplateBinding AppName}"
|
||||
Foreground="{StaticResource Color02Brush}"
|
||||
TextTrimming="CharacterEllipsis"
|
||||
TextWrapping="NoWrap"
|
||||
FontSize="16"
|
||||
FontWeight="Bold" />
|
||||
</Button>
|
||||
|
||||
<!-- Author Button -->
|
||||
<Button x:Name="authorButton"
|
||||
Style="{StaticResource BasicEmptyButtonStyle}">
|
||||
|
||||
<StackPanel Orientation="Horizontal">
|
||||
|
||||
<!-- by -->
|
||||
<TextBlock Text="by"
|
||||
Foreground="{StaticResource Color02Brush}"
|
||||
FontSize="16"
|
||||
Margin="0,0,4,0" />
|
||||
|
||||
<!-- App Author -->
|
||||
<TextBlock Text="{TemplateBinding AppAuthor}"
|
||||
Foreground="{StaticResource Color02Brush}"
|
||||
FontSize="16" />
|
||||
</StackPanel>
|
||||
</Button>
|
||||
</StackPanel>
|
||||
|
||||
<StackPanel Orientation="Horizontal"
|
||||
VerticalAlignment="Center"
|
||||
Margin="0,0,20,0"
|
||||
Grid.Column="2">
|
||||
|
||||
<!-- About Button -->
|
||||
<Button x:Name="openAboutButton"
|
||||
Content="ABOUT"
|
||||
Style="{StaticResource PrimaryButtonStyle}"
|
||||
Click="OnAbout" />
|
||||
|
||||
<!-- GitHub Button -->
|
||||
<Button x:Name="GithubButton"
|
||||
Style="{StaticResource BasicEmptyButtonStyle}"
|
||||
VerticalAlignment="Center"
|
||||
Margin="14,0,0,0">
|
||||
|
||||
<!-- Icon -->
|
||||
<Image Source="ms-appx:///Assets/GithubLogo.png"
|
||||
Height="24"
|
||||
Width="25" />
|
||||
</Button>
|
||||
|
||||
<!-- Twitter Button -->
|
||||
<Button x:Name="TwitterButton"
|
||||
Style="{StaticResource BasicEmptyButtonStyle}"
|
||||
VerticalAlignment="Center"
|
||||
Margin="26,0,0,0">
|
||||
|
||||
<!-- Icon -->
|
||||
<Image Source="ms-appx:///Assets/TwitterLogo.png"
|
||||
Height="22"
|
||||
Width="27" />
|
||||
</Button>
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
|
||||
<!-- App Content -->
|
||||
<ContentPresenter x:Name="ContentPresenter"
|
||||
Content="{TemplateBinding AppContent}"
|
||||
Grid.Row="1" />
|
||||
|
||||
<!-- About Popup -->
|
||||
<Grid Visibility="{TemplateBinding AboutVisibility}"
|
||||
Grid.Row="0"
|
||||
Grid.RowSpan="2">
|
||||
|
||||
<!-- Soft Dismiss Button -->
|
||||
<Button x:Name="softDismissAboutButton"
|
||||
Style="{StaticResource BasicEmptyButtonStyle}"
|
||||
Click="OnCloseAbout" />
|
||||
|
||||
<!-- Popup -->
|
||||
<Grid Background="{StaticResource Color01Brush}"
|
||||
CornerRadius="4"
|
||||
MaxWidth="580"
|
||||
HorizontalAlignment="Center"
|
||||
VerticalAlignment="Top"
|
||||
Margin="0,170,0,0">
|
||||
|
||||
<!-- Close Button -->
|
||||
<Button x:Name="closeAboutButton"
|
||||
Style="{StaticResource BasicEmptyButtonStyle}"
|
||||
Click="OnCloseAbout"
|
||||
VerticalAlignment="Top"
|
||||
HorizontalAlignment="Right"
|
||||
Padding="0">
|
||||
|
||||
<!-- Icon -->
|
||||
<Path Data="M14 1.41 12.59 0 7 5.59 1.41 0 0 1.41 5.59 7 0 12.59 1.41 14 7 8.41 12.59 14 14 12.59 8.41 7"
|
||||
Fill="{StaticResource Color02Brush}"
|
||||
Stretch="Uniform"
|
||||
Height="14"
|
||||
Width="14"
|
||||
Margin="16" />
|
||||
</Button>
|
||||
|
||||
<StackPanel Margin="40,40,40,65">
|
||||
|
||||
<!-- Header -->
|
||||
<TextBlock TextWrapping="Wrap"
|
||||
Foreground="{StaticResource Color02Brush}"
|
||||
FontWeight="Bold"
|
||||
FontSize="24">
|
||||
|
||||
Welcome to the
|
||||
|
||||
<!-- Link to Uno Fork -->
|
||||
<Hyperlink NavigateUri="{TemplateBinding LinkToUnoPlatformApp}"
|
||||
Foreground="{StaticResource Color02Brush}">
|
||||
<Underline>
|
||||
Uno Platform Fork
|
||||
</Underline>
|
||||
</Hyperlink>
|
||||
|
||||
of <Run Text="{TemplateBinding AppAuthor}" />'s
|
||||
|
||||
<!-- Link to Original Fork -->
|
||||
<Hyperlink NavigateUri="{TemplateBinding LinkToOriginalApp}"
|
||||
Foreground="{StaticResource Color02Brush}">
|
||||
<Underline>
|
||||
<Run Text="{TemplateBinding AppName}" />
|
||||
</Underline>
|
||||
</Hyperlink>
|
||||
|
||||
running on WebAssembly
|
||||
</TextBlock>
|
||||
|
||||
<!-- About Content -->
|
||||
<ContentPresenter x:Name="AboutContent"
|
||||
Content="{TemplateBinding AboutContent}"
|
||||
Margin="0,24,0,0" />
|
||||
|
||||
<!-- Version -->
|
||||
<TextBlock Text="{TemplateBinding VersionNumber}"
|
||||
Foreground="{StaticResource Color02Brush}"
|
||||
FontSize="12"
|
||||
Margin="0,16,0,0">
|
||||
|
||||
</TextBlock>
|
||||
</StackPanel>
|
||||
|
||||
<!-- Uno website Button -->
|
||||
<Button x:Name="visitUnoWebsiteButton"
|
||||
Style="{StaticResource BasicEmptyButtonStyle}"
|
||||
Click="OnVisitUnoPlatformWebsite"
|
||||
VerticalAlignment="Bottom"
|
||||
HorizontalAlignment="Right"
|
||||
Margin="0,0,16,26"
|
||||
Padding="0">
|
||||
|
||||
<StackPanel Orientation="Horizontal"
|
||||
Margin="16">
|
||||
|
||||
<!-- Label -->
|
||||
<TextBlock Text="VISIT UNO PLATFORM WEBSITE"
|
||||
Foreground="{StaticResource Color02Brush}"
|
||||
FontWeight="SemiBold"
|
||||
FontSize="14" />
|
||||
|
||||
<!-- Icon -->
|
||||
<Path Data="M0.5632 1.3568 5.6064 6.4 0.5632 11.4432 1.92 12.8 8 6.4 1.92 0"
|
||||
Fill="{StaticResource Color02Brush}"
|
||||
Stretch="Uniform"
|
||||
Height="14"
|
||||
Width="14"
|
||||
VerticalAlignment="Center"
|
||||
Margin="8,1,0,0" />
|
||||
</StackPanel>
|
||||
</Button>
|
||||
</Grid>
|
||||
</Grid>
|
||||
</Grid>
|
||||
</Grid>
|
||||
</ControlTemplate>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
</Style>
|
||||
</ResourceDictionary>
|
|
@ -1,48 +1,27 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
|
||||
<Package
|
||||
xmlns="http://schemas.microsoft.com/appx/manifest/foundation/windows10"
|
||||
xmlns:mp="http://schemas.microsoft.com/appx/2014/phone/manifest"
|
||||
xmlns:uap="http://schemas.microsoft.com/appx/manifest/uap/windows10"
|
||||
IgnorableNamespaces="uap mp">
|
||||
|
||||
<Identity
|
||||
Name="20f64aa7-d240-49d8-bc35-578e322c7279"
|
||||
Publisher="CN=com.example"
|
||||
Version="1.0.0.0" />
|
||||
|
||||
<mp:PhoneIdentity PhoneProductId="1897f84c-689e-44d3-a8b7-c521a62818ae" PhonePublisherId="00000000-0000-0000-0000-000000000000"/>
|
||||
|
||||
<Package xmlns="http://schemas.microsoft.com/appx/manifest/foundation/windows10" xmlns:mp="http://schemas.microsoft.com/appx/2014/phone/manifest" xmlns:uap="http://schemas.microsoft.com/appx/manifest/uap/windows10" IgnorableNamespaces="uap mp">
|
||||
<Identity Name="20f64aa7-d240-49d8-bc35-578e322c7279" Publisher="CN=com.example" Version="1.0.0.0" />
|
||||
<mp:PhoneIdentity PhoneProductId="1897f84c-689e-44d3-a8b7-c521a62818ae" PhonePublisherId="00000000-0000-0000-0000-000000000000" />
|
||||
<Properties>
|
||||
<DisplayName>RoslynQuoter</DisplayName>
|
||||
<PublisherDisplayName>RoslynQuoter</PublisherDisplayName>
|
||||
<Logo>Assets\StoreLogo.png</Logo>
|
||||
</Properties>
|
||||
|
||||
<Dependencies>
|
||||
<TargetDeviceFamily Name="Windows.Universal" MinVersion="10.0.0.0" MaxVersionTested="10.0.0.0" />
|
||||
</Dependencies>
|
||||
|
||||
<Resources>
|
||||
<Resource Language="x-generate"/>
|
||||
<Resource Language="x-generate" />
|
||||
</Resources>
|
||||
|
||||
<Applications>
|
||||
<Application Id="App"
|
||||
Executable="RoslynQuoter.exe"
|
||||
EntryPoint="UnoQuickStart.App">
|
||||
<uap:VisualElements
|
||||
DisplayName="RoslynQuoter"
|
||||
Square150x150Logo="Assets\Square150x150Logo.png"
|
||||
Square44x44Logo="Assets\Square44x44Logo.png"
|
||||
Description="RoslynQuoter"
|
||||
BackgroundColor="transparent">
|
||||
<uap:DefaultTile Wide310x150Logo="Assets\Wide310x150Logo.png"/>
|
||||
<uap:SplashScreen Image="Assets\SplashScreen.png" />
|
||||
<Application Id="App" Executable="RoslynQuoter.exe" EntryPoint="UnoQuickStart.App">
|
||||
<uap:VisualElements DisplayName="RoslynQuoter" Square150x150Logo="Assets\Square150x150Logo.png" Square44x44Logo="Assets\Square44x44Logo.png" Description="RoslynQuoter" BackgroundColor="transparent">
|
||||
<uap:DefaultTile Wide310x150Logo="Assets\Wide310x150Logo.png">
|
||||
</uap:DefaultTile>
|
||||
<uap:SplashScreen Image="Assets\SplashScreen.png" BackgroundColor="#242424" />
|
||||
</uap:VisualElements>
|
||||
</Application>
|
||||
</Applications>
|
||||
|
||||
<Capabilities>
|
||||
<Capability Name="internetClient" />
|
||||
</Capabilities>
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
var UnoAppManifest = {
|
||||
|
||||
splashScreenImage: "Assets/SplashScreen.scale-200.png",
|
||||
splashScreenColor: "#00f",
|
||||
splashScreenImage: "Assets/SplashScreen.png",
|
||||
splashScreenColor: "#242424",
|
||||
displayName: "Roslyn Quoter"
|
||||
|
||||
}
|
Загрузка…
Ссылка в новой задаче