Skip to content

Commit

Permalink
Added colors demo page
Browse files Browse the repository at this point in the history
  • Loading branch information
Janek91 committed Aug 1, 2023
1 parent 29fddf5 commit 872b86f
Show file tree
Hide file tree
Showing 19 changed files with 377 additions and 175 deletions.
19 changes: 18 additions & 1 deletion .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,22 @@ root = true
# A newline ending every file
# Use 4 spaces as indentation
[*]
insert_final_newline = true
insert_final_newline = false
indent_style = space
indent_size = 4

# ReSharper properties
resharper_place_simple_initializer_on_single_line = true
resharper_wrap_before_arrow_with_expressions = false
resharper_xml_wrap_lines = false
dotnet_style_operator_placement_when_wrapping = beginning_of_line
tab_width = 4
end_of_line = crlf
dotnet_style_coalesce_expression = true:suggestion
dotnet_style_null_propagation = true:suggestion
dotnet_style_prefer_is_null_check_over_reference_equality_method = true:suggestion
dotnet_style_prefer_auto_properties = true:silent
dotnet_style_object_initializer = true:suggestion

# C# files
[*.cs]
Expand All @@ -34,6 +42,7 @@ csharp_indent_braces = false
csharp_indent_case_contents = true
csharp_indent_switch_labels = true
csharp_indent_labels = one_less_than_current
csharp_new_line_before_open_brace = all

# avoid this. unless absolutely necessary
dotnet_style_qualification_for_field = false:suggestion
Expand Down Expand Up @@ -126,6 +135,14 @@ csharp_space_between_method_declaration_parameter_list_parentheses = false
csharp_space_between_parentheses = false
csharp_space_between_square_brackets = false
space_within_single_line_array_initializer_braces = true
csharp_using_directive_placement = outside_namespace:silent
csharp_prefer_simple_using_statement = true:suggestion
csharp_prefer_braces = true:silent
csharp_style_namespace_declarations = block_scoped:silent
csharp_style_prefer_method_group_conversion = true:silent
csharp_style_prefer_top_level_statements = true:silent
csharp_style_expression_bodied_lambdas = true:silent
csharp_style_expression_bodied_local_functions = false:silent

# Xaml files
[*.{xaml,axaml}]
Expand Down
57 changes: 52 additions & 5 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
## Ignore Visual Studio temporary files, build results, and
## files generated by popular Visual Studio add-ons.
##
## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore
## Get latest from https://github.com/github/gitignore/blob/main/VisualStudio.gitignore

# User-specific files
*.rsuser
Expand All @@ -23,6 +23,7 @@ mono_crash.*
[Rr]eleases/
x64/
x86/
[Ww][Ii][Nn]32/
[Aa][Rr][Mm]/
[Aa][Rr][Mm]64/
bld/
Expand Down Expand Up @@ -61,6 +62,9 @@ project.lock.json
project.fragment.lock.json
artifacts/

# ASP.NET Scaffolding
ScaffoldingReadMe.txt

# StyleCop
StyleCopReport.xml

Expand All @@ -86,6 +90,7 @@ StyleCopReport.xml
*.tmp_proj
*_wpftmp.csproj
*.log
*.tlog
*.vspscc
*.vssscc
.builds
Expand Down Expand Up @@ -127,9 +132,6 @@ _ReSharper*/
*.[Rr]e[Ss]harper
*.DotSettings.user

# JustCode is a .NET coding add-in
.JustCode

# TeamCity is a build add-in
_TeamCity*

