330 changed files with 5376 additions and 2548 deletions
|
Before Width: | Height: | Size: 1.2 KiB After Width: | Height: | Size: 1.2 KiB |
@ -0,0 +1,74 @@ |
|||
:root { |
|||
--sat: env(safe-area-inset-top); |
|||
--sar: env(safe-area-inset-right); |
|||
--sab: env(safe-area-inset-bottom); |
|||
--sal: env(safe-area-inset-left); |
|||
} |
|||
|
|||
/* HTML styles for the splash screen */ |
|||
|
|||
.highlight { |
|||
color: white; |
|||
font-size: 2.5rem; |
|||
display: block; |
|||
} |
|||
|
|||
.purple { |
|||
color: #8b44ac; |
|||
} |
|||
|
|||
.icon { |
|||
opacity: 0.05; |
|||
height: 35%; |
|||
width: 35%; |
|||
position: absolute; |
|||
background-repeat: no-repeat; |
|||
right: 0px; |
|||
bottom: 0px; |
|||
margin-right: 3%; |
|||
margin-bottom: 5%; |
|||
z-index: 5000; |
|||
background-position: right bottom; |
|||
pointer-events: none; |
|||
} |
|||
|
|||
#avalonia-splash a { |
|||
color: whitesmoke; |
|||
text-decoration: none; |
|||
} |
|||
|
|||
.center { |
|||
display: flex; |
|||
justify-content: center; |
|||
align-items: center; |
|||
height: 100vh; |
|||
} |
|||
|
|||
#avalonia-splash { |
|||
position: relative; |
|||
height: 100%; |
|||
width: 100%; |
|||
color: whitesmoke; |
|||
background: #1b2a4e; |
|||
font-family: 'Nunito', sans-serif; |
|||
background-position: center; |
|||
background-size: cover; |
|||
background-repeat: no-repeat; |
|||
justify-content: center; |
|||
align-items: center; |
|||
} |
|||
|
|||
.splash-close { |
|||
animation: fadeout 0.25s linear forwards; |
|||
} |
|||
|
|||
@keyframes fadeout { |
|||
0% { |
|||
opacity: 100%; |
|||
} |
|||
|
|||
100% { |
|||
opacity: 0; |
|||
visibility: collapse; |
|||
} |
|||
} |
|||
|
Before Width: | Height: | Size: 172 KiB After Width: | Height: | Size: 172 KiB |
@ -0,0 +1,28 @@ |
|||
<!DOCTYPE html> |
|||
<!-- Licensed to the .NET Foundation under one or more agreements. --> |
|||
<!-- The .NET Foundation licenses this file to you under the MIT license. --> |
|||
<html> |
|||
|
|||
<head> |
|||
<title>AvaloniaUI - ControlCatalog</title> |
|||
<meta charset="UTF-8"> |
|||
<meta name="viewport" content="width=device-width, initial-scale=1.0"> |
|||
<link rel="stylesheet" href="./app.css" /> |
|||
</head> |
|||
|
|||
<body style="margin: 0px; overflow: hidden"> |
|||
<div id="out"> |
|||
<div id="avalonia-splash"> |
|||
<div class="center"> |
|||
<h2 class="purple"> |
|||
Powered by |
|||
<a class="highlight" href="https://www.avaloniaui.net/" target="_blank">Avalonia UI</a> |
|||
</h2> |
|||
</div> |
|||
<img class="icon" src="Logo.svg" alt="Avalonia Logo" /> |
|||
</div> |
|||
</div> |
|||
<script type='module' src="./main.js"></script> |
|||
</body> |
|||
|
|||
</html> |
|||
@ -1,44 +1,24 @@ |
|||
<Project Sdk="Microsoft.NET.Sdk"> |
|||
<Import Project="../../src/Browser/Avalonia.Browser/Avalonia.Browser.props" /> |
|||
|
|||
<PropertyGroup> |
|||
<TargetFramework>net7.0</TargetFramework> |
|||
<RuntimeIdentifier>browser-wasm</RuntimeIdentifier> |
|||
<WasmMainJSPath>main.js</WasmMainJSPath> |
|||
<WasmMainJSPath>AppBundle/main.js</WasmMainJSPath> |
|||
<OutputType>Exe</OutputType> |
|||
<AllowUnsafeBlocks>true</AllowUnsafeBlocks> |
|||
<MSBuildEnableWorkloadResolver>true</MSBuildEnableWorkloadResolver> |
|||
<WasmBuildNative>true</WasmBuildNative> |
|||
<EmccFlags>-sVERBOSE -sERROR_ON_UNDEFINED_SYMBOLS=0</EmccFlags> |
|||
</PropertyGroup> |
|||
|
|||
<PropertyGroup Condition="'$(Configuration)'=='Release'"> |
|||
<RunAOTCompilation>true</RunAOTCompilation> |
|||
<PublishTrimmed>true</PublishTrimmed> |
|||
<TrimMode>full</TrimMode> |
|||
<WasmBuildNative>true</WasmBuildNative> |
|||
<InvariantGlobalization>true</InvariantGlobalization> |
|||
<EmccCompileOptimizationFlag>-O2</EmccCompileOptimizationFlag> |
|||
<EmccLinkOptimizationFlag>-O2</EmccLinkOptimizationFlag> |
|||
</PropertyGroup> |
|||
|
|||
<ItemGroup> |
|||
<TrimmerRootDescriptor Include="Roots.xml" /> |
|||
</ItemGroup> |
|||
|
|||
<ItemGroup> |
|||
<ProjectReference Include="..\..\src\Skia\Avalonia.Skia\Avalonia.Skia.csproj" /> |
|||
<ProjectReference Include="..\..\src\Browser\Avalonia.Browser\Avalonia.Browser.csproj" /> |
|||
<ProjectReference Include="..\ControlCatalog\ControlCatalog.csproj" /> |
|||
<ProjectReference Include="../../src/Skia/Avalonia.Skia/Avalonia.Skia.csproj" /> |
|||
<ProjectReference Include="../../src/Browser/Avalonia.Browser/Avalonia.Browser.csproj" /> |
|||
<ProjectReference Include="../ControlCatalog/ControlCatalog.csproj" /> |
|||
</ItemGroup> |
|||
|
|||
<ItemGroup> |
|||
<WasmExtraFilesToDeploy Include="index.html" /> |
|||
<WasmExtraFilesToDeploy Include="main.js" /> |
|||
<WasmExtraFilesToDeploy Include="embed.js" /> |
|||
<WasmExtraFilesToDeploy Include="favicon.ico" /> |
|||
<WasmExtraFilesToDeploy Include="Logo.svg" /> |
|||
<WasmExtraFilesToDeploy Include="app.css" /> |
|||
<WasmExtraFilesToDeploy Include="AppBundle/**" /> |
|||
</ItemGroup> |
|||
|
|||
<Import Project="..\..\src\Browser\Avalonia.Browser\Avalonia.Browser.props" /> |
|||
<Import Project="..\..\src\Browser\Avalonia.Browser\Avalonia.Browser.targets" /> |
|||
<Import Project="../../src/Browser/Avalonia.Browser/Avalonia.Browser.targets" /> |
|||
</Project> |
|||
|
|||
@ -1,7 +0,0 @@ |
|||
<linker> |
|||
<assembly fullname="ControlCatalog" preserve="All" /> |
|||
<assembly fullname="ControlCatalog.Web" preserve="All" /> |
|||
<assembly fullname="Avalonia.Themes.Fluent" preserve="All" /> |
|||
<assembly fullname="Avalonia.Themes.Simple" preserve="All" /> |
|||
<assembly fullname="Avalonia.Controls.ColorPicker" preserve="All" /> |
|||
</linker> |
|||
@ -1,56 +0,0 @@ |
|||
:root { |
|||
--sat: env(safe-area-inset-top); |
|||
--sar: env(safe-area-inset-right); |
|||
--sab: env(safe-area-inset-bottom); |
|||
--sal: env(safe-area-inset-left); |
|||
} |
|||
|
|||
#out { |
|||
height: 100vh; |
|||
width: 100vw |
|||
} |
|||
|
|||
#avalonia-splash { |
|||
position: relative; |
|||
height: 100%; |
|||
width: 100%; |
|||
color: whitesmoke; |
|||
background: #171C2C; |
|||
font-family: 'Nunito', sans-serif; |
|||
background-position: center; |
|||
background-size: cover; |
|||
background-repeat: no-repeat; |
|||
} |
|||
|
|||
#avalonia-splash a{ |
|||
color: whitesmoke; |
|||
text-decoration: none; |
|||
} |
|||
|
|||
.center { |
|||
display: flex; |
|||
justify-content: center; |
|||
height: 250px; |
|||
} |
|||
|
|||
.splash-close { |
|||
animation: slide 0.5s linear 1s forwards; |
|||
} |
|||
|
|||
@keyframes slide { |
|||
0% { |
|||
top: 0%; |
|||
} |
|||
|
|||
50% { |
|||
opacity: 80%; |
|||
} |
|||
|
|||
100% { |
|||
top: 100%; |
|||
overflow: hidden; |
|||
opacity: 0; |
|||
display: none; |
|||
visibility: collapse; |
|||
} |
|||
} |
|||
@ -1,31 +0,0 @@ |
|||
<!DOCTYPE html> |
|||
<!-- Licensed to the .NET Foundation under one or more agreements. --> |
|||
<!-- The .NET Foundation licenses this file to you under the MIT license. --> |
|||
<html> |
|||
|
|||
<head> |
|||
<title>AvaloniaUI - ControlCatalog</title> |
|||
<meta charset="UTF-8"> |
|||
<meta name="viewport" content="width=device-width, initial-scale=1.0"> |
|||
<link rel="modulepreload" href="./main.js" /> |
|||
<link rel="modulepreload" href="./dotnet.js" /> |
|||
<link rel="modulepreload" href="./avalonia.js" /> |
|||
<link rel="stylesheet" href="./app.css" /> |
|||
</head> |
|||
|
|||
<body style="margin: 0px"> |
|||
<div id="out"> |
|||
<div id="avalonia-splash"> |
|||
<div class="center"> |
|||
<h2>Powered by</h2> |
|||
<a class="navbar-brand" href="https://www.avaloniaui.net/" target="_blank"> |
|||
<img src="Logo.svg" alt="Avalonia Logo" width="30" height="24" /> |
|||
Avalonia |
|||
</a> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<script type='module' src="./main.js"></script> |
|||
</body> |
|||
|
|||
</html> |
|||
@ -0,0 +1,42 @@ |
|||
<UserControl xmlns="https://github.com/avaloniaui" |
|||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" |
|||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" |
|||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" |
|||
xmlns:viewModels="clr-namespace:ControlCatalog.ViewModels" |
|||
mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450" |
|||
x:DataType="viewModels:DataValidationViewModel" |
|||
x:Class="ControlCatalog.Pages.DataValidationPage"> |
|||
<UserControl.DataContext> |
|||
<viewModels:DataValidationViewModel /> |
|||
</UserControl.DataContext> |
|||
<StackPanel TextBlock.TextWrapping="Wrap"> |
|||
<Label Target="Email1" Content="Email validation" /> |
|||
<TextBox x:Name="Email1" |
|||
MaxWidth="400" |
|||
HorizontalAlignment="Left" |
|||
Text="{Binding DataAnnotationsSample}" /> |
|||
|
|||
<Label Target="Email2" Content="Email validation with custom error converter" |
|||
Margin="0, 10, 0, 0" /> |
|||
<TextBox x:Name="Email2" |
|||
Text="{Binding DataAnnotationsSample}" |
|||
MaxWidth="400" |
|||
HorizontalAlignment="Left" |
|||
DataValidationErrors.ErrorConverter="{Binding Converter}" /> |
|||
|
|||
<Label Target="SetterException" Content="Setter exception with custom error converter and tooltip error" |
|||
Margin="0, 10, 0, 0" /> |
|||
<TextBox x:Name="SetterException" |
|||
Text="{Binding ExceptionInsideSetterSample}" |
|||
MaxWidth="400" |
|||
HorizontalAlignment="Left" |
|||
DataValidationErrors.ErrorConverter="{Binding ExceptionConverter}"> |
|||
<TextBox.Styles> |
|||
<Style Selector="DataValidationErrors"> |
|||
<Setter Property="Theme" Value="{DynamicResource TooltipDataValidationErrors}" /> |
|||
</Style> |
|||
</TextBox.Styles> |
|||
</TextBox> |
|||
</StackPanel> |
|||
</UserControl> |
|||
|
|||
@ -0,0 +1,14 @@ |
|||
using Avalonia; |
|||
using Avalonia.Controls; |
|||
using Avalonia.Markup.Xaml; |
|||
|
|||
namespace ControlCatalog.Pages; |
|||
|
|||
public partial class DataValidationPage : UserControl |
|||
{ |
|||
public DataValidationPage() |
|||
{ |
|||
InitializeComponent(); |
|||
} |
|||
} |
|||
|
|||
@ -0,0 +1,45 @@ |
|||
using System; |
|||
using System.ComponentModel; |
|||
using System.ComponentModel.DataAnnotations; |
|||
using MiniMvvm; |
|||
|
|||
namespace ControlCatalog.ViewModels; |
|||
|
|||
public class DataValidationViewModel : ViewModelBase |
|||
{ |
|||
private string? _DataAnnotationsSample; |
|||
|
|||
[Required] |
|||
[EmailAddress] |
|||
[MinLength(5)] |
|||
public string? DataAnnotationsSample |
|||
{ |
|||
get => _DataAnnotationsSample; |
|||
set => RaiseAndSetIfChanged(ref _DataAnnotationsSample, value); |
|||
} |
|||
|
|||
public Func<object, object> Converter { get; } = new Func<object, object>(o => |
|||
{ |
|||
return $"Error: {o}"; |
|||
}); |
|||
|
|||
|
|||
private string? _ExceptionInsideSetterSample; |
|||
|
|||
public string? ExceptionInsideSetterSample |
|||
{ |
|||
get => _ExceptionInsideSetterSample; |
|||
set |
|||
{ |
|||
if (value is null || value.Length < 5) |
|||
throw new ArgumentOutOfRangeException(nameof(value), "Give me 5 or more letter please :-)"); |
|||
|
|||
RaiseAndSetIfChanged(ref _ExceptionInsideSetterSample, value); |
|||
} |
|||
} |
|||
|
|||
public Func<object, object> ExceptionConverter { get; } = new Func<object, object>(o => |
|||
{ |
|||
return o is Exception ex ? $"Huh, there was an Exception: {ex.Message}" : "Something went really wrong!"; |
|||
}); |
|||
} |
|||
@ -1,10 +1,14 @@ |
|||
<Project> |
|||
|
|||
<PropertyGroup> |
|||
<IsPackable>false</IsPackable> |
|||
<AvaloniaPreviewerNetCoreToolPath>$(MSBuildThisFileDirectory)..\src\tools\Avalonia.Designer.HostApp\bin\Debug\netcoreapp2.0\Avalonia.Designer.HostApp.dll</AvaloniaPreviewerNetCoreToolPath> |
|||
<EnableNETAnalyzers>false</EnableNETAnalyzers> |
|||
<LangVersion>11</LangVersion> |
|||
<IsPackable>false</IsPackable> |
|||
<AvaloniaPreviewerNetCoreToolPath>$(MSBuildThisFileDirectory)..\src\tools\Avalonia.Designer.HostApp\bin\Debug\netcoreapp2.0\Avalonia.Designer.HostApp.dll</AvaloniaPreviewerNetCoreToolPath> |
|||
<EnableNETAnalyzers>false</EnableNETAnalyzers> |
|||
<LangVersion>11</LangVersion> |
|||
<NoWarn>$(NoWarn);CS8002</NoWarn> <!-- ignore signing warnings for samples --> |
|||
</PropertyGroup> |
|||
<Import Project="..\build\SharedVersion.props" /> |
|||
<Import Project="..\build\DevAnalyzers.props" /> |
|||
|
|||
<Import Project="..\build\SharedVersion.props"/> |
|||
<Import Project="..\build\DevAnalyzers.props"/> |
|||
|
|||
</Project> |
|||
|
|||
@ -1,10 +1,9 @@ |
|||
using System; |
|||
using Avalonia.Controls; |
|||
using Avalonia.Styling; |
|||
|
|||
namespace Generators.Sandbox.Controls; |
|||
|
|||
public class CustomTextBox : TextBox, IStyleable |
|||
public class CustomTextBox : TextBox |
|||
{ |
|||
Type IStyleable.StyleKey => typeof(TextBox); |
|||
} |
|||
protected override Type StyleKeyOverride => typeof(TextBox); |
|||
} |
|||
|
|||
Some files were not shown because too many files changed in this diff
Loading…
Reference in new issue