Expand All @@ -140,6 +142,11 @@ _TeamCity*
.axoCover/*
!.axoCover/settings.json

# Coverlet is a free, cross platform Code Coverage Tool
coverage*.json
coverage*.xml
coverage*.info

# Visual Studio code coverage results
*.coverage
*.coveragexml
Expand Down Expand Up @@ -287,6 +294,17 @@ node_modules/
# Visual Studio 6 auto-generated workspace file (contains which files were open etc.)
*.vbw

# Visual Studio 6 auto-generated project file (contains which files were open etc.)
*.vbp

# Visual Studio 6 workspace and project file (working project files containing files to include in project)
*.dsw
*.dsp

# Visual Studio 6 technical files
*.ncb
*.aps

# Visual Studio LightSwitch build output
**/*.HTMLClient/GeneratedArtifacts
**/*.DesktopClient/GeneratedArtifacts
Expand Down Expand Up @@ -343,6 +361,9 @@ ASALocalRun/
# Local History for Visual Studio
.localhistory/

# Visual Studio History (VSHistory) files
.vshistory/

# BeatPulse healthcheck temp database
healthchecksdb

Expand All @@ -352,7 +373,33 @@ MigrationBackup/
# Ionide (cross platform F# VS Code tools) working folder
.ionide/

# Fody - auto-generated XML schema
FodyWeavers.xsd

# VS Code files for those working on multiple tools
.vscode/*
!.vscode/settings.json
!.vscode/tasks.json
!.vscode/launch.json
!.vscode/extensions.json
*.code-workspace

# Local History for Visual Studio Code
.history/

# Windows Installer files from build outputs
*.cab
*.msi
*.msix
*.msm
*.msp

# JetBrains Rider
*.sln.iml

#Ignore idea files
.idea/

#Ignore special
.directory
.directory
.DS_Store
30 changes: 30 additions & 0 deletions Directory.Build.props
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
<Project>

<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
<LangVersion>latest</LangVersion>
<Nullable>enable</Nullable>
<NoWarn>NU5104, NU1507</NoWarn>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>

<Authors>Larymar,SKProCH,Appleneko2001</Authors>
<Company>Larymar,SKProCH,Appleneko2001</Company>
<PackageProjectUrl>https://github.com/AvaloniaCommunity/Material.Avalonia</PackageProjectUrl>
<RepositoryUrl>https://github.com/AvaloniaCommunity/Material.Avalonia</RepositoryUrl>
<RepositoryType>git</RepositoryType>
<PackageLicenseExpression>MIT</PackageLicenseExpression>
<AccelerateBuildsInVisualStudio>true</AccelerateBuildsInVisualStudio>
</PropertyGroup>

<ItemGroup>
<None Include="$(MSBuildThisFileDirectory)\.editorconfig" Link=".editorconfig" />
</ItemGroup>

<ItemGroup>
<AvaloniaResource Include="**\*.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</AvaloniaResource>
</ItemGroup>

</Project>
30 changes: 15 additions & 15 deletions Directory.Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -6,23 +6,23 @@
<ShowMeTheXamlVersion>1.3.0</ShowMeTheXamlVersion>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Avalonia"/>
<PackageReference Include="Avalonia" />
</ItemGroup>
<ItemGroup>
<PackageVersion Include="Avalonia" Version="$(AvaloniaVersion)"/>
<PackageVersion Include="Avalonia.Diagnostics" Version="$(AvaloniaVersion)"/>
<PackageVersion Include="Avalonia.Controls.DataGrid" Version="$(AvaloniaVersion)"/>
<PackageVersion Include="Avalonia.Controls.ItemsRepeater" Version="$(AvaloniaVersion)"/>
<PackageVersion Include="Avalonia.Desktop" Version="$(AvaloniaVersion)"/>
<PackageVersion Include="Avalonia.Themes.Simple" Version="$(AvaloniaVersion)"/>
<PackageVersion Include="Avalonia" Version="$(AvaloniaVersion)" />
<PackageVersion Include="Avalonia.Diagnostics" Version="$(AvaloniaVersion)" />
<PackageVersion Include="Avalonia.Controls.DataGrid" Version="$(AvaloniaVersion)" />
<PackageVersion Include="Avalonia.Controls.ItemsRepeater" Version="$(AvaloniaVersion)" />
<PackageVersion Include="Avalonia.Desktop" Version="$(AvaloniaVersion)" />
<PackageVersion Include="Avalonia.Themes.Simple" Version="$(AvaloniaVersion)" />
<!--For Material.Styles-->
<PackageVersion Include="System.Reactive" Version="6.0.0"/>
<PackageVersion Include="aqua.tool.polyfill.IsExternalInit" Version="2.0.0"/>
<PackageVersion Include="System.Reactive" Version="6.0.0" />
<PackageVersion Include="aqua.tool.polyfill.IsExternalInit" Version="2.0.0" />
<!--For Material.Demo-->
<PackageVersion Include="Material.Icons.Avalonia" Version="2.0.1"/>
<PackageVersion Include="DialogHost.Avalonia" Version="0.7.4"/>
<PackageVersion Include="ShowMeTheXaml.Avalonia" Version="$(ShowMeTheXamlVersion)"/>
<PackageVersion Include="ShowMeTheXaml.Avalonia.AvaloniaEdit" Version="$(ShowMeTheXamlVersion)"/>
<PackageVersion Include="ShowMeTheXaml.Avalonia.Generator" Version="$(ShowMeTheXamlVersion)"/>
<PackageVersion Include="Material.Icons.Avalonia" Version="2.0.1" />
<PackageVersion Include="DialogHost.Avalonia" Version="0.7.4" />
<PackageVersion Include="ShowMeTheXaml.Avalonia" Version="$(ShowMeTheXamlVersion)" />
<PackageVersion Include="ShowMeTheXaml.Avalonia.AvaloniaEdit" Version="$(ShowMeTheXamlVersion)" />
<PackageVersion Include="ShowMeTheXaml.Avalonia.Generator" Version="$(ShowMeTheXamlVersion)" />
</ItemGroup>
</Project>
</Project>
15 changes: 12 additions & 3 deletions Material.Avalonia.sln
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 16
VisualStudioVersion = 16.0.29409.12
# Visual Studio Version 17
VisualStudioVersion = 17.6.33829.357
MinimumVisualStudioVersion = 10.0.40219.1
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Material.Demo", "Material.Demo\Material.Demo.csproj", "{ECB440AE-658B-4602-87CD-BE7FE8285362}"
EndProject
Expand All @@ -15,7 +15,16 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Material.Colors", "Material
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Material.DataGrid", "Material.DataGrid\Material.DataGrid.csproj", "{E0F697EE-358C-4E73-A4A8-3279B5B8DFF3}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Material.Dialog", "Material.Dialog\Material.Dialog.csproj", "{4F5F7FFD-B6E2-4C36-B250-D6B8169A0B1A}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Material.Dialog", "Material.Dialog\Material.Dialog.csproj", "{4F5F7FFD-B6E2-4C36-B250-D6B8169A0B1A}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{40295CAB-9146-4A0A-B3E1-C31DA6E17256}"
ProjectSection(SolutionItems) = preProject
.editorconfig = .editorconfig
Config.Numerge.json = Config.Numerge.json
Directory.Build.props = Directory.Build.props
Directory.Packages.props = Directory.Packages.props
Settings.XamlStyler = Settings.XamlStyler
EndProjectSection
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Expand Down
17 changes: 0 additions & 17 deletions Material.Avalonia/Material.Avalonia.csproj
Original file line number Diff line number Diff line change
@@ -1,19 +1,8 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
<LangVersion>8</LangVersion>
<Nullable>enable</Nullable>
<NoWarn>NU5104, NU1507</NoWarn>

<Title>Material.Avalonia</Title>
<Authors>Larymar,SKProCH,Appleneko2001</Authors>
<Description>This repository is a set of styles that will help you customize your application in an appropriate material design.</Description>
<PackageProjectUrl>https://github.com/AvaloniaCommunity/Material.Avalonia</PackageProjectUrl>
<RepositoryUrl>https://github.com/AvaloniaCommunity/Material.Avalonia</RepositoryUrl>
<RepositoryType>git</RepositoryType>
<PackageTags>avalonia xaml material design theme colour color ui ux material-design google-material</PackageTags>
<PackageLicenseExpression>MIT</PackageLicenseExpression>
<PackageReadmeFile>README.md</PackageReadmeFile>
<PackageIcon>FavIcon.png</PackageIcon>
<VersionPrefix>3.0.0-avalonia11-preview5</VersionPrefix>
Expand All @@ -38,12 +27,6 @@
<Version Condition="'$(PatchNumber)' != ''">$(VersionPrefix).$(PatchNumber)</Version>
</PropertyGroup>

<ItemGroup>
<AvaloniaResource Include="**\*.xaml">
<SubType>Designer</SubType>
</AvaloniaResource>
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\Material.Styles\Material.Styles.csproj"/>
</ItemGroup>
Expand Down
15 changes: 0 additions & 15 deletions Material.Colors/Material.Colors.csproj
Original file line number Diff line number Diff line change
@@ -1,22 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
<Nullable>enable</Nullable>
<LangVersion>8</LangVersion>
<NoWarn>NU5104, NU1507</NoWarn>

<Authors>Larymar,SKProCH,Appleneko2001</Authors>
<RepositoryUrl>https://github.com/AvaloniaUtils/material.avalonia</RepositoryUrl>
<PackageProjectUrl>https://github.com/AvaloniaUtils/material.avalonia</PackageProjectUrl>
<RepositoryType>git</RepositoryType>
<Description>Color palette component of Material.Avalonia.</Description>
</PropertyGroup>

<ItemGroup>
<AvaloniaResource Include="**\*.xaml">
<SubType>Designer</SubType>
</AvaloniaResource>
</ItemGroup>
</Project>
24 changes: 0 additions & 24 deletions Material.DataGrid/Material.DataGrid.csproj
Original file line number Diff line number Diff line change
@@ -1,26 +1,8 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
<LangVersion>8</LangVersion>
<Nullable>enable</Nullable>
<NoWarn>NU5104, NU1507</NoWarn>

<Authors>Larymar,SKProCH,Appleneko2001</Authors>
<Description>DataGrid styles library of Material.Avalonia.</Description>
<PackageProjectUrl>https://github.com/AvaloniaUtils/material.avalonia</PackageProjectUrl>
<RepositoryUrl>https://github.com/AvaloniaUtils/material.avalonia</RepositoryUrl>
<RepositoryType>git</RepositoryType>
</PropertyGroup>
<ItemGroup>
<AvaloniaResource Include="**\*.xaml">
<SubType>Designer</SubType>
</AvaloniaResource>
</ItemGroup>
<ItemGroup>
<None Remove="DataGrid.xaml"/>
</ItemGroup>

<ItemGroup>
<PackageReference Include="Avalonia.Controls.DataGrid"/>
Expand All @@ -30,10 +12,4 @@
<ProjectReference Include="..\Material.Styles\Material.Styles.csproj"/>
</ItemGroup>

<ItemGroup>
<AvaloniaResource Update="DataGrid.xaml">
<Generator>MSBuild:Compile</Generator>
</AvaloniaResource>
</ItemGroup>

</Project>
25 changes: 25 additions & 0 deletions Material.Demo/Extensions/PrimaryColorExt.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
using System;
using Avalonia.Markup.Xaml;
using Avalonia.Media;
using Material.Colors;

namespace Material.Demo.Extensions;

public class PrimaryColorExt : MarkupExtension
{
public PrimaryColorExt()
{
}

public PrimaryColorExt(PrimaryColor color)
{
Color = color;
}

[ConstructorArgument("color")] public PrimaryColor Color { get; set; }

public override object ProvideValue(IServiceProvider serviceProvider)
{
return new SolidColorBrush(SwatchHelper.Lookup[(MaterialColor)Color]);
}
}
Loading

0 comments on commit 872b86f

Please sign in to comment.