Merge pull request #181 from AvaloniaCommunity/dev
Publish release / Build and pack (push) Has been cancelled
Publish release / Merge packages and publish release (push) Has been cancelled

v3.0.0-avalonia10-preview2
This commit is contained in:
SKProCH
2022-09-26 20:58:20 +03:00
committed by GitHub
273 changed files with 8878 additions and 6525 deletions
+1
View File
@@ -11,6 +11,7 @@ on:
jobs:
build:
runs-on: ubuntu-latest
name: Build solution
steps:
- uses: actions/checkout@v1
- name: Setup .NET Core
+3
View File
@@ -6,7 +6,9 @@ on:
jobs:
build:
name: Build and pack
runs-on: ubuntu-latest
if: "!contains(github.event.head_commit.message, 'no nightly')"
steps:
- uses: actions/checkout@v2
- name: Setup .NET
@@ -31,6 +33,7 @@ jobs:
name: artifacts
path: artifacts/
numerge:
name: Merge packages and publish nightly
runs-on: ubuntu-latest
needs: [build]
steps:
+3 -1
View File
@@ -7,6 +7,7 @@ on:
jobs:
build:
runs-on: ubuntu-latest
name: Build and pack
steps:
- uses: actions/checkout@v2
- name: Setup .NET
@@ -32,6 +33,7 @@ jobs:
path: artifacts/
numerge:
runs-on: ubuntu-latest
name: Merge packages and publish release
needs: [build]
steps:
- name: Checkout Numerge
@@ -56,4 +58,4 @@ jobs:
- name: Publish to Nuget
run: dotnet nuget push "artifacts/output/Material.Avalonia.*.nupkg" --api-key ${{secrets.NUGET_KEY}} --source https://api.nuget.org/v3/index.json --skip-duplicate
- name: Publish to GitHub Packages
run: dotnet nuget push "artifacts/output/Material.Avalonia.*.nupkg" --api-key ${{secrets.GITHUB_TOKEN}} --source https://nuget.pkg.github.com/AvaloniaCommunity/index.json --skip-duplicate
run: dotnet nuget push "artifacts/output/Material.Avalonia.*.nupkg" --api-key ${{secrets.GITHUB_TOKEN}} --source https://nuget.pkg.github.com/AvaloniaCommunity/index.json --skip-duplicate
-453
View File
@@ -1,453 +0,0 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:xlink="http://www.w3.org/1999/xlink"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
width="1280"
height="720"
viewBox="0 0 338.66667 190.5"
version="1.1"
id="svg8"
inkscape:version="1.0.1 (3bc2e813f5, 2020-09-07)"
sodipodi:docname="Banner.svg"
inkscape:export-filename="D:\Projects\CSharpProjects\Material.Avalonia\Material.Demo\FavIcon_200x.png"
inkscape:export-xdpi="400"
inkscape:export-ydpi="400">
<defs
id="defs2">
<linearGradient
inkscape:collect="always"
id="linearGradient896">
<stop
style="stop-color:#663481;stop-opacity:1"
offset="0"
id="stop892" />
<stop
style="stop-color:#8b44ac;stop-opacity:1"
offset="1"
id="stop894" />
</linearGradient>
<inkscape:perspective
sodipodi:type="inkscape:persp3d"
inkscape:vp_x="0 : 355.6 : 1"
inkscape:vp_y="0 : 1000 : 0"
inkscape:vp_z="16.792565 : 355.85057 : 1"
inkscape:persp3d-origin="6.3500001 : 353.48333 : 1"
id="perspective42" />
<filter
inkscape:collect="always"
style="color-interpolation-filters:sRGB"
id="filter1529"
x="-0.046412673"
width="1.0928253"
y="-0.10218951"
height="1.204379">
<feGaussianBlur
inkscape:collect="always"
stdDeviation="0.14960497"
id="feGaussianBlur1531" />
</filter>
<filter
inkscape:collect="always"
style="color-interpolation-filters:sRGB"
id="filter1529-8"
x="-0.046412673"
width="1.0928253"
y="-0.10218951"
height="1.204379">
<feGaussianBlur
inkscape:collect="always"
stdDeviation="0.14960497"
id="feGaussianBlur1531-7" />
</filter>
<filter
inkscape:collect="always"
style="color-interpolation-filters:sRGB"
id="filter1529-8-0"
x="-0.046412673"
width="1.0928253"
y="-0.10218951"
height="1.204379">
<feGaussianBlur
inkscape:collect="always"
stdDeviation="0.14960497"
id="feGaussianBlur1531-7-2" />
</filter>
<filter
inkscape:collect="always"
style="color-interpolation-filters:sRGB"
id="filter1529-8-0-9"
x="-0.046412673"
width="1.0928253"
y="-0.10218951"
height="1.204379">
<feGaussianBlur
inkscape:collect="always"
stdDeviation="0.14960497"
id="feGaussianBlur1531-7-2-8" />
</filter>
<linearGradient
inkscape:collect="always"
xlink:href="#linearGradient896"
id="linearGradient898-0"
x1="112.09926"
y1="556.44598"
x2="442.89478"
y2="285.79514"
gradientUnits="userSpaceOnUse"
gradientTransform="matrix(0.00445478,0,0,0.00445478,26.037369,14.067162)" />
<linearGradient
inkscape:collect="always"
xlink:href="#linearGradient896"
id="linearGradient1043"
gradientUnits="userSpaceOnUse"
gradientTransform="matrix(0.1008994,0.04352024,-0.09827649,0.04373235,636.77019,113.93147)"
x1="112.09926"
y1="556.44598"
x2="442.89478"
y2="285.79514" />
<linearGradient
inkscape:collect="always"
xlink:href="#linearGradient896"
id="linearGradient1275"
x1="168.58513"
y1="122.44372"
x2="166.48705"
y2="121.78828"
gradientUnits="userSpaceOnUse" />
</defs>
<sodipodi:namedview
id="base"
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1.0"
inkscape:pageopacity="0.0"
inkscape:pageshadow="2"
inkscape:zoom="1"
inkscape:cx="546.8404"
inkscape:cy="402.22318"
inkscape:document-units="mm"
inkscape:current-layer="layer1"
inkscape:document-rotation="0"
showgrid="true"
units="px"
inkscape:window-width="1920"
inkscape:window-height="1017"
inkscape:window-x="760"
inkscape:window-y="-8"
inkscape:window-maximized="1"
width="128px"
inkscape:snap-path-mask="true"
inkscape:snap-path-clip="true" />
<metadata
id="metadata5">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title />
</cc:Work>
</rdf:RDF>
</metadata>
<g
inkscape:label="Слой 1"
inkscape:groupmode="layer"
id="layer1">
<g
id="g901"
transform="matrix(7.8647492,0,0,7.8647492,59.188766,26.962839)">
<circle
style="fill:#f5eef7;fill-opacity:1;stroke:none;stroke-width:0.287951;stroke-linecap:square;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;paint-order:stroke fill markers"
id="path881"
cx="27.610304"
cy="15.533154"
r="2.3" />
<rect
style="fill:#f5eef7;fill-opacity:1;stroke:none;stroke-width:0.333328;stroke-linecap:square;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;paint-order:stroke fill markers"
id="rect893"
width="3.0933816"
height="3.2224536"
x="26.816923"
y="14.610701"
ry="1.0629624" />
<path
id="circle4-6"
style="fill:url(#linearGradient898-0);fill-opacity:1;stroke-width:0.00861446"
d="m 27.610303,14.023948 a 1.5092502,1.5092502 0 0 0 -1.509206,1.509207 1.5092502,1.5092502 0 0 0 1.509206,1.509206 1.5092502,1.5092502 0 0 0 1.509207,-1.509206 1.5092502,1.5092502 0 0 0 -1.509207,-1.509207 z m 0,0.814521 a 0.69464725,0.69464725 0 0 1 0.694686,0.694686 0.69464725,0.69464725 0 0 1 -0.694686,0.694685 0.69464725,0.69464725 0 0 1 -0.694685,-0.694685 0.69464725,0.69464725 0 0 1 0.694685,-0.694686 z" />
<g
id="g891">
<circle
style="fill:#5d2f75;stroke:#ffffff;stroke-width:0.125421;stroke-miterlimit:10"
id="circle21"
r="0.3273499"
cy="15.533231"
cx="26.107803"
class="st3" />
<path
id="rect19"
style="fill:#8b44ac;stroke-width:0.0134893"
d="m 28.30525,15.514316 v 1.528569 h 0.809289 v -1.528569 z" />
</g>
</g>
<rect
style="fill:#000000;fill-opacity:0.200803;fill-rule:evenodd;stroke-width:0.275241;filter:url(#filter1529-8-0-9)"
id="rect58-1-1-2-1-2"
width="3.199091"
height="3.199091"
x="-4.1320586"
y="6.7448502"
ry="0"
transform="matrix(11.516892,-5.2307688,11.516892,5.2307688,102.41321,25.770542)" />
<rect
style="fill:#8b44ac;fill-opacity:1;fill-rule:evenodd;stroke-width:3.48155"
id="rect58-0-0-9-7"
width="40.465622"
height="40.465622"
x="-23.138884"
y="168.66969"
ry="3.6434028"
transform="matrix(0.91049097,-0.41352895,0.91049097,0.41352895,0,0)" />
<rect
style="fill:#000000;fill-opacity:0.200803;fill-rule:evenodd;stroke-width:0.275241;filter:url(#filter1529-8-0)"
id="rect58-1-1-2-1"
width="3.199091"
height="3.199091"
x="-4.1320586"
y="6.7448502"
ry="0"
transform="matrix(11.516892,-5.2307688,11.516892,5.2307688,102.38378,12.383578)" />
<rect
style="fill:#ffdc00;fill-opacity:1;fill-rule:evenodd;stroke-width:3.48155"
id="rect58-0-0-4"
width="40.465622"
height="40.465622"
x="-6.9526424"
y="152.48343"
ry="3.6434147"
transform="matrix(0.91049097,-0.41352895,0.91049097,0.41352895,0,0)" />
<rect
style="fill:#000000;fill-opacity:0.200803;fill-rule:evenodd;stroke-width:0.275241;filter:url(#filter1529-8)"
id="rect58-1-1-2"
width="3.199091"
height="3.199091"
x="-4.1320586"
y="6.7448502"
ry="0"
transform="matrix(11.516892,-5.2307688,11.516892,5.2307688,102.38378,-1.0033868)" />
<rect
style="fill:#ff86ff;fill-opacity:1;fill-rule:evenodd;stroke-width:3.48155"
id="rect58-0-9"
width="40.465622"
height="40.465622"
x="9.217432"
y="136.28101"
ry="3.6757557"
transform="matrix(0.91049097,-0.41352895,0.91049097,0.41352895,0,0)" />
<rect
style="fill:#000000;fill-opacity:0.200803;fill-rule:evenodd;stroke-width:0.275241;filter:url(#filter1529)"
id="rect58-1-1"
width="3.199091"
height="3.199091"
x="-4.1320586"
y="6.7448502"
ry="0"
transform="matrix(11.516891,-5.2307689,11.516891,5.2307689,102.38378,-14.390351)" />
<rect
style="fill:#00aeff;fill-opacity:1;fill-rule:evenodd;stroke-width:3.48155"
id="rect58-1"
width="40.465622"
height="40.465622"
x="25.419847"
y="120.11092"
ry="3.6434269"
transform="matrix(0.91049097,-0.41352895,0.91049097,0.41352895,0,0)" />
<g
id="g1392">
<path
id="circle4-6-4"
style="fill:url(#linearGradient1043);fill-opacity:1;stroke-width:0.180261"
d="M 639.2207 122.78906 A 47.719967 20.901067 0.33344137 0 0 615.58008 125.63281 C 619.46707 127.73722 619.27535 130.84611 614.84766 132.81641 C 610.4201 134.78678 603.32635 134.91971 598.46289 133.25 A 47.719967 20.901067 0.33344137 0 0 606.76172 158.50586 A 47.719967 20.901067 0.33344137 0 0 674.23828 158.43359 A 47.719967 20.901067 0.33344137 0 0 673.34961 128.87305 A 47.719967 20.901067 0.33344137 0 0 639.2207 122.78906 z M 612.19922 126.58984 A 47.719967 20.901067 0.33344137 0 0 605.87305 128.94531 A 47.719967 20.901067 0.33344137 0 0 600.60352 131.74805 C 603.96237 133.03138 608.93945 132.98021 612.0332 131.60352 C 615.12787 130.2264 615.18379 128.04096 612.19922 126.58984 z M 639.55859 134.06836 A 21.963584 9.6199219 0.33344137 0 1 655.38086 136.87109 L 655.38086 136.86914 A 21.963584 9.6199219 0.33344137 0 1 655.78906 150.47656 A 21.963584 9.6199219 0.33344137 0 1 624.73047 150.50977 A 21.963584 9.6199219 0.33344137 0 1 624.32031 136.90234 A 21.963584 9.6199219 0.33344137 0 1 639.55859 134.06836 z "
transform="scale(0.26458333)" />
<path
id="path1347"
style="color:#000000;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:medium;line-height:normal;font-family:sans-serif;font-variant-ligatures:normal;font-variant-position:normal;font-variant-caps:normal;font-variant-numeric:normal;font-variant-alternates:normal;font-variant-east-asian:normal;font-feature-settings:normal;font-variation-settings:normal;text-indent:0;text-align:start;text-decoration:none;text-decoration-line:none;text-decoration-style:solid;text-decoration-color:#000000;letter-spacing:normal;word-spacing:normal;text-transform:none;writing-mode:lr-tb;direction:ltr;text-orientation:mixed;dominant-baseline:auto;baseline-shift:baseline;text-anchor:start;white-space:normal;shape-padding:0;shape-margin:0;inline-size:0;clip-rule:nonzero;display:inline;overflow:visible;visibility:visible;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:#000000;solid-opacity:1;vector-effect:none;fill:#5d2f75;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:2.62449;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:10;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate;stop-color:#000000"
d="M 605.87891 125.3418 C 603.74342 125.34349 601.62385 125.70428 600.01562 126.41992 C 596.7991 127.85121 596.84393 130.158 600.19531 131.60352 C 603.54666 133.04904 608.81675 133.03481 612.0332 131.60352 C 615.24962 130.17223 615.19314 127.86544 611.8418 126.41992 C 610.16611 125.69716 608.0144 125.3401 605.87891 125.3418 z "
transform="scale(0.26458333)" />
<path
id="rect19-7"
style="fill:#8b44ac;stroke-width:0.0746834"
d="m 173.62262,39.765231 -8.92217,3.970304 4.84985,2.091852 8.92217,-3.970304 z" />
</g>
<path
d="m 27.837863,149.08068 q 0,-2.33578 0.62012,-4.48552 0.63045,-2.14974 1.87069,-3.90674 1.24024,-1.757 2.57349,-2.48047 l 0.39274,1.2609 q -1.50895,1.15756 -2.48047,3.53468 -0.96118,2.37711 -1.0542,5.32268 l -0.0103,0.8785 q 0,3.98942 1.45727,6.92465 0.8785,1.757 2.08773,2.74919 l -0.39274,1.16789 q -1.37459,-0.7648 -2.62516,-2.56316 -2.43913,-3.514 -2.43913,-8.4026 z"
style="font-size:2.11667px;line-height:1.25;font-family:Roboto;-inkscape-font-specification:Roboto;fill:#af7fc7;fill-opacity:1;stroke:#ffffff;stroke-width:2.65;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;paint-order:stroke fill markers"
id="path909" />
<path
d="m 42.048903,155.18885 q -0.16536,-0.3307 -0.26872,-1.17823 -1.33325,1.38493 -3.18327,1.38493 -1.65365,0 -2.71819,-0.9302 -1.0542,-0.9405 -1.0542,-2.37712 0,-1.74667 1.32292,-2.70785 1.33325,-0.9715 3.74138,-0.9715 h 1.86035 v -0.8785 q 0,-1.00253 -0.59945,-1.59164 -0.59945,-0.5995 -1.76733,-0.5995 -1.0232,0 -1.71566,0.5168 -0.69247,0.5168 -0.69247,1.25057 h -1.92236 q 0,-0.8372 0.58911,-1.61231 0.59945,-0.7855 1.61231,-1.24023 1.02319,-0.4548 2.24276,-0.4548 1.9327,0 3.02824,0.9715 1.09554,0.9612 1.13689,2.65617 v 5.14699 q 0,1.53996 0.39274,2.44946 v 0.1654 z m -3.17294,-1.45728 q 0.89917,0 1.70533,-0.4651 0.80615,-0.4651 1.16789,-1.20923 v -2.29443 h -1.49862 q -3.51401,0 -3.51401,2.05673 0,0.8992 0.59945,1.4056 0.59945,0.5064 1.53996,0.5064 z"
style="font-size:2.11667px;line-height:1.25;font-family:Roboto;-inkscape-font-specification:Roboto;fill:#af7fc7;fill-opacity:1;stroke:#ffffff;stroke-width:2.65;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;paint-order:stroke fill markers"
id="path911" />
<path
d="m 49.779713,150.01086 -1.1989,1.25057 v 3.92742 h -1.91203 v -15.87503 h 1.91203 v 9.6015 l 1.0232,-1.2299 3.482993,-3.67937 h 2.325443 l -4.351166,4.67156 4.857596,6.51124 h -2.242761 z"
style="font-size:2.11667px;line-height:1.25;font-family:Roboto;-inkscape-font-specification:Roboto;fill:#af7fc7;fill-opacity:1;stroke:#ffffff;stroke-width:2.65;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;paint-order:stroke fill markers"
id="path913" />
<path
d="m 64.290472,155.18885 q -0.16536,-0.3307 -0.26872,-1.17823 -1.333254,1.38493 -3.183273,1.38493 -1.653648,0 -2.718184,-0.9302 -1.054201,-0.9405 -1.054201,-2.37712 0,-1.74667 1.322919,-2.70785 1.333254,-0.9715 3.741379,-0.9715 h 1.860355 v -0.8785 q 0,-1.00253 -0.59945,-1.59164 -0.59945,-0.5995 -1.767337,-0.5995 -1.023195,0 -1.71566,0.5168 -0.69247,0.5168 -0.69247,1.25057 h -1.922357 q 0,-0.8372 0.58911,-1.61231 0.59945,-0.7855 1.612307,-1.24023 1.023195,-0.4548 2.242761,-0.4548 1.932701,0 3.028243,0.9715 1.095542,0.9612 1.136883,2.65617 v 5.14699 q 0,1.53996 0.39274,2.44946 v 0.1654 z m -3.172938,-1.45728 q 0.89917,0 1.705325,-0.4651 0.80615,-0.4651 1.16789,-1.20923 v -2.29443 H 62.49213 q -3.514003,0 -3.514003,2.05673 0,0.8992 0.59945,1.4056 0.59945,0.5064 1.53996,0.5064 z"
style="font-size:2.11667px;line-height:1.25;font-family:Roboto;-inkscape-font-specification:Roboto;fill:#af7fc7;fill-opacity:1;stroke:#ffffff;stroke-width:2.65;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;paint-order:stroke fill markers"
id="path915" />
<path
d="m 68.94136,154.18632 q 0,-0.4961 0.28939,-0.8268 0.29972,-0.3307 0.88884,-0.3307 0.58911,0 0.88884,0.3307 0.31006,0.3307 0.31006,0.8268 0,0.4754 -0.31006,0.7958 -0.29972,0.3204 -0.88884,0.3204 -0.58911,0 -0.88884,-0.3204 -0.28939,-0.3204 -0.28939,-0.7958 z"
style="font-size:2.11667px;line-height:1.25;font-family:Roboto;-inkscape-font-specification:Roboto;fill:#af7fc7;fill-opacity:1;stroke:#ffffff;stroke-width:2.65;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;paint-order:stroke fill markers"
id="path917" />
<path
d="m 82.573621,140.14065 4.919604,12.27834 4.919604,-12.27834 h 2.57349 v 15.0482 h -1.984378 v -5.86012 l 0.18604,-6.3252 -4.940275,12.18532 h -1.519293 l -4.929939,-12.15432 0.19637,6.2942 v 5.86012 h -1.984378 v -15.0482 z"
style="font-size:2.11667px;line-height:1.25;font-family:Roboto;-inkscape-font-specification:Roboto;fill:#af7fc7;fill-opacity:1;stroke:#ffffff;stroke-width:2.65;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;paint-order:stroke fill markers"
id="path919" />
<path
d="m 105.09425,155.18885 q -0.1654,-0.3307 -0.2687,-1.17823 -1.33325,1.38493 -3.18327,1.38493 -1.653651,0 -2.718187,-0.9302 -1.054201,-0.9405 -1.054201,-2.37712 0,-1.74667 1.322919,-2.70785 1.333249,-0.9715 3.741379,-0.9715 h 1.86035 v -0.8785 q 0,-1.00253 -0.5994,-1.59164 -0.5995,-0.5995 -1.76734,-0.5995 -1.0232,0 -1.71566,0.5168 -0.6925,0.5168 -0.6925,1.25057 h -1.922392 q 0,-0.8372 0.58911,-1.61231 0.59945,-0.7855 1.612312,-1.24023 1.02319,-0.4548 2.24276,-0.4548 1.9327,0 3.02824,0.9715 1.09554,0.9612 1.13688,2.65617 v 5.14699 q 0,1.53996 0.3927,2.44946 v 0.1654 z m -3.17294,-1.45728 q 0.8992,0 1.70532,-0.4651 0.8062,-0.4651 1.16789,-1.20923 v -2.29444 h -1.49862 q -3.513997,0 -3.513997,2.05673 0,0.8992 0.599447,1.4056 0.5994,0.5064 1.53996,0.5064 z"
style="font-size:2.11667px;line-height:1.25;font-family:Roboto;-inkscape-font-specification:Roboto;fill:#af7fc7;fill-opacity:1;stroke:#ffffff;stroke-width:2.65;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;paint-order:stroke fill markers"
id="path921" />
<path
d="m 112.29795,141.2982 v 2.70785 h 2.08774 v 1.47795 h -2.08774 v 6.93499 q 0,0.6718 0.2791,1.01286 0.2791,0.3307 0.9509,0.3307 0.3307,0 0.9095,-0.124 v 1.5503 q -0.7545,0.2067 -1.46761,0.2067 -1.28158,0 -1.9327,-0.7752 -0.6511,-0.7751 -0.6511,-2.20141 V 145.484 h -2.03605 v -1.47795 h 2.03605 v -2.70785 z"
style="font-size:2.11667px;line-height:1.25;font-family:Roboto;-inkscape-font-specification:Roboto;fill:#af7fc7;fill-opacity:1;stroke:#ffffff;stroke-width:2.65;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;paint-order:stroke fill markers"
id="path923" />
<path
d="m 121.25866,155.39555 q -2.27377,0 -3.70004,-1.48828 -1.42627,-1.49862 -1.42627,-3.99976 v -0.3514 q 0,-1.66399 0.6305,-2.96623 0.6408,-1.31259 1.77767,-2.04639 1.14722,-0.7442 2.48047,-0.7442 2.18075,0 3.38998,1.43661 1.20923,1.43661 1.20923,4.11345 v 0.7958 h -7.57582 q 0.041,1.65365 0.9612,2.67684 0.9302,1.01286 2.35645,1.01286 1.01286,0 1.71566,-0.4134 0.7028,-0.4134 1.2299,-1.09554 l 1.16789,0.9095 q -1.4056,2.16008 -4.2168,2.16008 z m -0.2377,-10.02524 q -1.15755,0 -1.94303,0.8475 -0.7855,0.8372 -0.9715,2.35645 h 5.60173 v -0.1447 q -0.083,-1.45728 -0.7855,-2.2531 -0.7028,-0.8061 -1.9017,-0.8061 z"
style="font-size:2.11667px;line-height:1.25;font-family:Roboto;-inkscape-font-specification:Roboto;fill:#af7fc7;fill-opacity:1;stroke:#ffffff;stroke-width:2.65;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;paint-order:stroke fill markers"
id="path925" />
<path
d="m 133.23728,145.72171 q -0.4341,-0.072 -0.9405,-0.072 -1.88102,0 -2.55282,1.60197 v 7.93752 h -1.91203 v -11.1828 h 1.86036 l 0.031,1.29191 q 0.9405,-1.49862 2.66651,-1.49862 0.5581,0 0.8475,0.1447 z"
style="font-size:2.11667px;line-height:1.25;font-family:Roboto;-inkscape-font-specification:Roboto;fill:#af7fc7;fill-opacity:1;stroke:#ffffff;stroke-width:2.65;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;paint-order:stroke fill markers"
id="path927" />
<path
d="m 137.07167,155.18885 h -1.91203 v -11.1828 h 1.91203 z m -2.06706,-14.14903 q 0,-0.4651 0.2791,-0.7855 0.2894,-0.3204 0.8475,-0.3204 0.5581,0 0.8475,0.3204 0.2894,0.3204 0.2894,0.7855 0,0.4651 -0.2894,0.7752 -0.2894,0.3101 -0.8475,0.3101 -0.5581,0 -0.8475,-0.3101 -0.2791,-0.3101 -0.2791,-0.7752 z"
style="font-size:2.11667px;line-height:1.25;font-family:Roboto;-inkscape-font-specification:Roboto;fill:#af7fc7;fill-opacity:1;stroke:#ffffff;stroke-width:2.65;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;paint-order:stroke fill markers"
id="path929" />
<path
d="m 147.0349,155.18885 q -0.1654,-0.3307 -0.2687,-1.17823 -1.33325,1.38493 -3.18327,1.38493 -1.65365,0 -2.71819,-0.9302 -1.0542,-0.9405 -1.0542,-2.37712 0,-1.74667 1.32292,-2.70785 1.33325,-0.9715 3.74138,-0.9715 h 1.86035 v -0.8785 q 0,-1.00253 -0.5994,-1.59164 -0.5995,-0.5995 -1.76734,-0.5995 -1.02319,0 -1.71566,0.5168 -0.6925,0.5168 -0.6925,1.25057 h -1.92236 q 0,-0.8372 0.5891,-1.61231 0.5994,-0.7855 1.61231,-1.24023 1.02319,-0.4548 2.24276,-0.4548 1.9327,0 3.02824,0.9715 1.09554,0.9612 1.13689,2.65617 v 5.14699 q 0,1.53996 0.3927,2.44946 v 0.1654 z m -3.17294,-1.45728 q 0.8992,0 1.70533,-0.4651 0.8062,-0.4651 1.16788,-1.20923 v -2.29444 h -1.49861 q -3.51401,0 -3.51401,2.05673 0,0.8992 0.5994,1.4056 0.5995,0.5064 1.53996,0.5064 z"
style="font-size:2.11667px;line-height:1.25;font-family:Roboto;-inkscape-font-specification:Roboto;fill:#af7fc7;fill-opacity:1;stroke:#ffffff;stroke-width:2.65;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;paint-order:stroke fill markers"
id="path931" />
<path
d="m 153.72184,155.18885 h -1.91203 v -15.87503 h 1.91203 z"
style="font-size:2.11667px;line-height:1.25;font-family:Roboto;-inkscape-font-specification:Roboto;fill:#af7fc7;fill-opacity:1;stroke:#ffffff;stroke-width:2.65;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;paint-order:stroke fill markers"
id="path933" />
<path
d="m 162.32081,155.18885 v -15.0482 h 4.24781 q 1.96371,0 3.47266,0.8682 1.50896,0.8682 2.32545,2.47014 0.8268,1.60197 0.8372,3.67937 v 0.9612 q 0,2.12907 -0.8268,3.73104 -0.8165,1.60198 -2.34611,2.45981 -1.51929,0.8578 -3.54501,0.8785 z m 1.98438,-13.41523 v 11.79258 h 2.08773 q 2.29444,0 3.56568,-1.42627 1.28158,-1.42627 1.28158,-4.06177 v -0.8785 q 0,-2.56316 -1.20923,-3.97909 -1.1989,-1.42628 -3.41065,-1.44695 z"
style="font-size:2.11667px;line-height:1.25;font-family:Roboto;-inkscape-font-specification:Roboto;fill:#af7fc7;fill-opacity:1;stroke:#ffffff;stroke-width:2.65;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;paint-order:stroke fill markers"
id="path935" />
<path
d="m 180.54195,155.39555 q -2.27377,0 -3.70004,-1.48828 -1.42627,-1.49862 -1.42627,-3.99976 v -0.3514 q 0,-1.66399 0.6304,-2.96623 0.6408,-1.31259 1.77768,-2.04639 1.14721,-0.7442 2.48047,-0.7442 2.18075,0 3.38998,1.43661 1.20923,1.43661 1.20923,4.11345 v 0.7958 h -7.57578 q 0.041,1.65365 0.9612,2.67684 0.9302,1.01286 2.35645,1.01286 1.01286,0 1.71566,-0.4134 0.7028,-0.4134 1.2299,-1.09554 l 1.16789,0.9095 q -1.4056,2.16008 -4.2168,2.16008 z m -0.2377,-10.02524 q -1.15756,0 -1.94304,0.8475 -0.7855,0.8372 -0.9715,2.35645 h 5.60174 v -0.1447 q -0.083,-1.45728 -0.7855,-2.2531 -0.7028,-0.8061 -1.90169,-0.8061 z"
style="font-size:2.11667px;line-height:1.25;font-family:Roboto;-inkscape-font-specification:Roboto;fill:#af7fc7;fill-opacity:1;stroke:#ffffff;stroke-width:2.65;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;paint-order:stroke fill markers"
id="path937" />
<path
d="m 193.62645,152.22261 q 0,-0.7751 -0.5891,-1.19889 -0.5788,-0.4341 -2.03606,-0.7441 -1.44694,-0.3101 -2.30477,-0.7441 -0.8475,-0.4341 -1.26091,-1.03353 -0.4031,-0.5995 -0.4031,-1.42628 0,-1.37459 1.15756,-2.32544 1.16789,-0.9508 2.97657,-0.9508 1.90169,0 3.07992,0.9819 1.18856,0.9818 1.18856,2.51148 h -1.92237 q 0,-0.7855 -0.6718,-1.35393 -0.6614,-0.5684 -1.67431,-0.5684 -1.04387,0 -1.63298,0.4547 -0.5891,0.4548 -0.5891,1.18856 0,0.6925 0.5478,1.04387 0.5478,0.3514 1.97404,0.6718 1.43661,0.3204 2.32544,0.7648 0.8888,0.4444 1.31259,1.07487 0.4341,0.6201 0.4341,1.51929 0,1.49861 -1.1989,2.40812 -1.19889,0.8992 -3.11092,0.8992 -1.34359,0 -2.37712,-0.4754 -1.03353,-0.4754 -1.62264,-1.32292 -0.5788,-0.8578 -0.5788,-1.85002 h 1.91203 q 0.052,0.9612 0.7648,1.52963 0.7235,0.5581 1.9017,0.5581 1.0852,0 1.73633,-0.4341 0.6615,-0.4444 0.6615,-1.17823 z"
style="font-size:2.11667px;line-height:1.25;font-family:Roboto;-inkscape-font-specification:Roboto;fill:#af7fc7;fill-opacity:1;stroke:#ffffff;stroke-width:2.65;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;paint-order:stroke fill markers"
id="path939" />
<path
d="m 200.10668,155.18885 h -1.91203 v -11.1828 h 1.91203 z m -2.06706,-14.14903 q 0,-0.4651 0.2791,-0.7855 0.2894,-0.3204 0.8475,-0.3204 0.5581,0 0.8475,0.3204 0.2894,0.3204 0.2894,0.7855 0,0.4651 -0.2894,0.7752 -0.2894,0.3101 -0.8475,0.3101 -0.5581,0 -0.8475,-0.3101 -0.2791,-0.3101 -0.2791,-0.7752 z"
style="font-size:2.11667px;line-height:1.25;font-family:Roboto;-inkscape-font-specification:Roboto;fill:#af7fc7;fill-opacity:1;stroke:#ffffff;stroke-width:2.65;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;paint-order:stroke fill markers"
id="path941" />
<path
d="m 202.71117,149.50443 q 0,-2.61483 1.20923,-4.15479 1.20923,-1.5503 3.20395,-1.5503 2.04639,0 3.19361,1.44695 l 0.093,-1.24024 h 1.74667 v 10.91408 q 0,2.17041 -1.29191,3.42098 -1.28158,1.25058 -3.45199,1.25058 -1.20923,0 -2.36679,-0.5168 -1.15755,-0.5168 -1.76733,-1.41594 l 0.9922,-1.14721 q 1.22991,1.51928 3.00758,1.51928 1.39526,0 2.17041,-0.7855 0.7855,-0.7855 0.7855,-2.21175 v -0.9612 q -1.14721,1.32292 -3.13159,1.32292 -1.96371,0 -3.18328,-1.5813 -1.20923,-1.5813 -1.20923,-4.30982 z m 1.92237,0.217 q 0,1.89136 0.7751,2.97657 0.7752,1.07487 2.17041,1.07487 1.80868,0 2.65617,-1.64331 v -5.10564 q -0.8785,-1.60197 -2.6355,-1.60197 -1.39526,0 -2.18075,1.0852 -0.7855,1.08521 -0.7855,3.21428 z"
style="font-size:2.11667px;line-height:1.25;font-family:Roboto;-inkscape-font-specification:Roboto;fill:#af7fc7;fill-opacity:1;stroke:#ffffff;stroke-width:2.65;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;paint-order:stroke fill markers"
id="path943" />
<path
d="m 216.84987,144.00605 0.062,1.4056 q 1.28158,-1.61231 3.34864,-1.61231 3.54501,0 3.57602,3.99977 v 7.38974 h -1.91203 v -7.40008 q -0.01,-1.20923 -0.5581,-1.78801 -0.5374,-0.5788 -1.68465,-0.5788 -0.9302,0 -1.63298,0.4961 -0.7028,0.4961 -1.09554,1.30225 v 7.96852 h -1.91204 v -11.1828 z"
style="font-size:2.11667px;line-height:1.25;font-family:Roboto;-inkscape-font-specification:Roboto;fill:#af7fc7;fill-opacity:1;stroke:#ffffff;stroke-width:2.65;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;paint-order:stroke fill markers"
id="path945" />
<path
d="m 234.03748,155.18885 h -1.91203 v -11.1828 h 1.91203 z m -2.06706,-14.14903 q 0,-0.4651 0.279,-0.7855 0.2894,-0.3204 0.8475,-0.3204 0.5581,0 0.8475,0.3204 0.2894,0.3204 0.2894,0.7855 0,0.4651 -0.2894,0.7752 -0.2894,0.3101 -0.8475,0.3101 -0.5581,0 -0.8475,-0.3101 -0.279,-0.3101 -0.279,-0.7752 z"
style="font-size:2.11667px;line-height:1.25;font-family:Roboto;-inkscape-font-specification:Roboto;fill:#af7fc7;fill-opacity:1;stroke:#ffffff;stroke-width:2.65;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;paint-order:stroke fill markers"
id="path947" />
<path
d="m 238.9054,144.00605 0.062,1.4056 q 1.28158,-1.61231 3.34864,-1.61231 3.54501,0 3.57602,3.99977 v 7.38974 h -1.91203 v -7.40008 q -0.01,-1.20923 -0.5581,-1.78801 -0.5374,-0.5788 -1.68465,-0.5788 -0.9302,0 -1.63298,0.4961 -0.7028,0.4961 -1.09554,1.30225 v 7.96852 h -1.91204 v -11.1828 z"
style="font-size:2.11667px;line-height:1.25;font-family:Roboto;-inkscape-font-specification:Roboto;fill:#af7fc7;fill-opacity:1;stroke:#ffffff;stroke-width:2.65;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;paint-order:stroke fill markers"
id="path949" />
<path
d="m 310.82877,149.18404 q 0,2.30477 -0.6098,4.42351 -0.5994,2.1084 -1.85002,3.8964 -1.24023,1.78801 -2.60449,2.54249 l -0.4031,-1.16789 q 1.59164,-1.21957 2.55282,-3.78272 0.9715,-2.57349 0.9922,-5.70509 v -0.3307 q 0,-2.17041 -0.4547,-4.03077 -0.4548,-1.87069 -1.27125,-3.34863 -0.8062,-1.47795 -1.81901,-2.30478 l 0.4031,-1.16788 q 1.36426,0.7545 2.59416,2.52181 1.24023,1.76734 1.85002,3.89641 0.6201,2.12907 0.6201,4.55787 z"
style="font-size:2.11667px;line-height:1.25;font-family:Roboto;-inkscape-font-specification:Roboto;fill:#af7fc7;fill-opacity:1;stroke:#ffffff;stroke-width:2.65;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;paint-order:stroke fill markers"
id="path951" />
<path
d="m 181.06396,119.52502 h -6.30453 l -1.41594,3.92742 h -2.04639 l 5.74643,-15.0482 h 1.73633 l 5.75676,15.0482 h -2.03605 z m -5.70509,-1.63297 h 5.11598 l -2.56316,-7.03834 z"
style="font-size:2.11667px;line-height:1.25;font-family:Roboto;-inkscape-font-specification:Roboto;fill:#693685;fill-opacity:1;stroke:#fefeff;stroke-width:2;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;paint-order:stroke fill markers;fill-rule:nonzero"
id="path873-5" />
<path
d="m 189.43555,120.85828 2.76986,-8.58864 h 1.95338 l -4.0101,11.1828 h -1.45728 l -4.05144,-11.1828 h 1.95337 z"
style="font-size:2.11667px;line-height:1.25;font-family:Roboto;-inkscape-font-specification:Roboto;fill:#693685;fill-opacity:1;stroke:#fefeff;stroke-width:2;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;paint-order:stroke fill markers;fill-rule:nonzero"
id="path875-8" />
<path
d="m 202.74742,123.45244 q -0.1654,-0.3307 -0.2687,-1.17822 -1.33326,1.38493 -3.18328,1.38493 -1.65365,0 -2.71818,-0.9302 -1.0542,-0.9405 -1.0542,-2.37712 0,-1.74667 1.32292,-2.70785 1.33325,-0.9715 3.74137,-0.9715 h 1.86036 v -0.8785 q 0,-1.00253 -0.5995,-1.59164 -0.5994,-0.5994 -1.76733,-0.5994 -1.0232,0 -1.71567,0.5168 -0.6925,0.5168 -0.6925,1.25056 h -1.92237 q 0,-0.83719 0.5891,-1.61229 0.5994,-0.7855 1.6123,-1.24024 1.0232,-0.4548 2.24276,-0.4548 1.9327,0 3.02825,0.9715 1.09554,0.9612 1.13688,2.65617 v 5.14698 q 0,1.53996 0.3927,2.44946 v 0.1654 z m -3.17293,-1.45728 q 0.8992,0 1.70532,-0.4651 0.8061,-0.4651 1.16789,-1.20923 v -2.29442 h -1.49862 q -3.514,0 -3.514,2.05672 0,0.8992 0.5995,1.4056 0.5994,0.5064 1.53996,0.5064 z"
style="font-size:2.11667px;line-height:1.25;font-family:Roboto;-inkscape-font-specification:Roboto;fill:#693685;fill-opacity:1;stroke:#fefeff;stroke-width:2;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;paint-order:stroke fill markers;fill-rule:nonzero"
id="path877-0" />
<path
d="m 209.43436,123.45244 h -1.91203 v -15.87502 h 1.91203 z"
style="font-size:2.11667px;line-height:1.25;font-family:Roboto;-inkscape-font-specification:Roboto;fill:#693685;fill-opacity:1;stroke:#fefeff;stroke-width:2;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;paint-order:stroke fill markers;fill-rule:nonzero"
id="path879-8" />
<path
d="m 211.98718,117.75769 q 0,-1.64331 0.6408,-2.95591 0.6511,-1.31257 1.79834,-2.02571 1.15756,-0.7131 2.63551,-0.7131 2.2841,0 3.6897,1.5813 1.41594,1.58129 1.41594,4.20647 v 0.1343 q 0,1.63298 -0.6305,2.93523 -0.6201,1.29191 -1.78801,2.01538 -1.15755,0.7235 -2.6665,0.7235 -2.27377,0 -3.68971,-1.58131 -1.4056,-1.5813 -1.4056,-4.18579 z m 1.92237,0.2274 q 0,1.86036 0.8578,2.98691 0.8682,1.12655 2.31511,1.12655 1.45727,0 2.3151,-1.13689 0.8578,-1.14722 0.8578,-3.20394 0,-1.83969 -0.8785,-2.97657 -0.8682,-1.14722 -2.3151,-1.14722 -1.41594,0 -2.28411,1.12655 -0.8682,1.12655 -0.8682,3.22461 z"
style="font-size:2.11667px;line-height:1.25;font-family:Roboto;-inkscape-font-specification:Roboto;fill:#693685;fill-opacity:1;stroke:#fefeff;stroke-width:2;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;paint-order:stroke fill markers;fill-rule:nonzero"
id="path882-7" />
<path
d="m 226.37392,112.26964 0.062,1.4056 q 1.28157,-1.6123 3.34863,-1.6123 3.54501,0 3.57602,3.99976 v 7.38974 h -1.91203 v -7.40008 q -0.01,-1.20924 -0.5581,-1.788 -0.5374,-0.5788 -1.68465,-0.5788 -0.9302,0 -1.63298,0.4961 -0.7028,0.4961 -1.09554,1.30224 v 7.96853 h -1.91203 v -11.1828 z"
style="font-size:2.11667px;line-height:1.25;font-family:Roboto;-inkscape-font-specification:Roboto;fill:#693685;fill-opacity:1;stroke:#fefeff;stroke-width:2;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;paint-order:stroke fill markers;fill-rule:nonzero"
id="path884-7" />
<path
d="m 238.32153,123.45244 h -1.91203 v -11.1828 h 1.91203 z m -2.06706,-14.14903 q 0,-0.4651 0.2791,-0.7855 0.2894,-0.3204 0.8475,-0.3204 0.5581,0 0.8475,0.3204 0.2894,0.3204 0.2894,0.7855 0,0.4651 -0.2894,0.7752 -0.2894,0.3101 -0.8475,0.3101 -0.5581,0 -0.8475,-0.3101 -0.2791,-0.3101 -0.2791,-0.7752 z"
style="font-size:2.11667px;line-height:1.25;font-family:Roboto;-inkscape-font-specification:Roboto;fill:#693685;fill-opacity:1;stroke:#fefeff;stroke-width:2;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;paint-order:stroke fill markers;fill-rule:nonzero"
id="path886-4" />
<path
d="m 248.28477,123.45244 q -0.1654,-0.3307 -0.2687,-1.17822 -1.33326,1.38493 -3.18326,1.38493 -1.65366,0 -2.7182,-0.9302 -1.0542,-0.9405 -1.0542,-2.37712 0,-1.74667 1.32292,-2.70785 1.33325,-0.9715 3.74138,-0.9715 h 1.86035 v -0.8785 q 0,-1.00253 -0.5994,-1.59164 -0.5994,-0.5994 -1.76733,-0.5994 -1.0232,0 -1.71566,0.5168 -0.6925,0.5168 -0.6925,1.25056 h -1.92236 q 0,-0.83719 0.5891,-1.61229 0.5995,-0.7855 1.61231,-1.24024 1.02319,-0.4548 2.24276,-0.4548 1.9327,0 3.02824,0.9715 1.09554,0.9612 1.13688,2.65617 v 5.14698 q 0,1.53996 0.3927,2.44946 v 0.1654 z m -3.17294,-1.45728 q 0.8992,0 1.70532,-0.4651 0.8062,-0.4651 1.16789,-1.20923 v -2.29443 h -1.49862 q -3.514,0 -3.514,2.05672 0,0.8992 0.5995,1.4056 0.5994,0.5064 1.53996,0.5064 z"
style="font-size:2.11667px;line-height:1.25;font-family:Roboto;-inkscape-font-specification:Roboto;fill:#693685;fill-opacity:1;stroke:#fefeff;stroke-width:2;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;paint-order:stroke fill markers;fill-rule:nonzero"
id="path888-8" />
<path
d="m 166.30514,122.44974 q 0,-0.4961 0.28941,-0.8268 0.29969,-0.3307 0.88879,-0.3307 0.5891,0 0.8888,0.3307 0.31011,0.3307 0.31011,0.8268 0,0.4754 -0.31011,0.7958 -0.2997,0.3204 -0.8888,0.3204 -0.5891,0 -0.88879,-0.3204 -0.28941,-0.3204 -0.28941,-0.7958 z"
style="font-size:2.11667px;line-height:1.25;font-family:Roboto;-inkscape-font-specification:Roboto;fill:url(#linearGradient1275);fill-opacity:1;stroke:#fefeff;stroke-width:2;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;paint-order:stroke fill markers;fill-rule:nonzero"
id="path890-0" />
<path
d="m 90.940023,108.40406 4.9196,12.27834 4.919607,-12.27834 h 2.57349 v 15.0482 h -1.98438 v -5.86012 l 0.186,-6.3252 -4.940267,12.18532 h -1.51929 l -4.92994,-12.15432 0.1964,6.2942 v 5.86012 h -1.98438 v -15.0482 z"
style="font-size:2.11667px;line-height:1.25;font-family:Roboto;-inkscape-font-specification:Roboto;fill:#a973c6;fill-opacity:1;stroke:#fefeff;stroke-width:2;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;paint-order:stroke fill markers;fill-rule:nonzero"
id="path892-7" />
<path
d="m 113.46064,123.45226 q -0.1654,-0.3307 -0.2687,-1.17822 -1.33325,1.38493 -3.18327,1.38493 -1.65365,0 -2.71819,-0.9302 -1.0542,-0.9405 -1.0542,-2.37712 0,-1.74667 1.32292,-2.70785 1.33326,-0.9715 3.74138,-0.9715 h 1.86036 v -0.8785 q 0,-1.00252 -0.5995,-1.59164 -0.5994,-0.5994 -1.76734,-0.5994 -1.02319,0 -1.71566,0.5168 -0.6925,0.5168 -0.6925,1.25057 h -1.92237 q 0,-0.8372 0.5891,-1.6123 0.5994,-0.7855 1.61231,-1.24024 1.02319,-0.4548 2.24276,-0.4548 1.9327,0 3.02824,0.9715 1.09555,0.9612 1.13689,2.65617 v 5.14698 q 0,1.53996 0.3927,2.44946 v 0.1654 z m -3.17294,-1.45728 q 0.8992,0 1.70533,-0.4651 0.8061,-0.4651 1.16789,-1.20923 v -2.29443 h -1.49862 q -3.51401,0 -3.51401,2.05672 0,0.8992 0.5994,1.4056 0.5995,0.5064 1.53996,0.5064 z"
style="font-size:2.11667px;line-height:1.25;font-family:Roboto;-inkscape-font-specification:Roboto;fill:#a973c6;fill-opacity:1;stroke:#fefeff;stroke-width:2;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;paint-order:stroke fill markers;fill-rule:nonzero"
id="path894-6" />
<path
d="m 120.66435,109.56161 v 2.70785 h 2.08774 v 1.47795 h -2.08774 v 6.93499 q 0,0.6718 0.2791,1.01286 0.2791,0.3307 0.9509,0.3307 0.3307,0 0.9095,-0.124 v 1.5503 q -0.7545,0.2067 -1.46762,0.2067 -1.28157,0 -1.9327,-0.7752 -0.6511,-0.7752 -0.6511,-2.20142 v -6.93499 h -2.03606 v -1.47795 h 2.03606 v -2.70785 z"
style="font-size:2.11667px;line-height:1.25;font-family:Roboto;-inkscape-font-specification:Roboto;fill:#a973c6;fill-opacity:1;stroke:#fefeff;stroke-width:2;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;paint-order:stroke fill markers;fill-rule:nonzero"
id="path896-0" />
<path
d="m 129.62505,123.65897 q -2.27377,0 -3.70004,-1.48829 -1.42627,-1.49862 -1.42627,-3.99976 v -0.3514 q 0,-1.66398 0.6304,-2.96623 0.6408,-1.31259 1.77767,-2.04639 1.14722,-0.7441 2.48048,-0.7441 2.18075,0 3.38998,1.4366 1.20924,1.43661 1.20924,4.11345 v 0.7958 h -7.57579 q 0.041,1.65365 0.9612,2.67685 0.9302,1.01286 2.35646,1.01286 1.01285,0 1.71565,-0.4134 0.7028,-0.4134 1.2299,-1.09554 l 1.16789,0.9095 q -1.4056,2.16008 -4.2168,2.16008 z m -0.2377,-10.02525 q -1.15756,0 -1.94304,0.8475 -0.7855,0.8372 -0.9715,2.35645 h 5.60173 v -0.1447 q -0.083,-1.45728 -0.7855,-2.25309 -0.7028,-0.8062 -1.90169,-0.8062 z"
style="font-size:2.11667px;line-height:1.25;font-family:Roboto;-inkscape-font-specification:Roboto;fill:#a973c6;fill-opacity:1;stroke:#fefeff;stroke-width:2;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;paint-order:stroke fill markers;fill-rule:nonzero"
id="path898-4" />
<path
d="m 141.60367,113.98512 q -0.4341,-0.072 -0.9405,-0.072 -1.88103,0 -2.55282,1.60197 v 7.93751 h -1.91203 v -11.1828 h 1.86035 l 0.031,1.29192 q 0.94051,-1.49862 2.6665,-1.49862 0.5581,0 0.8475,0.1447 z"
style="font-size:2.11667px;line-height:1.25;font-family:Roboto;-inkscape-font-specification:Roboto;fill:#a973c6;fill-opacity:1;stroke:#fefeff;stroke-width:2;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;paint-order:stroke fill markers;fill-rule:nonzero"
id="path900-8" />
<path
d="m 145.43806,123.45226 h -1.91203 v -11.1828 h 1.91203 z M 143.371,109.30323 q 0,-0.4651 0.2791,-0.7855 0.2894,-0.3204 0.8475,-0.3204 0.5581,0 0.8475,0.3204 0.2894,0.3204 0.2894,0.7855 0,0.4651 -0.2894,0.7752 -0.2894,0.3101 -0.8475,0.3101 -0.5581,0 -0.8475,-0.3101 -0.2791,-0.3101 -0.2791,-0.7752 z"
style="font-size:2.11667px;line-height:1.25;font-family:Roboto;-inkscape-font-specification:Roboto;fill:#a973c6;fill-opacity:1;stroke:#fefeff;stroke-width:2;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;paint-order:stroke fill markers;fill-rule:nonzero"
id="path902-1" />
<path
d="m 155.4013,123.45226 q -0.16541,-0.3307 -0.2687,-1.17822 -1.33326,1.38493 -3.18328,1.38493 -1.65365,0 -2.71818,-0.9302 -1.05421,-0.9405 -1.05421,-2.37712 0,-1.74667 1.32292,-2.70785 1.33326,-0.9715 3.74138,-0.9715 h 1.86036 v -0.8785 q 0,-1.00252 -0.5994,-1.59164 -0.5994,-0.5994 -1.76734,-0.5994 -1.02319,0 -1.71566,0.5168 -0.6925,0.5168 -0.6925,1.25057 h -1.92237 q 0,-0.8372 0.5891,-1.6123 0.5995,-0.7855 1.61231,-1.24024 1.0232,-0.4548 2.24276,-0.4548 1.9327,0 3.02824,0.9715 1.09556,0.9612 1.13689,2.65617 v 5.14698 q 0,1.53996 0.3927,2.44946 v 0.1654 z m -3.17295,-1.45728 q 0.8992,0 1.70533,-0.4651 0.8062,-0.4651 1.1679,-1.20923 v -2.29443 h -1.49863 q -3.514,0 -3.514,2.05672 0,0.8992 0.5994,1.4056 0.5994,0.5064 1.53996,0.5064 z"
style="font-size:2.11667px;line-height:1.25;font-family:Roboto;-inkscape-font-specification:Roboto;fill:#a973c6;fill-opacity:1;stroke:#fefeff;stroke-width:2;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;paint-order:stroke fill markers;fill-rule:nonzero"
id="path904-0" />
<path
d="m 162.08823,123.45226 h -1.91203 v -15.87502 h 1.91203 z"
style="font-size:2.11667px;line-height:1.25;font-family:Roboto;-inkscape-font-specification:Roboto;fill:#a973c6;fill-opacity:1;stroke:#fefeff;stroke-width:2;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;paint-order:stroke fill markers;fill-rule:nonzero"
id="path906-1" />
</g>
<style
type="text/css"
id="style2">
.st0{fill:#FFFFFF;}
.st1{fill:none;stroke:url(#SVGID_1_);stroke-width:60;stroke-miterlimit:10;}
.st2{fill:#8B44AC;}
.st3{fill:#5D2F75;stroke:#FFFFFF;stroke-width:10;stroke-miterlimit:10;}
</style>
</svg>

Before

Width:  |  Height:  |  Size: 40 KiB

+1 -1
View File
@@ -1,6 +1,6 @@
MIT License
Copyright (c) 2019 CreateLab
Copyright (c) CreateLab, SKProCH, appleneko2001 and Contributors
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
@@ -1,3 +1,6 @@
namespace Material.Avalonia {
public class MaterialAvaloniaTemplates : global::Avalonia.Styling.Styles { }
namespace Material.Avalonia
{
public class MaterialAvaloniaTemplates : global::Avalonia.Styling.Styles
{
}
}
+28 -19
View File
@@ -2,36 +2,45 @@
<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
<VersionPrefix>3.0.0-avalonia10-preview1</VersionPrefix>
<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>
<PackageLicenseUrl>https://raw.githubusercontent.com/AvaloniaCommunity/Material.Avalonia/master/LICENSE</PackageLicenseUrl>
<RepositoryUrl>https://github.com/AvaloniaCommunity/Material.Avalonia</RepositoryUrl>
<RepositoryType>git</RepositoryType>
<LangVersion>8</LangVersion>
<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-avalonia10-preview2</VersionPrefix>
<PackageReleaseNotes>
This is the same as 3.0.0-rc0
Most likely latest version with Avalonia 0.10.x support
Version 3.0.0-rc0 was replaced with 3.0.0-avalonia10-preview1 (in order to keep version names clear)
- Removed Material.Icons dependency (must be installed separately from https://github.com/AvaloniaUtils/Material.Icons.Avalonia) #127
- Rework styles (details https://github.com/AvaloniaCommunity/Material.Avalonia/wiki/Advanced-Theming#migrating-25---30)
- Fix neverest version of Avalonia support #133
- Add SideSheet control #145
- Add opening navigation drawer from right side #131
- Fix context menu item submenu appearing and disappearing in infinite loop #142
- Fix binding on LeftDrawerWidth hides all content/behavior of NavigationDrawer #151
- Fix custom dialog view datacontext binding #152
- Fix ProgressBar styles inheritance #125
- Fix show password button is not visible until clicked #124
- Fix CustomDialogs content #121
- Set KeyboardNavigation.TabNavigation property to Continue on ItemsPresenter #146
- Stop Spinner from rotating when hidden.
- Other fixes and improvements
- Bump Avalonia version dependency to 0.10.13
- Implement adapting to system base theme mode on Windows
- Improve/redesign Expander, TextBlock, Separator and other styles
- Create ContentExpandControl, used for animate resizing
- Add TransitioningContentControl style support
- Allow use Avalonia.Diagnostics to dialogs when using DEBUG profile
- Attach TextBlock properties to NumericUpDown
- Add padding to alert dialog and text field dialog
- Fix AutoCorrectPositionConverter #172
- Add default value for Slider, correct dots positioning
- Change resources apply logic to avoid colors apply delay while application starting
- Correct HsbConverter.ToColor method
- Add static part names pool
- Add auto-expand feature on NavigationDrawer
- Update contrast color algorithm
- Add InputMethod.IsInputMethodEnabled for TextBox
</PackageReleaseNotes>
</PropertyGroup>
<ItemGroup>
<None Include="../README.md" Pack="true" PackagePath="/" />
<None Include="../wiki/FavIcon.png" Pack="true" PackagePath="/" />
</ItemGroup>
<!-- For nightly versions-->
<PropertyGroup>
<Version Condition="'$(PatchNumber)' != ''">$(VersionPrefix).$(PatchNumber)</Version>
@@ -44,7 +53,7 @@ Version 3.0.0-rc0 was replaced with 3.0.0-avalonia10-preview1 (in order to keep
</ItemGroup>
<ItemGroup>
<PackageReference Include="Avalonia" Version="0.10.11" />
<PackageReference Include="Avalonia" Version="0.10.13" />
</ItemGroup>
<ItemGroup>
+100 -20
View File
@@ -1,51 +1,131 @@
using System;
using Avalonia.Media;
namespace Material.Colors.ColorManipulation {
public static class ColorHelper {
public static Color ContrastingForegroundColor(this Color color) {
double RgbSrgb(double d) {
d = d / 255.0;
return d > 0.03928
? d = Math.Pow((d + 0.055) / 1.055, 2.4)
: d = d / 12.92;
}
namespace Material.Colors.ColorManipulation
{
public static class ColorHelper
{
[Obsolete("Please use PickContrastColor method instead.")]
public static Color ContrastingForegroundColor(this Color color) =>
PickContrastColor(color);
var r = RgbSrgb(color.R);
var g = RgbSrgb(color.G);
var b = RgbSrgb(color.B);
var luminance = 0.2126 * r + 0.7152 * g + 0.0722 * b;
return luminance > 0.179 ? Avalonia.Media.Colors.Black : Avalonia.Media.Colors.White;
/// <summary>
/// Choose most accessible color by algorithm. The primary and secondary color is pure black and white.
/// </summary>
/// <param name="color">Background color</param>
/// <param name="ratio">Minimal contrast ratio. It is 4.5 by default.</param>
/// <returns>The most accessible color (AAA or AA level) for text</returns>
public static Color PickContrastColor(this Color color, double ratio = 4.5)
{
return AlgorithmContrastColor(color, Avalonia.Media.Colors.Black, Avalonia.Media.Colors.White, ratio);
}
public static Color ShiftLightness(this Color color, int amount = 1) {
/// <summary>
/// Choose most accessible color by algorithm.
/// </summary>
/// <param name="color">Background color</param>
/// <param name="a">Primary accessible color</param>
/// <param name="b">Secondary accessible color</param>
/// <param name="ratio">Minimal contrast ratio. It is 4.5 by default.</param>
/// <returns>The most accessible color for text or control (not guarantee its accessible because the primary and secondary colors might not most used on UIs.)</returns>
public static Color PickContrastColor(this Color color, Color a, Color b, double ratio = 4.5)
{
return AlgorithmContrastColor(color, a, b, ratio);
}
public static Color ShiftLightness(this Color color, int amount = 1)
{
var lab = color.ToLab();
var shifted = new Lab(lab.L - LabConstants.Kn * amount, lab.A, lab.B);
return shifted.ToColor();
}
public static Color Darken(this Color color, int amount = 1) {
public static Color Darken(this Color color, int amount = 1)
{
return color.ShiftLightness(amount);
}
public static Color Lighten(this Color color, int amount = 1) {
public static Color Lighten(this Color color, int amount = 1)
{
return color.ShiftLightness(-amount);
}
/// <summary>
/// Calculate relative luminance of color.
/// https://www.w3.org/TR/WCAG21/#dfn-relative-luminance
/// </summary>
/// <param name="c">Color used for measurement.</param>
/// <returns>The magnitude of relative luminance of color</returns>
public static double RelativeLuminance(this Color c)
{
double Process(double s) =>
s < 0.03928 ? s / 12.92 : Math.Pow((s + 0.055) / 1.055, 2.4);
double dR = (double) c.R / 255,
dG = (double) c.G / 255,
dB = (double) c.B / 255;
var r = Process(dR);
var g = Process(dG);
var b = Process(dB);
return 0.2126 * r + 0.7152 * g + 0.0722 * b;
}
/// <summary>
/// Get color contrast between two colors
/// </summary>
/// <param name="a">First color</param>
/// <param name="b">Second color</param>
/// <returns>Maximum possible contrast value. E.g: contrast white and black is 21, then it return 21.</returns>
public static double Contrast(this Color a, Color b)
{
var l1 = RelativeLuminance(a) + 0.05;
var l2 = RelativeLuminance(b) + 0.05;
var ratio = l1 / l2;
if (l2 > l1)
ratio = l2 / l1;
return ratio;
}
/// <summary>
/// Calculates the CIE76 distance between two colors.
/// </summary>
/// <param name="color"></param>
/// <param name="other"></param>
/// <returns></returns>
public static double Difference(this Color color, Color other) {
public static double Difference(this Color color, Color other)
{
var lab1 = color.ToLab();
var lab2 = color.ToLab();
var lab2 = other.ToLab();
return Math.Sqrt(Math.Pow(lab2.L - lab1.L, 2) +
Math.Pow(lab2.A - lab1.A, 2) +
Math.Pow(lab2.B - lab1.B, 2));
}
// https://github.com/LeaVerou/contrast-ratio
private static Color AlgorithmContrastColor(Color backColor, Color a, Color b, double ratio = 4.5)
{
var contrast1 = Contrast(backColor, a);
var contrast2 = Contrast(backColor, b);
Color result;
switch (contrast1 >= ratio)
{
case true:
result = contrast1 > contrast2 ? a : b;
break;
default:
result = contrast2 > contrast1 ? b : a;
break;
}
return result;
}
}
}
+6 -3
View File
@@ -1,10 +1,13 @@
namespace Material.Colors.ColorManipulation {
public struct Hsb {
namespace Material.Colors.ColorManipulation
{
public struct Hsb
{
public double Hue { get; }
public double Saturation { get; }
public double Brightness { get; }
public Hsb(double hue, double saturation, double brightness) {
public Hsb(double hue, double saturation, double brightness)
{
Hue = hue;
Saturation = saturation;
Brightness = brightness;
@@ -2,9 +2,12 @@
using System.Linq;
using Avalonia.Media;
namespace Material.Colors.ColorManipulation {
public static class HsbConverter {
public static Color ToColor(this Hsb hsv) {
namespace Material.Colors.ColorManipulation
{
public static class HsbConverter
{
public static Color ToColor(this Hsb hsv)
{
var h = hsv.Hue;
var s = hsv.Saturation;
var b = hsv.Brightness;
@@ -25,17 +28,27 @@ namespace Material.Colors.ColorManipulation {
var q = b * (1 - s * f);
var t = b * (1 - s * (1 - f));
if (i == 0) return Color.FromRgb((byte) b, (byte) t, (byte) p);
if (i == 1) return Color.FromRgb((byte) q, (byte) b, (byte) p);
if (i == 2) return Color.FromRgb((byte) p, (byte) b, (byte) t);
if (i == 3) return Color.FromRgb((byte) p, (byte) q, (byte) b);
if (i == 4) return Color.FromRgb((byte) t, (byte) p, (byte) b);
if (i == 5) return Color.FromRgb((byte) b, (byte) p, (byte) q);
throw new Exception("Invalid HSB values");
switch (i)
{
case 0:
return Color.FromRgb((byte) b, (byte) t, (byte) p);
case 1:
return Color.FromRgb((byte) q, (byte) b, (byte) p);
case 2:
return Color.FromRgb((byte) p, (byte) b, (byte) t);
case 3:
return Color.FromRgb((byte) p, (byte) q, (byte) b);
case 4:
return Color.FromRgb((byte) t, (byte) p, (byte) b);
case 5:
return Color.FromRgb((byte) b, (byte) p, (byte) q);
default:
throw new Exception("Invalid HSB values");
}
}
public static Hsb ToHsb(this Color color) {
public static Hsb ToHsb(this Color color)
{
double r = color.R;
double g = color.G;
double b = color.B;
@@ -53,10 +66,12 @@ namespace Material.Colors.ColorManipulation {
var d = max - min;
var s = max.IsCloseTo(0) ? 0 : d / max;
if (max.IsCloseTo(min)) {
if (max.IsCloseTo(min))
{
h = 0; // achromatic
}
else {
else
{
if (max.IsCloseTo(r))
h = (g - b) / d + (g < b ? 6 : 0);
else if (max.IsCloseTo(g))
@@ -69,7 +84,8 @@ namespace Material.Colors.ColorManipulation {
return new Hsb(h, s, v);
}
private static bool IsCloseTo(this double value, double target, double tolerance = double.Epsilon) {
private static bool IsCloseTo(this double value, double target, double tolerance = double.Epsilon)
{
return Math.Abs(value - target) < tolerance;
}
}
+6 -3
View File
@@ -1,10 +1,13 @@
namespace Material.Colors.ColorManipulation {
internal struct Hsl {
namespace Material.Colors.ColorManipulation
{
internal struct Hsl
{
public double H { get; }
public double S { get; }
public double L { get; }
public Hsl(double h, double s, double l) {
public Hsl(double h, double s, double l)
{
H = h;
S = s;
L = l;
@@ -1,10 +1,14 @@
using System;
using Avalonia.Media;
namespace Material.Colors.ColorManipulation {
internal static class HslConverter {
public static Color ToColor(this Hsl hsl) {
double HsvRbg(double v1, double v2, double vH) {
namespace Material.Colors.ColorManipulation
{
internal static class HslConverter
{
public static Color ToColor(this Hsl hsl)
{
double HsvRbg(double v1, double v2, double vH)
{
if (vH < 0) vH += 1;
if (vH > 1) vH -= 1;
if (6 * vH < 1) return v1 + (v2 - v1) * 6 * vH;
@@ -18,12 +22,14 @@ namespace Material.Colors.ColorManipulation {
var l = hsl.L * (1.0 / 100);
double r, g, b;
if (s == 0) {
if (s == 0)
{
r = l * 255;
g = l * 255;
b = l * 255;
}
else {
else
{
double var2;
if (l < 0.5) var2 = l * (1 + s);
else var2 = l + s - s * l;
+8 -4
View File
@@ -1,19 +1,23 @@
using System;
namespace Material.Colors.ColorManipulation {
internal struct Lab {
namespace Material.Colors.ColorManipulation
{
internal struct Lab
{
public double L { get; }
public double A { get; }
public double B { get; }
public Lab(double l, double a, double b) {
public Lab(double l, double a, double b)
{
L = l;
A = a;
B = b;
}
}
internal class LabConstants {
internal class LabConstants
{
public const double Kn = 18;
public const double WhitePointX = 0.95047;
@@ -1,15 +1,20 @@
using System;
using Avalonia.Media;
namespace Material.Colors.ColorManipulation {
internal static class LabConverter {
public static Lab ToLab(this Color c) {
namespace Material.Colors.ColorManipulation
{
internal static class LabConverter
{
public static Lab ToLab(this Color c)
{
var xyz = c.ToXyz();
return xyz.ToLab();
}
public static Lab ToLab(this Xyz xyz) {
double XyzLab(double v) {
public static Lab ToLab(this Xyz xyz)
{
double XyzLab(double v)
{
if (v > LabConstants.E)
return Math.Pow(v, 1 / 3.0);
return (v * LabConstants.K + 16) / 116;
@@ -25,7 +30,8 @@ namespace Material.Colors.ColorManipulation {
return new Lab(l, a, b);
}
public static Color ToColor(this Lab lab) {
public static Color ToColor(this Lab lab)
{
var xyz = lab.ToXyz();
return xyz.ToColor();
+6 -3
View File
@@ -1,10 +1,13 @@
namespace Material.Colors.ColorManipulation {
internal struct Xyz {
namespace Material.Colors.ColorManipulation
{
internal struct Xyz
{
public double X { get; }
public double Y { get; }
public double Z { get; }
public Xyz(double x, double y, double z) {
public Xyz(double x, double y, double z)
{
X = x;
Y = y;
Z = z;
@@ -1,16 +1,21 @@
using System;
using Avalonia.Media;
namespace Material.Colors.ColorManipulation {
internal static class XyzConverter {
public static Color ToColor(this Xyz xyz) {
double XyzRgb(double d) {
namespace Material.Colors.ColorManipulation
{
internal static class XyzConverter
{
public static Color ToColor(this Xyz xyz)
{
double XyzRgb(double d)
{
if (d > 0.0031308)
return 255.0 * (1.055 * Math.Pow(d, 1.0 / 2.4) - 0.055);
return 255.0 * (12.92 * d);
}
byte Clip(double d) {
byte Clip(double d)
{
if (d < 0) return 0;
if (d > 255) return 255;
return (byte) Math.Round(d);
@@ -23,8 +28,10 @@ namespace Material.Colors.ColorManipulation {
return Color.FromRgb(Clip(r), Clip(g), Clip(b));
}
public static Xyz ToXyz(this Color c) {
double RgbXyz(double v) {
public static Xyz ToXyz(this Color c)
{
double RgbXyz(double v)
{
v /= 255;
if (v > 0.04045)
return Math.Pow((v + 0.055) / 1.055, 2.4);
@@ -41,8 +48,10 @@ namespace Material.Colors.ColorManipulation {
return new Xyz(x, y, z);
}
public static Xyz ToXyz(this Lab lab) {
double LabXyz(double d) {
public static Xyz ToXyz(this Lab lab)
{
double LabXyz(double d)
{
if (d > LabConstants.ECubedRoot)
return d * d * d;
return (116 * d - 16) / LabConstants.K;
+13 -12
View File
@@ -1,32 +1,33 @@
using Avalonia.Media;
using Material.Colors.ColorManipulation;
namespace Material.Colors {
public struct ColorPair {
public Color Color { get; set; }
namespace Material.Colors
{
public struct ColorPair
{
public Color Color { get; }
/// <summary>
/// The foreground or opposite color. If left null, this will be calculated for you.
/// Calculated by calling ColorHelper.ContrastingForegroundColor()
/// </summary>
public Color? ForegroundColor { get; set; }
public Color ForegroundColor { get; }
public static implicit operator ColorPair(Color color) {
public static implicit operator ColorPair(Color color)
{
return new ColorPair(color);
}
public ColorPair(Color color) {
public ColorPair(Color color)
{
Color = color;
ForegroundColor = null;
ForegroundColor = color.PickContrastColor(4.5);
}
public ColorPair(Color color, Color? foreground) {
public ColorPair(Color color, Color foreground)
{
Color = color;
ForegroundColor = foreground;
}
public Color GetForegroundColor() {
return ForegroundColor ?? Color.ContrastingForegroundColor();
}
}
}
+4 -2
View File
@@ -1,8 +1,10 @@
using System.Collections.Generic;
using Avalonia.Media;
namespace Material.Colors {
public interface ISwatch {
namespace Material.Colors
{
public interface ISwatch
{
string Name { get; }
IEnumerable<Color> Hues { get; }
IDictionary<MaterialColor, Color> Lookup { get; }
+1 -1
View File
@@ -17,6 +17,6 @@
</ItemGroup>
<ItemGroup>
<PackageReference Include="Avalonia" Version="0.10.11" />
<PackageReference Include="Avalonia" Version="0.10.13" />
</ItemGroup>
</Project>
+8 -4
View File
@@ -1,5 +1,7 @@
namespace Material.Colors {
public enum PrimaryColor {
namespace Material.Colors
{
public enum PrimaryColor
{
Red = MaterialColor.Red500,
Pink = MaterialColor.Pink500,
Purple = MaterialColor.Purple500,
@@ -21,7 +23,8 @@
BlueGrey = MaterialColor.BlueGrey500
}
public enum SecondaryColor {
public enum SecondaryColor
{
Red = MaterialColor.RedSecondary,
Pink = MaterialColor.PinkSecondary,
Purple = MaterialColor.PurpleSecondary,
@@ -40,7 +43,8 @@
DeepOrange = MaterialColor.DeepOrangeSecondary
}
public enum MaterialColor {
public enum MaterialColor
{
Red50,
Red100,
Red200,
+6 -3
View File
@@ -1,8 +1,10 @@
using System.Collections.Generic;
using Avalonia.Media;
namespace Material.Colors.Recommended {
public class AmberSwatch : ISwatch {
namespace Material.Colors.Recommended
{
public class AmberSwatch : ISwatch
{
public static Color Amber50 { get; } = Color.Parse("#FFF8E1");
public static Color Amber100 { get; } = Color.Parse("#FFECB3");
public static Color Amber200 { get; } = Color.Parse("#FFE082");
@@ -20,7 +22,8 @@ namespace Material.Colors.Recommended {
public string Name { get; } = "Amber";
public IDictionary<MaterialColor, Color> Lookup { get; } = new Dictionary<MaterialColor, Color> {
public IDictionary<MaterialColor, Color> Lookup { get; } = new Dictionary<MaterialColor, Color>
{
{MaterialColor.Amber50, Amber50},
{MaterialColor.Amber100, Amber100},
{MaterialColor.Amber200, Amber200},
@@ -1,8 +1,10 @@
using System.Collections.Generic;
using Avalonia.Media;
namespace Material.Colors.Recommended {
public class BlueGreySwatch : ISwatch {
namespace Material.Colors.Recommended
{
public class BlueGreySwatch : ISwatch
{
public static Color BlueGrey50 { get; } = Color.Parse("#ECEFF1");
public static Color BlueGrey100 { get; } = Color.Parse("#CFD8DC");
public static Color BlueGrey200 { get; } = Color.Parse("#B0BEC5");
@@ -16,7 +18,8 @@ namespace Material.Colors.Recommended {
public string Name { get; } = "Blue Grey";
public IDictionary<MaterialColor, Color> Lookup { get; } = new Dictionary<MaterialColor, Color> {
public IDictionary<MaterialColor, Color> Lookup { get; } = new Dictionary<MaterialColor, Color>
{
{MaterialColor.BlueGrey50, BlueGrey50},
{MaterialColor.BlueGrey100, BlueGrey100},
{MaterialColor.BlueGrey200, BlueGrey200},
+6 -3
View File
@@ -1,8 +1,10 @@
using System.Collections.Generic;
using Avalonia.Media;
namespace Material.Colors.Recommended {
public class BlueSwatch : ISwatch {
namespace Material.Colors.Recommended
{
public class BlueSwatch : ISwatch
{
public static Color Blue50 { get; } = Color.Parse("#E3F2FD");
public static Color Blue100 { get; } = Color.Parse("#BBDEFB");
public static Color Blue200 { get; } = Color.Parse("#90CAF9");
@@ -20,7 +22,8 @@ namespace Material.Colors.Recommended {
public string Name { get; } = "Blue";
public IDictionary<MaterialColor, Color> Lookup { get; } = new Dictionary<MaterialColor, Color> {
public IDictionary<MaterialColor, Color> Lookup { get; } = new Dictionary<MaterialColor, Color>
{
{MaterialColor.Blue50, Blue50},
{MaterialColor.Blue100, Blue100},
{MaterialColor.Blue200, Blue200},
+6 -3
View File
@@ -1,8 +1,10 @@
using System.Collections.Generic;
using Avalonia.Media;
namespace Material.Colors.Recommended {
public class BrownSwatch : ISwatch {
namespace Material.Colors.Recommended
{
public class BrownSwatch : ISwatch
{
public static Color Brown50 { get; } = Color.Parse("#EFEBE9");
public static Color Brown100 { get; } = Color.Parse("#D7CCC8");
public static Color Brown200 { get; } = Color.Parse("#BCAAA4");
@@ -16,7 +18,8 @@ namespace Material.Colors.Recommended {
public string Name { get; } = "Brown";
public IDictionary<MaterialColor, Color> Lookup { get; } = new Dictionary<MaterialColor, Color> {
public IDictionary<MaterialColor, Color> Lookup { get; } = new Dictionary<MaterialColor, Color>
{
{MaterialColor.Brown50, Brown50},
{MaterialColor.Brown100, Brown100},
{MaterialColor.Brown200, Brown200},
+6 -3
View File
@@ -1,8 +1,10 @@
using System.Collections.Generic;
using Avalonia.Media;
namespace Material.Colors.Recommended {
public class CyanSwatch : ISwatch {
namespace Material.Colors.Recommended
{
public class CyanSwatch : ISwatch
{
public static Color Cyan50 { get; } = Color.Parse("#E0F7FA");
public static Color Cyan100 { get; } = Color.Parse("#B2EBF2");
public static Color Cyan200 { get; } = Color.Parse("#80DEEA");
@@ -20,7 +22,8 @@ namespace Material.Colors.Recommended {
public string Name { get; } = "Cyan";
public IDictionary<MaterialColor, Color> Lookup { get; } = new Dictionary<MaterialColor, Color> {
public IDictionary<MaterialColor, Color> Lookup { get; } = new Dictionary<MaterialColor, Color>
{
{MaterialColor.Cyan50, Cyan50},
{MaterialColor.Cyan100, Cyan100},
{MaterialColor.Cyan200, Cyan200},
@@ -1,8 +1,10 @@
using System.Collections.Generic;
using Avalonia.Media;
namespace Material.Colors.Recommended {
public class DeepOrangeSwatch : ISwatch {
namespace Material.Colors.Recommended
{
public class DeepOrangeSwatch : ISwatch
{
public static Color DeepOrange50 { get; } = Color.Parse("#FBE9E7");
public static Color DeepOrange100 { get; } = Color.Parse("#FFCCBC");
public static Color DeepOrange200 { get; } = Color.Parse("#FFAB91");
@@ -20,7 +22,8 @@ namespace Material.Colors.Recommended {
public string Name { get; } = "Deep Orange";
public IDictionary<MaterialColor, Color> Lookup { get; } = new Dictionary<MaterialColor, Color> {
public IDictionary<MaterialColor, Color> Lookup { get; } = new Dictionary<MaterialColor, Color>
{
{MaterialColor.DeepOrange50, DeepOrange50},
{MaterialColor.DeepOrange100, DeepOrange100},
{MaterialColor.DeepOrange200, DeepOrange200},
@@ -1,8 +1,10 @@
using System.Collections.Generic;
using Avalonia.Media;
namespace Material.Colors.Recommended {
public class DeepPurpleSwatch : ISwatch {
namespace Material.Colors.Recommended
{
public class DeepPurpleSwatch : ISwatch
{
public static Color DeepPurple50 { get; } = Color.Parse("#EDE7F6");
public static Color DeepPurple100 { get; } = Color.Parse("#D1C4E9");
public static Color DeepPurple200 { get; } = Color.Parse("#B39DDB");
@@ -20,7 +22,8 @@ namespace Material.Colors.Recommended {
public string Name { get; } = "Deep Purple";
public IDictionary<MaterialColor, Color> Lookup { get; } = new Dictionary<MaterialColor, Color> {
public IDictionary<MaterialColor, Color> Lookup { get; } = new Dictionary<MaterialColor, Color>
{
{MaterialColor.DeepPurple50, DeepPurple50},
{MaterialColor.DeepPurple100, DeepPurple100},
{MaterialColor.DeepPurple200, DeepPurple200},
+6 -3
View File
@@ -1,8 +1,10 @@
using System.Collections.Generic;
using Avalonia.Media;
namespace Material.Colors.Recommended {
public class GreenSwatch : ISwatch {
namespace Material.Colors.Recommended
{
public class GreenSwatch : ISwatch
{
public static Color Green50 { get; } = Color.Parse("#E8F5E9");
public static Color Green100 { get; } = Color.Parse("#C8E6C9");
public static Color Green200 { get; } = Color.Parse("#A5D6A7");
@@ -20,7 +22,8 @@ namespace Material.Colors.Recommended {
public string Name { get; } = "Green";
public IDictionary<MaterialColor, Color> Lookup { get; } = new Dictionary<MaterialColor, Color> {
public IDictionary<MaterialColor, Color> Lookup { get; } = new Dictionary<MaterialColor, Color>
{
{MaterialColor.Green50, Green50},
{MaterialColor.Green100, Green100},
{MaterialColor.Green200, Green200},
+6 -3
View File
@@ -1,8 +1,10 @@
using System.Collections.Generic;
using Avalonia.Media;
namespace Material.Colors.Recommended {
public class GreySwatch : ISwatch {
namespace Material.Colors.Recommended
{
public class GreySwatch : ISwatch
{
public static Color Grey50 { get; } = Color.Parse("#FAFAFA");
public static Color Grey100 { get; } = Color.Parse("#F5F5F5");
public static Color Grey200 { get; } = Color.Parse("#EEEEEE");
@@ -16,7 +18,8 @@ namespace Material.Colors.Recommended {
public string Name { get; } = "Grey";
public IDictionary<MaterialColor, Color> Lookup { get; } = new Dictionary<MaterialColor, Color> {
public IDictionary<MaterialColor, Color> Lookup { get; } = new Dictionary<MaterialColor, Color>
{
{MaterialColor.Grey50, Grey50},
{MaterialColor.Grey100, Grey100},
{MaterialColor.Grey200, Grey200},
+6 -3
View File
@@ -1,8 +1,10 @@
using System.Collections.Generic;
using Avalonia.Media;
namespace Material.Colors.Recommended {
public class IndigoSwatch : ISwatch {
namespace Material.Colors.Recommended
{
public class IndigoSwatch : ISwatch
{
public static Color Indigo50 { get; } = Color.Parse("#E8EAF6");
public static Color Indigo100 { get; } = Color.Parse("#C5CAE9");
public static Color Indigo200 { get; } = Color.Parse("#9FA8DA");
@@ -20,7 +22,8 @@ namespace Material.Colors.Recommended {
public string Name { get; } = "Indigo";
public IDictionary<MaterialColor, Color> Lookup { get; } = new Dictionary<MaterialColor, Color> {
public IDictionary<MaterialColor, Color> Lookup { get; } = new Dictionary<MaterialColor, Color>
{
{MaterialColor.Indigo50, Indigo50},
{MaterialColor.Indigo100, Indigo100},
{MaterialColor.Indigo200, Indigo200},
@@ -1,8 +1,10 @@
using System.Collections.Generic;
using Avalonia.Media;
namespace Material.Colors.Recommended {
public class LightBlueSwatch : ISwatch {
namespace Material.Colors.Recommended
{
public class LightBlueSwatch : ISwatch
{
public static Color LightBlue50 { get; } = Color.Parse("#E1F5FE");
public static Color LightBlue100 { get; } = Color.Parse("#B3E5FC");
public static Color LightBlue200 { get; } = Color.Parse("#81D4FA");
@@ -20,7 +22,8 @@ namespace Material.Colors.Recommended {
public string Name { get; } = "Light Blue";
public IDictionary<MaterialColor, Color> Lookup { get; } = new Dictionary<MaterialColor, Color> {
public IDictionary<MaterialColor, Color> Lookup { get; } = new Dictionary<MaterialColor, Color>
{
{MaterialColor.LightBlue50, LightBlue50},
{MaterialColor.LightBlue100, LightBlue100},
{MaterialColor.LightBlue200, LightBlue200},
@@ -1,8 +1,10 @@
using System.Collections.Generic;
using Avalonia.Media;
namespace Material.Colors.Recommended {
public class LightGreenSwatch : ISwatch {
namespace Material.Colors.Recommended
{
public class LightGreenSwatch : ISwatch
{
public static Color LightGreen50 { get; } = Color.Parse("#F1F8E9");
public static Color LightGreen100 { get; } = Color.Parse("#DCEDC8");
public static Color LightGreen200 { get; } = Color.Parse("#C5E1A5");
@@ -20,7 +22,8 @@ namespace Material.Colors.Recommended {
public string Name { get; } = "Light Green";
public IDictionary<MaterialColor, Color> Lookup { get; } = new Dictionary<MaterialColor, Color> {
public IDictionary<MaterialColor, Color> Lookup { get; } = new Dictionary<MaterialColor, Color>
{
{MaterialColor.LightGreen50, LightGreen50},
{MaterialColor.LightGreen100, LightGreen100},
{MaterialColor.LightGreen200, LightGreen200},
+6 -3
View File
@@ -1,8 +1,10 @@
using System.Collections.Generic;
using Avalonia.Media;
namespace Material.Colors.Recommended {
public class LimeSwatch : ISwatch {
namespace Material.Colors.Recommended
{
public class LimeSwatch : ISwatch
{
public static Color Lime50 { get; } = Color.Parse("#F9FBE7");
public static Color Lime100 { get; } = Color.Parse("#F0F4C3");
public static Color Lime200 { get; } = Color.Parse("#E6EE9C");
@@ -20,7 +22,8 @@ namespace Material.Colors.Recommended {
public string Name { get; } = "Lime";
public IDictionary<MaterialColor, Color> Lookup { get; } = new Dictionary<MaterialColor, Color> {
public IDictionary<MaterialColor, Color> Lookup { get; } = new Dictionary<MaterialColor, Color>
{
{MaterialColor.Lime50, Lime50},
{MaterialColor.Lime100, Lime100},
{MaterialColor.Lime200, Lime200},
+6 -3
View File
@@ -1,8 +1,10 @@
using System.Collections.Generic;
using Avalonia.Media;
namespace Material.Colors.Recommended {
public class OrangeSwatch : ISwatch {
namespace Material.Colors.Recommended
{
public class OrangeSwatch : ISwatch
{
public static Color Orange50 { get; } = Color.Parse("#FFF3E0");
public static Color Orange100 { get; } = Color.Parse("#FFE0B2");
public static Color Orange200 { get; } = Color.Parse("#FFCC80");
@@ -20,7 +22,8 @@ namespace Material.Colors.Recommended {
public string Name { get; } = "Orange";
public IDictionary<MaterialColor, Color> Lookup { get; } = new Dictionary<MaterialColor, Color> {
public IDictionary<MaterialColor, Color> Lookup { get; } = new Dictionary<MaterialColor, Color>
{
{MaterialColor.Orange50, Orange50},
{MaterialColor.Orange100, Orange100},
{MaterialColor.Orange200, Orange200},
+6 -3
View File
@@ -1,8 +1,10 @@
using System.Collections.Generic;
using Avalonia.Media;
namespace Material.Colors.Recommended {
public class PinkSwatch : ISwatch {
namespace Material.Colors.Recommended
{
public class PinkSwatch : ISwatch
{
public static Color Pink50 { get; } = Color.Parse("#FCE4EC");
public static Color Pink100 { get; } = Color.Parse("#F8BBD0");
public static Color Pink200 { get; } = Color.Parse("#F48FB1");
@@ -20,7 +22,8 @@ namespace Material.Colors.Recommended {
public string Name { get; } = "Pink";
public IDictionary<MaterialColor, Color> Lookup { get; } = new Dictionary<MaterialColor, Color> {
public IDictionary<MaterialColor, Color> Lookup { get; } = new Dictionary<MaterialColor, Color>
{
{MaterialColor.Pink50, Pink50},
{MaterialColor.Pink100, Pink100},
{MaterialColor.Pink200, Pink200},
+6 -3
View File
@@ -1,8 +1,10 @@
using System.Collections.Generic;
using Avalonia.Media;
namespace Material.Colors.Recommended {
public class PurpleSwatch : ISwatch {
namespace Material.Colors.Recommended
{
public class PurpleSwatch : ISwatch
{
public static Color Purple50 { get; } = Color.Parse("#F3E5F5");
public static Color Purple100 { get; } = Color.Parse("#E1BEE7");
public static Color Purple200 { get; } = Color.Parse("#CE93D8");
@@ -20,7 +22,8 @@ namespace Material.Colors.Recommended {
public string Name { get; } = "Purple";
public IDictionary<MaterialColor, Color> Lookup { get; } = new Dictionary<MaterialColor, Color> {
public IDictionary<MaterialColor, Color> Lookup { get; } = new Dictionary<MaterialColor, Color>
{
{MaterialColor.Purple50, Purple50},
{MaterialColor.Purple100, Purple100},
{MaterialColor.Purple200, Purple200},
+6 -3
View File
@@ -1,8 +1,10 @@
using System.Collections.Generic;
using Avalonia.Media;
namespace Material.Colors.Recommended {
public class RedSwatch : ISwatch {
namespace Material.Colors.Recommended
{
public class RedSwatch : ISwatch
{
public static Color Red50 { get; } = Color.Parse("#FFEBEE");
public static Color Red100 { get; } = Color.Parse("#FFCDD2");
public static Color Red200 { get; } = Color.Parse("#EF9A9A");
@@ -20,7 +22,8 @@ namespace Material.Colors.Recommended {
public string Name { get; } = "Red";
public IDictionary<MaterialColor, Color> Lookup { get; } = new Dictionary<MaterialColor, Color> {
public IDictionary<MaterialColor, Color> Lookup { get; } = new Dictionary<MaterialColor, Color>
{
{MaterialColor.Red50, Red50},
{MaterialColor.Red100, Red100},
{MaterialColor.Red200, Red200},
+6 -3
View File
@@ -1,8 +1,10 @@
using System.Collections.Generic;
using Avalonia.Media;
namespace Material.Colors.Recommended {
public class TealSwatch : ISwatch {
namespace Material.Colors.Recommended
{
public class TealSwatch : ISwatch
{
public static Color Teal50 { get; } = Color.Parse("#E0F2F1");
public static Color Teal100 { get; } = Color.Parse("#B2DFDB");
public static Color Teal200 { get; } = Color.Parse("#80CBC4");
@@ -20,7 +22,8 @@ namespace Material.Colors.Recommended {
public string Name { get; } = "Teal";
public IDictionary<MaterialColor, Color> Lookup { get; } = new Dictionary<MaterialColor, Color> {
public IDictionary<MaterialColor, Color> Lookup { get; } = new Dictionary<MaterialColor, Color>
{
{MaterialColor.Teal50, Teal50},
{MaterialColor.Teal100, Teal100},
{MaterialColor.Teal200, Teal200},
+6 -3
View File
@@ -1,8 +1,10 @@
using System.Collections.Generic;
using Avalonia.Media;
namespace Material.Colors.Recommended {
public class YellowSwatch : ISwatch {
namespace Material.Colors.Recommended
{
public class YellowSwatch : ISwatch
{
public static Color Yellow50 { get; } = Color.Parse("#FFFDE7");
public static Color Yellow100 { get; } = Color.Parse("#FFF9C4");
public static Color Yellow200 { get; } = Color.Parse("#FFF59D");
@@ -20,7 +22,8 @@ namespace Material.Colors.Recommended {
public string Name { get; } = "Yellow";
public IDictionary<MaterialColor, Color> Lookup { get; } = new Dictionary<MaterialColor, Color> {
public IDictionary<MaterialColor, Color> Lookup { get; } = new Dictionary<MaterialColor, Color>
{
{MaterialColor.Yellow50, Yellow50},
{MaterialColor.Yellow100, Yellow100},
{MaterialColor.Yellow200, Yellow200},
+8 -4
View File
@@ -3,9 +3,12 @@ using System.Linq;
using Avalonia.Media;
using Material.Colors.Recommended;
namespace Material.Colors {
public static class SwatchHelper {
public static IEnumerable<ISwatch> Swatches { get; } = new ISwatch[] {
namespace Material.Colors
{
public static class SwatchHelper
{
public static IEnumerable<ISwatch> Swatches { get; } = new ISwatch[]
{
new RedSwatch(),
new PinkSwatch(),
new PurpleSwatch(),
@@ -27,6 +30,7 @@ namespace Material.Colors {
new BlueGreySwatch()
};
public static IDictionary<MaterialColor, Color> Lookup { get; } = Swatches.SelectMany(o => o.Lookup).ToDictionary(o => o.Key, o => o.Value);
public static IDictionary<MaterialColor, Color> Lookup { get; } =
Swatches.SelectMany(o => o.Lookup).ToDictionary(o => o.Key, o => o.Value);
}
}
+2 -2
View File
@@ -21,8 +21,8 @@
</ItemGroup>
<ItemGroup>
<PackageReference Include="Avalonia" Version="0.10.11" />
<PackageReference Include="Avalonia.Controls.DataGrid" Version="0.10.11" />
<PackageReference Include="Avalonia" Version="0.10.13" />
<PackageReference Include="Avalonia.Controls.DataGrid" Version="0.10.13" />
</ItemGroup>
<ItemGroup>
+4 -1
View File
@@ -5,11 +5,14 @@
x:Class="Material.Demo.App">
<Application.Styles>
<StyleInclude Source="avares://Avalonia.Themes.Default/DefaultTheme.xaml" />
<themes:MaterialTheme BaseTheme="Light" PrimaryColor="Purple" SecondaryColor="Lime" />
<themes:MaterialTheme BaseTheme="Light"
PrimaryColor="Purple"
SecondaryColor="Indigo" />
<StyleInclude Source="avares://Material.Icons.Avalonia/App.xaml" />
<StyleInclude Source="avares://Material.DataGrid/DataGrid.xaml" />
<StyleInclude Source="avares://ShowMeTheXaml.Avalonia/XamlDisplay.xaml" />
<StyleInclude Source="avares://Material.Demo/MaterialXamlDisplay.axaml" />
<StyleInclude Source="avares://DialogHost.Avalonia/Styles.xaml" />
<Style Selector="showMeTheXaml|XamlDisplay">
<Setter Property="ClipToBounds" Value="False"></Setter>
+6 -3
View File
@@ -1,9 +1,12 @@
using Avalonia;
using Avalonia.Markup.Xaml;
namespace Material.Demo {
public class App : Application {
public override void Initialize() {
namespace Material.Demo
{
public class App : Application
{
public override void Initialize()
{
AvaloniaXamlLoader.Load(this);
}
}
@@ -0,0 +1,27 @@
using System;
using System.Windows.Input;
using Avalonia;
using Avalonia.Controls;
namespace Material.Demo.Commands
{
public class TextBoxCopyAllTextCommand : ICommand
{
public bool CanExecute(object parameter)
{
return parameter is TextBox;
}
public void Execute(object parameter)
{
if (parameter is not TextBox textBox)
return;
Application.Current?
.Clipboard?
.SetTextAsync(textBox.Text);
}
public event EventHandler? CanExecuteChanged;
}
}
@@ -1,11 +1,9 @@
using Avalonia.Data.Converters;
using System;
using System.Collections.Generic;
using System;
using System.ComponentModel;
using System.Globalization;
using System.Linq;
using System.Reflection;
using System.Text;
using Avalonia.Data.Converters;
namespace Material.Demo.Converters
{
@@ -15,10 +13,10 @@ namespace Material.Demo.Converters
{
FieldInfo fieldInfo = enumObj.GetType().GetField(enumObj.ToString());
var descriptionAttr = fieldInfo
.GetCustomAttributes(false)
.OfType<DescriptionAttribute>()
.Cast<DescriptionAttribute>()
.SingleOrDefault();
.GetCustomAttributes(false)
.OfType<DescriptionAttribute>()
.Cast<DescriptionAttribute>()
.SingleOrDefault();
if (descriptionAttr == null)
{
return enumObj.ToString();
@@ -31,7 +29,7 @@ namespace Material.Demo.Converters
object IValueConverter.Convert(object value, Type targetType, object parameter, CultureInfo culture)
{
Enum myEnum = (Enum)value;
Enum myEnum = (Enum) value;
string description = GetEnumDescription(myEnum);
return description;
}
@@ -41,4 +39,4 @@ namespace Material.Demo.Converters
return string.Empty;
}
}
}
}
@@ -5,16 +5,20 @@ using System.Globalization;
using System.Linq;
using Avalonia.Data.Converters;
namespace Material.Demo.Converters {
public class StringJoinConverter : IValueConverter {
namespace Material.Demo.Converters
{
public class StringJoinConverter : IValueConverter
{
public string? Separator { get; set; }
public object? Convert(object? value, Type targetType, object? parameter, CultureInfo culture) {
public object? Convert(object? value, Type targetType, object? parameter, CultureInfo culture)
{
IEnumerable values = value as IEnumerable ?? Array.Empty<object>();
return string.Join(Separator ?? "", values.OfType<object>());
}
public object? ConvertBack(object? value, Type targetType, object? parameter, CultureInfo culture) {
public object? ConvertBack(object? value, Type targetType, object? parameter, CultureInfo culture)
{
throw new NotSupportedException();
}
}
+15 -12
View File
@@ -1,23 +1,27 @@
using Material.Colors;
using System.Diagnostics;
using Avalonia;
using Material.Styles.Themes;
using Material.Styles.Themes.Base;
using System.Diagnostics;
using System.Threading.Tasks;
using Avalonia;
using Avalonia.Controls;
namespace Material.Demo
{
public static class GlobalCommand {
private static readonly MaterialTheme MaterialThemeStyles = Application.Current!.LocateMaterialTheme<MaterialTheme>();
public static void UseMaterialUIDarkTheme() {
public static class GlobalCommand
{
private static readonly MaterialTheme MaterialThemeStyles =
Application.Current!.LocateMaterialTheme<MaterialTheme>();
public static void UseMaterialUIDarkTheme()
{
MaterialThemeStyles.BaseTheme = BaseThemeMode.Dark;
}
public static void UseMaterialUILightTheme() {
public static void UseMaterialUILightTheme()
{
MaterialThemeStyles.BaseTheme = BaseThemeMode.Light;
}
public static void OpenProjectRepoLink() => OpenBrowserForVisitSite("https://github.com/AvaloniaUtils/material.avalonia");
public static void OpenProjectRepoLink() =>
OpenBrowserForVisitSite("https://github.com/AvaloniaUtils/material.avalonia");
public static void OpenBrowserForVisitSite(string link)
{
@@ -29,6 +33,5 @@ namespace Material.Demo
};
Process.Start(param);
}
}
}
}
+36 -14
View File
@@ -3,10 +3,12 @@
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:styles="clr-namespace:Material.Styles;assembly=Material.Styles"
xmlns:pages="clr-namespace:Material.Demo.Pages"
xmlns:avalonia="clr-namespace:Material.Icons.Avalonia;assembly=Material.Icons.Avalonia"
xmlns:showMeTheXaml="clr-namespace:ShowMeTheXaml;assembly=ShowMeTheXaml.Avalonia"
xmlns:controls="clr-namespace:Material.Styles.Controls;assembly=Material.Styles"
xmlns:dialogHostAvalonia="clr-namespace:DialogHostAvalonia;assembly=DialogHost.Avalonia"
xmlns:models="clr-namespace:Material.Demo.Models"
mc:Ignorable="d" WindowStartupLocation="CenterScreen"
Width="1280" Height="720" MinWidth="720"
Title="Material.Demo">
@@ -28,22 +30,38 @@
<Setter Property="HorizontalAlignment" Value="Left" />
</Style>
</Window.Styles>
<dialogHostAvalonia:DialogHost Identifier="MainDialogHost" >
<dialogHostAvalonia:DialogHost.DialogContentTemplate>
<DataTemplate DataType="models:Sample2Model" >
<StackPanel>
<TextBlock TextAlignment="Center" >Your lucky number:</TextBlock>
<TextBlock Classes="Body1"
TextAlignment="Center"
Text="{Binding Number}" />
<Button Margin="0 8 0 0"
Command="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType=dialogHostAvalonia:DialogHost}, Path=CloseDialogCommand}" >
THANKS, CLOSE
</Button>
</StackPanel>
</DataTemplate>
</dialogHostAvalonia:DialogHost.DialogContentTemplate>
<styles:SnackbarHost HostName="Root" TemplateApplied="TemplatedControl_OnTemplateApplied">
<styles:NavigationDrawer Name="LeftDrawer"
<controls:SnackbarHost HostName="Root" TemplateApplied="TemplatedControl_OnTemplateApplied">
<controls:NavigationDrawer Name="LeftDrawer" Classes="permanent"
LeftDrawerOpened="{Binding ElementName=NavDrawerSwitch, Path=IsChecked, Mode=TwoWay}">
<styles:NavigationDrawer.LeftDrawerContent>
<controls:NavigationDrawer.LeftDrawerContent>
<ScrollViewer>
<StackPanel>
<styles:ColorZone Mode="Accent" Height="180">
<controls:ColorZone Mode="Accent" Height="180">
<StackPanel>
<Image Width="120" Height="120" HorizontalAlignment="Center" VerticalAlignment="Top"
Source="avares://Material.Demo/Assets/FavIcon_200x.png" Margin="0,0,0,-8" />
<TextBlock Classes="Headline6" Text="Material Design" HorizontalAlignment="Center" />
<TextBlock Classes="Subtitle1" Text="with AvaloniaUI" HorizontalAlignment="Center" />
</StackPanel>
</styles:ColorZone>
<ListBox Classes="Drawer" Name="DrawerList"
</controls:ColorZone>
<ListBox Classes="NoScroll" Name="DrawerList"
Focusable="{Binding ElementName=LeftDrawer, Path=LeftDrawerOpened}">
<ListBox.Styles>
<Style Selector="ListBoxItem">
@@ -76,9 +94,9 @@
</ListBox>
</StackPanel>
</ScrollViewer>
</styles:NavigationDrawer.LeftDrawerContent>
</controls:NavigationDrawer.LeftDrawerContent>
<DockPanel LastChildFill="true">
<styles:ColorZone Name="PART_AppBarContainer" VerticalAlignment="Top" HorizontalAlignment="Stretch"
<controls:ColorZone Name="PART_AppBarContainer" VerticalAlignment="Top" HorizontalAlignment="Stretch"
DockPanel.Dock="Top"
Height="56" Mode="PrimaryMid" ZIndex="1">
<Grid Margin="16">
@@ -90,7 +108,7 @@
<ColumnDefinition Width="Auto" />
</Grid.ColumnDefinitions>
<ToggleButton Name="NavDrawerSwitch"
Classes="Flat TransparentBack"
Foreground="{DynamicResource MaterialDesignBody}"
Width="32" Height="32" Padding="4">
<avalonia:MaterialIcon Kind="Menu" Width="24" Height="24" />
</ToggleButton>
@@ -116,7 +134,7 @@
</MenuItem>
</Menu>
</Grid>
</styles:ColorZone>
</controls:ColorZone>
<ScrollViewer Name="mainScroller"
DockPanel.Dock="Top"
HorizontalContentAlignment="Stretch"
@@ -127,7 +145,7 @@
<Carousel Name="PageCarousel"
HorizontalAlignment="Stretch">
<Carousel.Styles>
<Style Selector="Carousel#PageCarousel:not(.notransitions)">
<Style Selector="Carousel#PageCarousel:not(.no-transitions)">
<Setter Property="PageTransition">
<PageSlide Duration="0.25" SlideOutEasing="CircularEaseOut"
SlideInEasing="CircularEaseOut" />
@@ -197,6 +215,10 @@
</Border>
</ScrollViewer>
</DockPanel>
</styles:NavigationDrawer>
</styles:SnackbarHost>
</controls:NavigationDrawer>
</controls:SnackbarHost>
</dialogHostAvalonia:DialogHost>
</Window>
+27 -14
View File
@@ -1,33 +1,40 @@
using System;
using System.Collections.Generic;
using Avalonia;
using Avalonia.Controls;
using Avalonia.Controls;
using Avalonia.Controls.Primitives;
using Avalonia.Input;
using Avalonia.Interactivity;
using Avalonia.Markup.Xaml;
using Material.Styles;
using Material.Styles.Controls;
using Material.Styles.Models;
namespace Material.Demo {
public class MainWindow : Window {
namespace Material.Demo
{
public class MainWindow : Window
{
#region Control fields
private ToggleButton NavDrawerSwitch;
private ListBox DrawerList;
private Carousel PageCarousel;
private ScrollViewer mainScroller;
private NavigationDrawer LeftDrawer;
#endregion
public MainWindow() {
public MainWindow()
{
InitializeComponent();
this.AttachDevTools(KeyGesture.Parse("Shift+F12"));
}
private void InitializeComponent() {
private void InitializeComponent()
{
AvaloniaXamlLoader.Load(this);
#region Control getter and event binding
NavDrawerSwitch = this.Get<ToggleButton>(nameof(NavDrawerSwitch));
DrawerList = this.Get<ListBox>(nameof(DrawerList));
@@ -37,6 +44,9 @@ namespace Material.Demo {
PageCarousel = this.Get<Carousel>(nameof(PageCarousel));
mainScroller = this.Get<ScrollViewer>(nameof(mainScroller));
LeftDrawer = this.Get<NavigationDrawer>(nameof(LeftDrawer));
#endregion
}
@@ -46,23 +56,26 @@ namespace Material.Demo {
DrawerSelectionChanged(sender, null);
}
public void DrawerSelectionChanged(object sender, RoutedEventArgs args)
public void DrawerSelectionChanged(object sender, RoutedEventArgs? args)
{
var listBox = sender as ListBox;
if (sender is not ListBox listBox)
return;
if (!listBox.IsFocused && !listBox.IsKeyboardFocusWithin)
return;
try
{
{
PageCarousel.SelectedIndex = listBox.SelectedIndex;
mainScroller.Offset = Vector.Zero;
mainScroller.VerticalScrollBarVisibility =
listBox.SelectedIndex == 5 ? ScrollBarVisibility.Disabled : ScrollBarVisibility.Auto;
}
catch
{
// ignored
}
NavDrawerSwitch.IsChecked = false;
LeftDrawer.OptionalCloseLeftDrawer();
}
private void TemplatedControl_OnTemplateApplied(object? sender, TemplateAppliedEventArgs e)
@@ -70,7 +83,7 @@ namespace Material.Demo {
SnackbarHost.Post("Welcome to demo of Material.Avalonia!");
}
private List<SnackbarModel> helloSnackBars = new List<SnackbarModel>();
private readonly List<SnackbarModel> helloSnackBars = new();
private void HelloButtonMenuItem_OnClick(object? sender, RoutedEventArgs e)
{
@@ -85,7 +98,7 @@ namespace Material.Demo {
{
SnackbarHost.Remove(snackbarModel);
}
SnackbarHost.Post("See ya next time, user!");
}
}
+7 -20
View File
@@ -1,17 +1,18 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>WinExe</OutputType>
<TargetFramework>netcoreapp3.1</TargetFramework>
<TargetFramework>net5.0</TargetFramework>
<LangVersion>latest</LangVersion>
<Nullable>enable</Nullable>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Avalonia" Version="0.10.11" />
<PackageReference Include="Avalonia.Controls.DataGrid" Version="0.10.11" />
<PackageReference Include="Avalonia.Desktop" Version="0.10.11" />
<PackageReference Include="Avalonia.Diagnostics" Version="0.10.11" />
<PackageReference Include="Avalonia" Version="0.10.18" />
<PackageReference Include="Avalonia.Controls.DataGrid" Version="0.10.18" />
<PackageReference Include="Avalonia.Desktop" Version="0.10.18" />
<PackageReference Include="Avalonia.Diagnostics" Version="0.10.18" />
<PackageReference Include="Material.Icons.Avalonia" Version="1.0.2" />
<PackageReference Include="ShowMeTheXaml.Avalonia.Generator" Version="0.3.0" />
<PackageReference Include="ShowMeTheXaml.Avalonia.Generator" Version="1.1.0" />
<PackageReference Include="DialogHost.Avalonia" Version="0.6.0-rc1" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Material.Avalonia\Material.Avalonia.csproj" />
@@ -22,18 +23,4 @@
<ItemGroup>
<AvaloniaResource Include="Assets\**" />
</ItemGroup>
<ItemGroup>
<Compile Update="**\*.axaml.cs">
<DependentUpon>%(Filename)</DependentUpon>
</Compile>
<AvaloniaXaml Remove="**\*.axaml" />
<AvaloniaResource Include="**\*.axaml">
<SubType>Designer</SubType>
</AvaloniaResource>
<Compile Update="Pages\SideSheetDemo.axaml.cs">
<DependentUpon>SideSheetDemo.axaml</DependentUpon>
<SubType>Code</SubType>
</Compile>
</ItemGroup>
</Project>
+64 -32
View File
@@ -1,46 +1,78 @@
<Styles xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:showMeTheXaml="clr-namespace:ShowMeTheXaml;assembly=ShowMeTheXaml.Avalonia"
xmlns:styles="clr-namespace:Material.Styles;assembly=Material.Styles">
<Style Selector="showMeTheXaml|XamlDisplay">
<Setter Property="Template">
xmlns:assists="clr-namespace:Material.Styles.Assists;assembly=Material.Styles"
xmlns:commands="clr-namespace:Material.Demo.Commands" >
<Styles.Resources>
<commands:TextBoxCopyAllTextCommand x:Key="TextBoxCopyAllTextCommand"/>
</Styles.Resources>
<Style Selector="showMeTheXaml|XamlDisplay" >
<Setter Property="ClipToBounds" Value="False" />
<Setter Property="HorizontalAlignment" Value="Center" />
<Setter Property="VerticalAlignment" Value="Center" />
<Setter Property="Template" >
<ControlTemplate>
<Grid ColumnDefinitions="*, Auto">
<Grid.Resources>
<DockPanel>
<DockPanel.Resources>
<showMeTheXaml:AlignmentYConverter x:Key="AlignmentYConverter" />
</Grid.Resources>
<Border Grid.Column="0"
BorderThickness="4"
BorderBrush="{TemplateBinding Foreground}"
Opacity="0.5"
IsVisible="{Binding #XamlPopup.IsOpen}" />
<ContentPresenter Grid.Column="0" Margin="4"
Background="{TemplateBinding Background}"
BorderBrush="{TemplateBinding BorderBrush}"
BorderThickness="{TemplateBinding BorderThickness}"
Content="{TemplateBinding Content}"
Padding="{TemplateBinding Padding}" />
<Viewbox Name="SourceXamlButton" Grid.Column="1"
</DockPanel.Resources>
<Viewbox Name="SourceXamlButton"
Height="16" Width="16"
VerticalAlignment="{TemplateBinding XamlButtonAlignment, Converter={x:Static showMeTheXaml:AlignmentYConverter.Instance}}">
<Grid Background="Transparent">
DockPanel.Dock="Right"
VerticalAlignment="{TemplateBinding XamlButtonAlignment,
Converter={x:Static showMeTheXaml:AlignmentYConverter.Instance}}" >
<Panel Background="Transparent" >
<Path Fill="{TemplateBinding Foreground}"
Data="M12.89,3L14.85,3.4L11.11,21L9.15,20.6L12.89,3M19.59,12L16,8.41V5.58L22.42,12L16,18.41V15.58L19.59,12M1.58,12L8,5.58V8.41L4.41,12L8,15.58V18.41L1.58,12Z" />
</Grid>
</Panel>
</Viewbox>
<Popup Name="XamlPopup" Grid.Column="1" IsLightDismissEnabled="True">
<styles:Card>
<ScrollViewer MaxWidth="400" MaxHeight="400"
VerticalAlignment="Top"
Background="{TemplateBinding Background}"
HorizontalScrollBarVisibility="Disabled">
<TextBox ScrollViewer.HorizontalScrollBarVisibility="Disabled"
IsReadOnly="True" TextWrapping="Wrap"
<Popup Name="XamlPopup"
IsLightDismissEnabled="True" >
<Border CornerRadius="4"
Background="{DynamicResource MaterialDesignCardBackground}"
BorderBrush="{DynamicResource MaterialDesignBody}"
BorderThickness="2"
MaxWidth="800"
MinHeight="100"
MaxHeight="400"
Padding="8" >
<Grid RowDefinitions="*, 8, Auto" >
<TextBox Grid.Row="0"
Name="PART_TextBox"
IsReadOnly="True"
TextWrapping="Wrap"
HorizontalAlignment="Stretch"
VerticalAlignment="Stretch"
assists:TextFieldAssist.Hints="xaml code for this control"
Text="{TemplateBinding XamlText}" />
</ScrollViewer>
</styles:Card>
<Button Grid.Row="2"
Classes="flat"
Content="COPY XAML"
Command="{StaticResource TextBoxCopyAllTextCommand}"
CommandParameter="{Binding ElementName=PART_TextBox}"
HorizontalAlignment="Right" />
</Grid>
</Border>
</Popup>
</Grid>
<Panel DockPanel.Dock="Left" >
<Border BorderThickness="4"
BorderBrush="{TemplateBinding Foreground}"
Opacity="0.5"
IsVisible="{Binding #XamlPopup.IsOpen}"
CornerRadius="2" />
<ContentPresenter Margin="4"
Background="{TemplateBinding Background}"
BorderBrush="{TemplateBinding BorderBrush}"
BorderThickness="{TemplateBinding BorderThickness}"
Content="{TemplateBinding Content}"
Padding="{TemplateBinding Padding}" />
</Panel>
</DockPanel>
</ControlTemplate>
</Setter>
</Style>
+6 -10
View File
@@ -1,7 +1,4 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Text;
using System.ComponentModel;
namespace Material.Demo.Models
{
@@ -9,15 +6,14 @@ namespace Material.Demo.Models
{
Yes,
No,
[Description("N/A")]
NA,
[Description("Not Fully")]
NotFully
[Description("N/A")] NA,
[Description("Not Fully")] NotFully
}
public class FeatureStatusModels
{
public string FeatureName { get; internal set; }
public StatusEnum IsReady { get; internal set; }
public StatusEnum IsAnimated { get; internal set; }
public StatusEnum IsAnimated { get; internal set; }
}
}
}
+8 -6
View File
@@ -2,19 +2,21 @@ using System;
using System.Collections.Generic;
using System.Linq;
using Material.Icons;
using Material.Icons.Avalonia;
namespace Material.Demo.Models {
public class MaterialIconKindGroup {
public MaterialIconKindGroup(IEnumerable<string> kinds) {
namespace Material.Demo.Models
{
public class MaterialIconKindGroup
{
public MaterialIconKindGroup(IEnumerable<string> kinds)
{
if (kinds is null) throw new ArgumentNullException(nameof(kinds));
var allValues = kinds.ToList();
if (!allValues.Any()) throw new ArgumentException($"{nameof(kinds)} must contain at least one value");
Kind = allValues.First();
KindValue = Enum.Parse<MaterialIconKind>(Kind);
Aliases = allValues
.OrderBy(x => x, StringComparer.InvariantCultureIgnoreCase)
.ToArray();
.OrderBy(x => x, StringComparer.InvariantCultureIgnoreCase)
.ToArray();
}
public string Kind { get; }
+7 -3
View File
@@ -1,8 +1,12 @@
namespace Material.Demo.Models {
public class Sample2Model {
public Sample2Model(int number) {
namespace Material.Demo.Models
{
public class Sample2Model
{
public Sample2Model(int number)
{
Number = number;
}
public int Number { get; set; }
}
}
@@ -7,16 +7,17 @@
public string Header => _header;
public string ContentHeader { get; set; } = "What is Lorem Ipsum?";
public string ImportantInfos { get; set; } = "Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.";
public string ImportantInfos { get; set; } =
"Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.";
}
// Data context for SideSheet demo page
public class SideSheetDemoViewModel : ViewModelBase
{
private SideSheetData _information = new SideSheetData();
public SideSheetData Information => _information;
private bool _sideInfoOpened = false;
public bool SideInfoOpened
+34 -17
View File
@@ -7,9 +7,26 @@
xmlns:assist="clr-namespace:Material.Styles.Assists;assembly=Material.Styles"
xmlns:avalonia="clr-namespace:Material.Icons.Avalonia;assembly=Material.Icons.Avalonia"
xmlns:showMeTheXaml="clr-namespace:ShowMeTheXaml;assembly=ShowMeTheXaml.Avalonia"
xmlns:controls="clr-namespace:Material.Styles.Controls;assembly=Material.Styles"
x:Class="Material.Demo.Pages.ButtonsDemo">
<StackPanel Margin="16, 0">
<StackPanel.Styles>
<Style Selector="showMeTheXaml|XamlDisplay Button">
<Setter Property="IsEnabled"
Value="{Binding ElementName=IsEnabledCheckBox, Path=IsChecked}"/>
</Style>
<Style Selector="showMeTheXaml|XamlDisplay controls|FloatingButton">
<Setter Property="IsEnabled"
Value="{Binding ElementName=IsEnabledCheckBox, Path=IsChecked}"/>
</Style>
</StackPanel.Styles>
<TextBlock Classes="Headline4 Subheadline" Text="Buttons" />
<CheckBox Name="IsEnabledCheckBox"
Content="Buttons is enabled"
IsChecked="True"/>
<TextBlock Classes="Headline6 Subheadline2" Text="Regular buttons" />
<StackPanel Orientation="Horizontal">
<showMeTheXaml:XamlDisplay UniqueId="Buttons1">
@@ -27,7 +44,7 @@
<showMeTheXaml:XamlDisplay UniqueId="Buttons5">
<Button Content="Custom corner radius"
ToolTip.Tip='Regular button with customized corner radius (16dp).'
assist:ButtonAssist.CornerRadius="16" />
CornerRadius="16" />
</showMeTheXaml:XamlDisplay>
</StackPanel>
@@ -55,14 +72,14 @@
<showMeTheXaml:XamlDisplay UniqueId="OutlineButtons4">
<Button Classes="Outline" Content="Custom corner radius"
ToolTip.Tip='Outline button with customized corner radius (16dp).'
assist:ButtonAssist.CornerRadius="16" />
CornerRadius="16" />
</showMeTheXaml:XamlDisplay>
</StackPanel>
<TextBlock Classes="Headline6 Subheadline2" Text="Floating buttons with icon" />
<StackPanel Orientation="Horizontal">
<StackPanel.Styles>
<Style Selector="styles|FloatingButton">
<Style Selector="controls|FloatingButton">
<Setter Property="Content">
<Setter.Value>
<Template>
@@ -80,28 +97,28 @@
</Style>
</StackPanel.Styles>
<showMeTheXaml:XamlDisplay UniqueId="FloatingButtons0">
<styles:FloatingButton Classes="Light Mini" />
<controls:FloatingButton Classes="Light Mini" />
</showMeTheXaml:XamlDisplay>
<showMeTheXaml:XamlDisplay UniqueId="FloatingButtons1">
<styles:FloatingButton Classes="Mini" />
<controls:FloatingButton Classes="Mini" />
</showMeTheXaml:XamlDisplay>
<showMeTheXaml:XamlDisplay UniqueId="FloatingButtons2">
<styles:FloatingButton Classes="Dark Mini" />
<controls:FloatingButton Classes="Dark Mini" />
</showMeTheXaml:XamlDisplay>
<showMeTheXaml:XamlDisplay UniqueId="FloatingButtons3">
<styles:FloatingButton Classes="Accent Mini" />
<controls:FloatingButton Classes="Accent Mini" />
</showMeTheXaml:XamlDisplay>
<showMeTheXaml:XamlDisplay UniqueId="FloatingButtons4">
<styles:FloatingButton Classes="Light" />
<controls:FloatingButton Classes="Light" />
</showMeTheXaml:XamlDisplay>
<showMeTheXaml:XamlDisplay UniqueId="FloatingButtons5">
<styles:FloatingButton />
<controls:FloatingButton />
</showMeTheXaml:XamlDisplay>
<showMeTheXaml:XamlDisplay UniqueId="FloatingButtons6">
<styles:FloatingButton Classes="Dark" />
<controls:FloatingButton Classes="Dark" />
</showMeTheXaml:XamlDisplay>
<showMeTheXaml:XamlDisplay UniqueId="FloatingButtons7">
<styles:FloatingButton Classes="Accent" />
<controls:FloatingButton Classes="Accent" />
</showMeTheXaml:XamlDisplay>
</StackPanel>
@@ -111,7 +128,7 @@
<Style Selector="showMeTheXaml|XamlDisplay">
<Setter Property="Margin" Value="8" />
</Style>
<Style Selector="styles|FloatingButton[IsExtended=false]">
<Style Selector="controls|FloatingButton[IsExtended=false]">
<Setter Property="Content">
<Setter.Value>
<Template>
@@ -124,7 +141,7 @@
</Setter.Value>
</Setter>
</Style>
<Style Selector="styles|FloatingButton[IsExtended=true]">
<Style Selector="controls|FloatingButton[IsExtended=true]">
<Setter Property="Content">
<Setter.Value>
<Template>
@@ -143,16 +160,16 @@
</Style>
</StackPanel.Styles>
<showMeTheXaml:XamlDisplay UniqueId="ExpandedFloatingButton0">
<styles:FloatingButton Classes="Light" IsExtended="True" />
<controls:FloatingButton Classes="Light" IsExtended="True" />
</showMeTheXaml:XamlDisplay>
<showMeTheXaml:XamlDisplay UniqueId="ExpandedFloatingButton1">
<styles:FloatingButton IsExtended="True" />
<controls:FloatingButton IsExtended="True" />
</showMeTheXaml:XamlDisplay>
<showMeTheXaml:XamlDisplay UniqueId="ExpandedFloatingButton2">
<styles:FloatingButton Classes="Dark" IsExtended="True" />
<controls:FloatingButton Classes="Dark" IsExtended="True" />
</showMeTheXaml:XamlDisplay>
<showMeTheXaml:XamlDisplay UniqueId="ExpandedFloatingButton3">
<styles:FloatingButton Classes="Accent" IsExtended="{Binding ElementName=CheckBox1, Path=IsChecked}" />
<controls:FloatingButton Classes="Accent" IsExtended="{Binding ElementName=CheckBox1, Path=IsChecked}" />
</showMeTheXaml:XamlDisplay>
<CheckBox Name="CheckBox1" Content="IsExtended" Margin="16,8" />
</StackPanel>
+2 -3
View File
@@ -1,5 +1,4 @@
using Avalonia;
using Avalonia.Controls;
using Avalonia.Controls;
using Avalonia.Markup.Xaml;
namespace Material.Demo.Pages
@@ -16,4 +15,4 @@ namespace Material.Demo.Pages
AvaloniaXamlLoader.Load(this);
}
}
}
}
+34 -17
View File
@@ -5,39 +5,48 @@
mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450"
xmlns:styles="clr-namespace:Material.Styles;assembly=Material.Styles"
xmlns:showMeTheXaml="clr-namespace:ShowMeTheXaml;assembly=ShowMeTheXaml.Avalonia"
xmlns:system="clr-namespace:System;assembly=System.Runtime"
xmlns:controls="clr-namespace:Material.Styles.Controls;assembly=Material.Styles"
x:Class="Material.Demo.Pages.CardsDemo">
<UserControl.Resources>
<system:String x:Key="DemoText">
Greyhound divisively hello coldly wonderfully marginally far upon excluding.
</system:String>
<system:String x:Key="DemoText2">
It's time to get wear some warm suit to defeat cold!
</system:String>
</UserControl.Resources>
<StackPanel Margin="16, 0">
<TextBlock Classes="Headline4 Subheadline" Text="Cards" />
<WrapPanel HorizontalAlignment="Stretch">
<showMeTheXaml:XamlDisplay UniqueId="Cards0">
<styles:Card MinWidth="240" VerticalAlignment="Top">
<controls:Card MinWidth="240" VerticalAlignment="Top">
<StackPanel Margin="0,4">
<TextBlock Classes="Headline6" Text="Card title" />
<TextBlock Classes="Body2" Text="Secondary text" />
</StackPanel>
</styles:Card>
</controls:Card>
</showMeTheXaml:XamlDisplay>
<showMeTheXaml:XamlDisplay UniqueId="Cards1">
<styles:Card Width="240" VerticalAlignment="Top">
<controls:Card Width="240" VerticalAlignment="Top">
<StackPanel Margin="0,4">
<TextBlock Classes="Headline6" Text="Card title" />
<TextBlock Classes="Body2" Text="Secondary text" />
<TextBlock Margin="0,12,0,0" TextWrapping="Wrap">
Greyhound divisively hello coldly wonderfully marginally far upon excluding.
</TextBlock>
<TextBlock Margin="0,12,0,0" TextWrapping="Wrap"
Text="{StaticResource DemoText}"/>
</StackPanel>
</styles:Card>
</controls:Card>
</showMeTheXaml:XamlDisplay>
<showMeTheXaml:XamlDisplay UniqueId="Cards2">
<styles:Card Width="240" Padding="4" VerticalAlignment="Top">
<controls:Card Width="240" Padding="4" VerticalAlignment="Top">
<StackPanel>
<StackPanel Margin="8">
<TextBlock Classes="Headline6" Text="Card title" />
<TextBlock Classes="Body2" Text="Secondary text" />
<TextBlock Margin="0,12,0,0" TextWrapping="Wrap">
Greyhound divisively hello coldly wonderfully marginally far upon excluding.
</TextBlock>
<TextBlock Margin="0,12,0,0" TextWrapping="Wrap"
Text="{StaticResource DemoText}"/>
</StackPanel>
<StackPanel Orientation="Horizontal">
<Button Classes="Flat" Content="BUTTON 1" />
@@ -45,21 +54,29 @@
<Button Classes="Flat" Content="BUTTON 2" />
</StackPanel>
</StackPanel>
</styles:Card>
</controls:Card>
</showMeTheXaml:XamlDisplay>
<showMeTheXaml:XamlDisplay UniqueId="Cards3">
<styles:Card Width="240" Padding="0" VerticalAlignment="Top">
<controls:Card Width="240" Padding="0" VerticalAlignment="Top">
<StackPanel>
<Image Source="avares://Material.Demo/Assets/johannes-plenio-RwHv7LgeC7s-unsplash.jpg" />
<StackPanel Margin="16">
<TextBlock Classes="Headline6" Text="Autumn is come!" />
<TextBlock Margin="0,12,0,0" TextWrapping="Wrap">
It's time to get wear some warm suit to defeat cold!
</TextBlock>
<TextBlock Margin="0,12,0,0" TextWrapping="Wrap"
Text="{StaticResource DemoText2}"/>
</StackPanel>
</StackPanel>
</styles:Card>
</controls:Card>
</showMeTheXaml:XamlDisplay>
<controls:Card>
<controls:CircleClockPicker Height="240" Maximum="11" Minimum="0" StepFrequency="3" Value="0"
FirstLabelOverride="12"/>
</controls:Card>
<controls:Card>
<controls:CircleClockPicker Height="240" Maximum="59" Minimum="0" StepFrequency="5" Value="30"/>
</controls:Card>
</WrapPanel>
</StackPanel>
</UserControl>
+2 -3
View File
@@ -1,5 +1,4 @@
using Avalonia;
using Avalonia.Controls;
using Avalonia.Controls;
using Avalonia.Markup.Xaml;
namespace Material.Demo.Pages
@@ -16,4 +15,4 @@ namespace Material.Demo.Pages
AvaloniaXamlLoader.Load(this);
}
}
}
}
+23 -22
View File
@@ -6,6 +6,7 @@
xmlns:styles="clr-namespace:Material.Styles;assembly=Material.Styles"
xmlns:showMeTheXaml="clr-namespace:ShowMeTheXaml;assembly=ShowMeTheXaml.Avalonia"
xmlns:icons="clr-namespace:Material.Icons.Avalonia;assembly=Material.Icons.Avalonia"
xmlns:controls="clr-namespace:Material.Styles.Controls;assembly=Material.Styles"
x:Class="Material.Demo.Pages.ColorZonesDemo">
<StackPanel Margin="16, 0,16,32">
<StackPanel.Styles>
@@ -19,96 +20,96 @@
<StackPanel>
<TextBlock Classes="Headline6 Subheadline2" Text="Standard mode" />
<showMeTheXaml:XamlDisplay UniqueId="ColorZoneDemo1">
<styles:ColorZone Height="56" Padding="12">
<controls:ColorZone Height="56" Padding="12">
<Grid ColumnDefinitions="Auto,24,*">
<ToggleButton Grid.Column="0" Classes="Flat TransparentBack" Padding="4" Content="{icons:MaterialIconExt Menu}" />
<TextBlock Grid.Column="2" Classes="Headline6" VerticalAlignment="Center" Text="Material Design Demo"/>
</Grid>
</styles:ColorZone>
</controls:ColorZone>
</showMeTheXaml:XamlDisplay>
</StackPanel>
<StackPanel>
<TextBlock Classes="Headline6 Subheadline2" Text="Invent mode" />
<showMeTheXaml:XamlDisplay UniqueId="ColorZoneDemo2">
<styles:ColorZone Height="56" Padding="12" Mode="Inverted">
<controls:ColorZone Height="56" Padding="12" Mode="Inverted">
<Grid ColumnDefinitions="Auto,24,*">
<ToggleButton Grid.Column="0" Classes="Flat TransparentBack" Padding="4" Width="{Binding $self.Bounds.Height}" Content="{icons:MaterialIconExt Menu}" />
<TextBlock Grid.Column="2" Classes="Headline6" VerticalAlignment="Center" Text="Material Design Demo"/>
</Grid>
</styles:ColorZone>
</controls:ColorZone>
</showMeTheXaml:XamlDisplay>
</StackPanel>
<StackPanel>
<TextBlock Classes="Headline6 Subheadline2" Text="Dark mode" />
<showMeTheXaml:XamlDisplay UniqueId="ColorZoneDemo3">
<styles:ColorZone Height="56" Padding="12" Mode="Dark">
<controls:ColorZone Height="56" Padding="12" Mode="Dark">
<Grid ColumnDefinitions="Auto,24,*">
<ToggleButton Grid.Column="0" Classes="Flat TransparentBack" Padding="4" Width="{Binding $self.Bounds.Height}" Content="{icons:MaterialIconExt Menu}" />
<TextBlock Grid.Column="2" Classes="Headline6" VerticalAlignment="Center" Text="Material Design Demo"/>
</Grid>
</styles:ColorZone>
</controls:ColorZone>
</showMeTheXaml:XamlDisplay>
</StackPanel>
<StackPanel>
<TextBlock Classes="Headline6 Subheadline2" Text="Light mode" />
<showMeTheXaml:XamlDisplay UniqueId="ColorZoneDemo4">
<styles:ColorZone Height="56" Padding="12" Mode="Light">
<controls:ColorZone Height="56" Padding="12" Mode="Light">
<Grid ColumnDefinitions="Auto,24,*">
<ToggleButton Grid.Column="0" Classes="Flat TransparentBack" Padding="4" Width="{Binding $self.Bounds.Height}" Content="{icons:MaterialIconExt Menu}" />
<TextBlock Grid.Column="2" Classes="Headline6" VerticalAlignment="Center" Text="Material Design Demo"/>
</Grid>
</styles:ColorZone>
</controls:ColorZone>
</showMeTheXaml:XamlDisplay>
</StackPanel>
<StackPanel>
<TextBlock Classes="Headline6 Subheadline2" Text="Primary light color mode" />
<showMeTheXaml:XamlDisplay UniqueId="ColorZoneDemo5">
<styles:ColorZone Height="56" Padding="12" Mode="PrimaryLight">
<controls:ColorZone Height="56" Padding="12" Mode="PrimaryLight">
<Grid ColumnDefinitions="Auto,24,*">
<ToggleButton Grid.Column="0" Classes="Flat TransparentBack" Padding="4" Width="{Binding $self.Bounds.Height}" Content="{icons:MaterialIconExt Menu}" />
<TextBlock Grid.Column="2" Classes="Headline6" VerticalAlignment="Center" Text="Material Design Demo"/>
</Grid>
</styles:ColorZone>
</controls:ColorZone>
</showMeTheXaml:XamlDisplay>
</StackPanel>
<StackPanel>
<TextBlock Classes="Headline6 Subheadline2" Text="Primary medium color mode" />
<showMeTheXaml:XamlDisplay UniqueId="ColorZoneDemo6">
<styles:ColorZone Height="56" Padding="12" Mode="PrimaryMid">
<controls:ColorZone Height="56" Padding="12" Mode="PrimaryMid">
<Grid ColumnDefinitions="Auto,24,*">
<ToggleButton Grid.Column="0" Classes="Flat TransparentBack" Padding="4" Width="{Binding $self.Bounds.Height}" Content="{icons:MaterialIconExt Menu}" />
<TextBlock Grid.Column="2" Classes="Headline6" VerticalAlignment="Center" Text="Material Design Demo"/>
</Grid>
</styles:ColorZone>
</controls:ColorZone>
</showMeTheXaml:XamlDisplay>
</StackPanel>
<StackPanel>
<TextBlock Classes="Headline6 Subheadline2" Text="Primary dark color mode" />
<showMeTheXaml:XamlDisplay UniqueId="ColorZoneDemo7">
<styles:ColorZone Height="56" Padding="12" Mode="PrimaryDark">
<controls:ColorZone Height="56" Padding="12" Mode="PrimaryDark">
<Grid ColumnDefinitions="Auto,24,*">
<ToggleButton Grid.Column="0" Classes="Flat TransparentBack" Padding="4" Width="{Binding $self.Bounds.Height}" Content="{icons:MaterialIconExt Menu}" />
<TextBlock Grid.Column="2" Classes="Headline6" VerticalAlignment="Center" Text="Material Design Demo"/>
</Grid>
</styles:ColorZone>
</controls:ColorZone>
</showMeTheXaml:XamlDisplay>
</StackPanel>
<StackPanel>
<TextBlock Classes="Headline6 Subheadline2" Text="Accent mode" />
<showMeTheXaml:XamlDisplay UniqueId="ColorZoneDemo8">
<styles:ColorZone Height="56" Padding="12" Mode="Accent">
<controls:ColorZone Height="56" Padding="12" Mode="Accent">
<Grid ColumnDefinitions="Auto,24,*">
<ToggleButton Grid.Column="0" Classes="Flat TransparentBack" Padding="4" Width="{Binding $self.Bounds.Height}" Content="{icons:MaterialIconExt Menu}" />
<TextBlock Grid.Column="2" Classes="Headline6" VerticalAlignment="Center" Text="Material Design Demo"/>
</Grid>
</styles:ColorZone>
</controls:ColorZone>
</showMeTheXaml:XamlDisplay>
</StackPanel>
@@ -116,7 +117,7 @@
<StackPanel>
<TextBlock Classes="Headline6 Subheadline2" Text="With menus" />
<showMeTheXaml:XamlDisplay UniqueId="ColorZoneAdvDemo1">
<styles:ColorZone Height="56" Padding="12">
<controls:ColorZone Height="56" Padding="12">
<Grid ColumnDefinitions="Auto,24,*,24,Auto">
<ToggleButton Grid.Column="0" Classes="Flat TransparentBack" Padding="4" Width="{Binding $self.Bounds.Height}" Content="{icons:MaterialIconExt Menu}" />
<TextBlock Grid.Column="2" Classes="Headline6" VerticalAlignment="Center" Text="Material Design Demo"/>
@@ -125,20 +126,20 @@
<Button Classes="Flat" Padding="4" Content="{icons:MaterialIconExt DotsVertical}"/>
</ReversibleStackPanel>
</Grid>
</styles:ColorZone>
</controls:ColorZone>
</showMeTheXaml:XamlDisplay>
</StackPanel>
<StackPanel>
<TextBlock Classes="Headline6 Subheadline2" Text="With search bar" />
<showMeTheXaml:XamlDisplay UniqueId="ColorZoneAdvDemo2">
<styles:ColorZone Height="56" Padding="12">
<controls:ColorZone Height="56" Padding="12">
<Grid ColumnDefinitions="Auto,24,*,*,24,Auto">
<ToggleButton Grid.Column="0" Classes="Flat TransparentBack" Padding="4" Width="{Binding $self.Bounds.Height}" Content="{icons:MaterialIconExt Menu}" />
<TextBlock Grid.Column="2" Classes="Headline6" VerticalAlignment="Center" Text="Material Design Demo"/>
<Panel Grid.Column="3" VerticalAlignment="Center">
<styles:Card VerticalAlignment="Center" Padding="0">
<controls:Card VerticalAlignment="Center" Padding="0">
<TextBox Margin="0" Classes="Solo" Watermark="Search bar">
<TextBox.Styles>
<Style Selector="TextBox.Solo /template/ Grid#PART_InnerRoot">
@@ -149,14 +150,14 @@
<Button Classes="Flat" Padding="4" Width="{Binding $self.Bounds.Height}" Content="{icons:MaterialIconExt Search, Size=24}" />
</TextBox.InnerRightContent>
</TextBox>
</styles:Card>
</controls:Card>
</Panel>
<ReversibleStackPanel Grid.Column="5" Margin="0" Orientation="Horizontal">
<Button Classes="Flat" Padding="4" Content="{icons:MaterialIconExt DotsVertical}"/>
</ReversibleStackPanel>
</Grid>
</styles:ColorZone>
</controls:ColorZone>
</showMeTheXaml:XamlDisplay>
</StackPanel>
</StackPanel>
+2 -3
View File
@@ -1,5 +1,4 @@
using Avalonia;
using Avalonia.Controls;
using Avalonia.Controls;
using Avalonia.Markup.Xaml;
namespace Material.Demo.Pages
@@ -16,4 +15,4 @@ namespace Material.Demo.Pages
AvaloniaXamlLoader.Load(this);
}
}
}
}
+2 -3
View File
@@ -1,5 +1,4 @@
using Avalonia;
using Avalonia.Controls;
using Avalonia.Controls;
using Avalonia.Markup.Xaml;
namespace Material.Demo.Pages
@@ -16,4 +15,4 @@ namespace Material.Demo.Pages
AvaloniaXamlLoader.Load(this);
}
}
}
}
+43 -74
View File
@@ -1,13 +1,11 @@
<UserControl xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:styles="clr-namespace:Material.Styles;assembly=Material.Styles"
xmlns:viewModels="clr-namespace:Material.Demo.ViewModels"
xmlns:dialogHost="clr-namespace:DialogHost;assembly=DialogHost.Avalonia"
xmlns:models="clr-namespace:Material.Demo.Models"
xmlns:dialogHost="clr-namespace:DialogHostAvalonia;assembly=DialogHost.Avalonia"
x:Class="Material.Demo.Pages.DialogDemo"
x:DataType="viewModels:DialogDemoViewModel">
x:DataType="viewModels:DialogDemoViewModel" >
<UserControl.Resources>
<!-- ReSharper disable once Xaml.RedundantResource -->
<StackPanel x:Key="Sample2View">
<ProgressBar Classes="Circle" IsIndeterminate="True" />
<Button Margin="0 16 0 0"
@@ -16,80 +14,51 @@
</Button>
</StackPanel>
</UserControl.Resources>
<dialogHost:DialogHost Identifier="MainDialogHost">
<dialogHost:DialogHost.DialogContentTemplate>
<DataTemplate DataType="models:Sample2Model">
<StackPanel>
<TextBlock TextAlignment="Center">Your lucky number:</TextBlock>
<TextBlock Classes="Body1"
TextAlignment="Center"
Text="{Binding Number}" />
<Button Margin="0 8 0 0"
Command="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType=dialogHost:DialogHost}, Path=CloseDialogCommand}">
THANKS, CLOSE
</Button>
</StackPanel>
</DataTemplate>
</dialogHost:DialogHost.DialogContentTemplate>
<StackPanel Margin="16, 0">
<TextBlock Classes="Headline4 Subheadline" Text="Dialogs" />
<WrapPanel>
<WrapPanel.Styles>
<Style Selector="WrapPanel > StackPanel,
WrapPanel > Grid">
<Setter Property="Width" Value="300" />
<Setter Property="MinHeight" Value="300" />
</Style>
<Style Selector="WrapPanel > StackPanel > StackPanel,
WrapPanel > Grid > StackPanel">
<Setter Property="HorizontalAlignment" Value="Center" />
<Setter Property="VerticalAlignment" Value="Center" />
<Setter Property="Margin" Value="8" />
</Style>
<Style
Selector="WrapPanel > Grid > StackPanel > StackPanel,
WrapPanel > StackPanel > StackPanel > StackPanel">
<Setter Property="Margin" Value="8" />
</Style>
</WrapPanel.Styles>
<Grid>
<TextBlock Classes="Headline6 Subheadline2" Text="From DialogHost" />
<StackPanel>
<TextBlock TextWrapping="Wrap">Top level dialog with custom corner radius, using OpenDialog, passing content via the Parameter. You can pass a view model, provided a corresponding DataTemplate can be found in the scope of the root DialogHost.</TextBlock>
<StackPanel Margin="8 8 8 0">
<Button Margin="8" Click="OpenDialogWithView">PASS VIEW</Button>
<Button Margin="8" Click="OpenDialogWithModel">PASS MODEL</Button>
<Button Margin="8" Click="OpenMoreDialogHostExamples">MORE EXAMPLES</Button>
</StackPanel>
<StackPanel Margin="16, 0" >
<TextBlock Classes="Headline4 Subheadline" Text="Dialogs" />
<Grid ColumnDefinitions="*, *" >
<StackPanel>
<TextBlock Classes="Headline6 Subheadline2" Text="DialogHost" />
<StackPanel>
<TextBlock TextWrapping="Wrap" >Top level dialog with custom corner radius, using OpenDialog, passing content via the Parameter. You can pass a view model, provided a corresponding DataTemplate can be found in the scope of the root DialogHost.</TextBlock>
<StackPanel Spacing="8" >
<Button Classes="flat" Click="OpenDialogWithView" >PASS VIEW</Button>
<Button Classes="flat" Click="OpenDialogWithModel" >PASS MODEL</Button>
<Button Classes="flat" Click="OpenMoreDialogHostExamples" >MORE EXAMPLES</Button>
</StackPanel>
</Grid>
<StackPanel>
<TextBlock Classes="Headline6 Subheadline2" Text="Standalone dialog" />
</StackPanel>
</StackPanel>
<ItemsControl Items="{CompiledBinding StandaloneDialogItems}">
<ItemsControl.ItemTemplate>
<DataTemplate DataType="viewModels:DialogDemoItemViewModel">
<DockPanel Margin="8">
<Button DockPanel.Dock="Top"
Content="{CompiledBinding Header}"
Command="{CompiledBinding Command}" />
<TextBlock Margin="8"
HorizontalAlignment="Center"
TextWrapping="Wrap"
<StackPanel Grid.Column="1" >
<TextBlock Classes="Headline6 Subheadline2" Text="Standalone dialog" />
DockPanel.Dock="Bottom"
<ItemsControl Items="{CompiledBinding StandaloneDialogItems}" >
<ItemsControl.ItemTemplate>
<DataTemplate DataType="viewModels:DialogDemoItemViewModel" >
<DockPanel Margin="8" >
<Button DockPanel.Dock="Top"
Classes="flat"
Content="{CompiledBinding Header}"
Command="{CompiledBinding Command}" />
<TextBlock Margin="8"
HorizontalAlignment="Center"
TextWrapping="Wrap"
Text="{CompiledBinding Result}"
IsVisible="{CompiledBinding Result,
DockPanel.Dock="Bottom"
Text="{CompiledBinding Result}"
IsVisible="{CompiledBinding Result,
Converter={x:Static StringConverters.IsNotNullOrEmpty},
FallbackValue=False}" />
</DockPanel>
</DataTemplate>
</ItemsControl.ItemTemplate>
</ItemsControl>
</StackPanel>
</WrapPanel>
</StackPanel>
</dialogHost:DialogHost>
</DockPanel>
</DataTemplate>
</ItemsControl.ItemTemplate>
</ItemsControl>
</StackPanel>
</Grid>
</StackPanel>
</UserControl>
+13 -8
View File
@@ -3,6 +3,7 @@ using System.Diagnostics;
using Avalonia.Controls;
using Avalonia.Interactivity;
using Avalonia.Markup.Xaml;
using DialogHostAvalonia;
using Material.Demo.Models;
using Material.Demo.ViewModels;
@@ -15,24 +16,28 @@ namespace Material.Demo.Pages
InitializeComponent();
DataContext = new DialogDemoViewModel();
}
}
private void InitializeComponent()
{
AvaloniaXamlLoader.Load(this);
}
private void OpenDialogWithView(object? sender, RoutedEventArgs e) {
DialogHost.DialogHost.Show(this.Resources["Sample2View"]!, "MainDialogHost");
private void OpenDialogWithView(object? sender, RoutedEventArgs e)
{
DialogHost.Show(this.Resources["Sample2View"]!, "MainDialogHost");
}
private void OpenDialogWithModel(object? sender, RoutedEventArgs e) {
private void OpenDialogWithModel(object? sender, RoutedEventArgs e)
{
// View that associated with this model defined at DialogContentTemplate in DialogDemo.axaml
DialogHost.DialogHost.Show(new Sample2Model(new Random().Next(0, 100)), "MainDialogHost");
DialogHost.Show(new Sample2Model(new Random().Next(0, 100)), "MainDialogHost");
}
private void OpenMoreDialogHostExamples(object? sender, RoutedEventArgs e) {
Process.Start(new ProcessStartInfo(){FileName = "https://github.com/AvaloniaUtils/DialogHost.Avalonia", UseShellExecute = true});
private void OpenMoreDialogHostExamples(object? sender, RoutedEventArgs e)
{
Process.Start(new ProcessStartInfo()
{FileName = "https://github.com/AvaloniaUtils/DialogHost.Avalonia", UseShellExecute = true});
}
}
}
}
+48 -7
View File
@@ -5,15 +5,56 @@
mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450"
xmlns:styles="clr-namespace:Material.Styles;assembly=Material.Styles"
xmlns:showMeTheXaml="clr-namespace:ShowMeTheXaml;assembly=ShowMeTheXaml.Avalonia"
xmlns:viewModels="clr-namespace:Material.Demo.ViewModels"
x:Class="Material.Demo.Pages.ExpandersDemo">
<StackPanel Margin="16, 0">
<UserControl.DataContext>
<viewModels:ExpanderDemoViewModel/>
</UserControl.DataContext>
<UserControl.Resources>
<DataTemplate x:Key="LoremContentTemplate"
DataType="viewModels:ExpanderDemoViewModel">
<ItemsControl Items="{Binding LoremText}">
<ItemsControl.ItemTemplate>
<DataTemplate>
<TextBlock TextWrapping="Wrap"
Text="{Binding }"/>
</DataTemplate>
</ItemsControl.ItemTemplate>
</ItemsControl>
</DataTemplate>
</UserControl.Resources>
<StackPanel Margin="16, 0"
Spacing="16">
<TextBlock Classes="Headline4 Subheadline" Text="Expanders" />
<Expander Header="This is expander! Click me to expand the content.">
<TextBlock TextWrapping="Wrap" Text="Lorem ipsum dolor sit amet, consectetur adipiscing elit. Suspendisse malesuada lacus ex, sit amet blandit leo lobortis eget."/>
</Expander>
<Expander Header="This is another expander!">
<TextBlock TextWrapping="Wrap" Text="Lorem ipsum dolor sit amet, consectetur adipiscing elit. Suspendisse malesuada lacus ex, sit amet blandit leo lobortis eget."/>
</Expander>
<ContentControl Content="{Binding}"
ContentTemplate="{StaticResource LoremContentTemplate}"/>
<Expander Header="This is expander! Click me to expand the content."
Content="{Binding }"
ContentTemplate="{StaticResource LoremContentTemplate}"/>
<Expander Header="This is another expander!"
Content="{Binding }"
ContentTemplate="{StaticResource LoremContentTemplate}"/>
<Expander Header="This expander inflates content from upside!"
ExpandDirection="Up"
Content="{Binding }"
ContentTemplate="{StaticResource LoremContentTemplate}"/>
<StackPanel Orientation="Horizontal">
<Expander Header="Inflates left!"
ExpandDirection="Left"
Content="{Binding }"
ContentTemplate="{StaticResource LoremContentTemplate}"/>
<Expander Header="Inflates right!"
ExpandDirection="Right"
Content="{Binding }"
ContentTemplate="{StaticResource LoremContentTemplate}"/>
</StackPanel>
</StackPanel>
</UserControl>
+2 -3
View File
@@ -1,5 +1,4 @@
using Avalonia;
using Avalonia.Controls;
using Avalonia.Controls;
using Avalonia.Markup.Xaml;
namespace Material.Demo.Pages
@@ -16,4 +15,4 @@ namespace Material.Demo.Pages
AvaloniaXamlLoader.Load(this);
}
}
}
}
+46 -40
View File
@@ -3,11 +3,12 @@
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="2300"
xmlns:styles="clr-namespace:Material.Styles;assembly=Material.Styles"
xmlns:wpf="clr-namespace:Material.Styles.Assists;assembly=Material.Styles"
xmlns:avalonia="clr-namespace:Material.Icons.Avalonia;assembly=Material.Icons.Avalonia"
xmlns:showMeTheXaml="clr-namespace:ShowMeTheXaml;assembly=ShowMeTheXaml.Avalonia"
xmlns:system="clr-namespace:System;assembly=System.Runtime"
xmlns:styles="clr-namespace:Material.Styles;assembly=Material.Styles"
xmlns:avalonia="clr-namespace:Material.Icons.Avalonia;assembly=Material.Icons.Avalonia"
xmlns:controls="clr-namespace:Material.Styles.Controls;assembly=Material.Styles"
x:Class="Material.Demo.Pages.FieldsDemo">
<UserControl.Resources>
<system:String x:Key="TextFieldTip1">Only numerics in this field</system:String>
@@ -29,9 +30,12 @@
</Style>
</StackPanel.Styles>
<StackPanel Orientation="Vertical">
<TextBlock Classes="Headline6 Subheadline2" Text="Single-Line fields" />
<TextBlock Classes="Headline6 Subheadline2"
Text="Single-Line fields" />
<showMeTheXaml:XamlDisplay UniqueId="SingleLineTextBoxes0">
<TextBox UseFloatingWatermark="True" wpf:TextFieldAssist.Label="Classic TextBox" />
<TextBox UseFloatingWatermark="True"
Watermark="Type something..."
wpf:TextFieldAssist.Label="Classic TextBox" />
</showMeTheXaml:XamlDisplay>
<showMeTheXaml:XamlDisplay UniqueId="SingleLineTextBoxes1">
<TextBox UseFloatingWatermark="False" Watermark="No floating label" />
@@ -91,29 +95,29 @@
<StackPanel Orientation="Vertical">
<TextBlock Classes="Headline6 Subheadline2" Text="Single-Line fields" />
<showMeTheXaml:XamlDisplay UniqueId="SingleLineFields0">
<TextBox UseFloatingWatermark="True" Classes="Filled"
<TextBox UseFloatingWatermark="True" Classes="filled"
wpf:TextFieldAssist.Label="Filled TextBox" />
</showMeTheXaml:XamlDisplay>
<showMeTheXaml:XamlDisplay UniqueId="SingleLineFields1">
<TextBox UseFloatingWatermark="False" Classes="Filled" Watermark="No floating label" />
<TextBox UseFloatingWatermark="False" Classes="filled" Watermark="No floating label" />
</showMeTheXaml:XamlDisplay>
<showMeTheXaml:XamlDisplay UniqueId="SingleLineFields2">
<TextBox UseFloatingWatermark="True" Classes="Filled revealPasswordButton"
<TextBox UseFloatingWatermark="True" Classes="filled revealPasswordButton"
wpf:TextFieldAssist.Label="Password"
PasswordChar="*" />
</showMeTheXaml:XamlDisplay>
<showMeTheXaml:XamlDisplay UniqueId="SingleLineFields3">
<TextBox UseFloatingWatermark="True" Classes="Filled clearButton"
<TextBox UseFloatingWatermark="True" Classes="filled clearButton"
wpf:TextFieldAssist.Label="Text field" />
</showMeTheXaml:XamlDisplay>
<showMeTheXaml:XamlDisplay UniqueId="SingleLineFields4">
<TextBox UseFloatingWatermark="True" Classes="Filled"
<TextBox UseFloatingWatermark="True" Classes="filled"
wpf:TextFieldAssist.Label="Text field with validation"
wpf:TextFieldAssist.Hints="{StaticResource TextFieldTip1}"
Text="{Binding Numerics}" />
</showMeTheXaml:XamlDisplay>
<showMeTheXaml:XamlDisplay UniqueId="SingleLineFields5">
<TextBox UseFloatingWatermark="True" Classes="Filled" IsEnabled="False"
<TextBox UseFloatingWatermark="True" Classes="filled" IsEnabled="False"
wpf:TextFieldAssist.Label="Disabled Field"
Text="Hello World!" />
</showMeTheXaml:XamlDisplay>
@@ -121,25 +125,25 @@
<StackPanel Orientation="Vertical">
<TextBlock Classes="Headline6 Subheadline2" Text="Single-Line fields (dense)" />
<showMeTheXaml:XamlDisplay UniqueId="SingleLineDenseFields0">
<TextBox Classes="Filled Dense" UseFloatingWatermark="False" Watermark="No floating label" />
<TextBox Classes="filled dense" UseFloatingWatermark="False" Watermark="No floating label" />
</showMeTheXaml:XamlDisplay>
<showMeTheXaml:XamlDisplay UniqueId="SingleLineDenseFields1">
<TextBox UseFloatingWatermark="True" Classes="Filled Dense"
<TextBox UseFloatingWatermark="True" Classes="filled dense"
wpf:TextFieldAssist.Label="Filled dense TextBox" />
</showMeTheXaml:XamlDisplay>
<showMeTheXaml:XamlDisplay UniqueId="SingleLineDenseFields2">
<TextBox UseFloatingWatermark="True" Classes="Filled Dense clearButton"
<TextBox UseFloatingWatermark="True" Classes="filled dense clearButton"
wpf:TextFieldAssist.Label="Dense field with clear button" />
</showMeTheXaml:XamlDisplay>
<showMeTheXaml:XamlDisplay UniqueId="SingleLineDenseFields3">
<TextBox UseFloatingWatermark="True" Classes="Filled Dense revealPasswordButton"
<TextBox UseFloatingWatermark="True" Classes="filled dense revealPasswordButton"
wpf:TextFieldAssist.Label="Password"
PasswordChar="*" />
</showMeTheXaml:XamlDisplay>
<showMeTheXaml:XamlDisplay UniqueId="SingleLineDenseFields4">
<TextBox UseFloatingWatermark="True" Classes="Filled Dense" IsEnabled="False"
<TextBox UseFloatingWatermark="True" Classes="filled dense" IsEnabled="False"
wpf:TextFieldAssist.Label="Disabled Field"
Text="Hello World!" />
</showMeTheXaml:XamlDisplay>
@@ -156,7 +160,7 @@
<showMeTheXaml:XamlDisplay UniqueId="MultilineFields1">
<TextBox UseFloatingWatermark="True"
wpf:TextFieldAssist.Label="Multiline textfield"
Classes="Filled"
Classes="filled"
AcceptsReturn="True"
TextWrapping="Wrap"
MaxHeight="100"
@@ -184,50 +188,50 @@
<StackPanel Orientation="Vertical">
<TextBlock Classes="Headline6 Subheadline2" Text="Single-Line fields" />
<showMeTheXaml:XamlDisplay UniqueId="OutlineSinglelineFields0">
<TextBox UseFloatingWatermark="True" Classes="Outline"
<TextBox UseFloatingWatermark="True" Classes="outline"
wpf:TextFieldAssist.Label="Outline TextBox" />
</showMeTheXaml:XamlDisplay>
<showMeTheXaml:XamlDisplay UniqueId="OutlineSinglelineFields1">
<TextBox UseFloatingWatermark="False" Classes="Outline" Watermark="No floating label" />
<TextBox UseFloatingWatermark="False" Classes="outline" Watermark="No floating label" />
</showMeTheXaml:XamlDisplay>
<showMeTheXaml:XamlDisplay UniqueId="OutlineSinglelineFields2">
<TextBox UseFloatingWatermark="True" Classes="Outline revealPasswordButton"
<TextBox UseFloatingWatermark="True" Classes="outline revealPasswordButton"
wpf:TextFieldAssist.Label="Password" PasswordChar="*" />
</showMeTheXaml:XamlDisplay>
<showMeTheXaml:XamlDisplay UniqueId="OutlineSinglelineFields3">
<TextBox UseFloatingWatermark="True" Classes="Outline clearButton"
<TextBox UseFloatingWatermark="True" Classes="outline clearButton"
wpf:TextFieldAssist.Label="Text field" />
</showMeTheXaml:XamlDisplay>
<showMeTheXaml:XamlDisplay UniqueId="OutlineSinglelineFields4">
<TextBox UseFloatingWatermark="True" Classes="Outline"
<TextBox UseFloatingWatermark="True" Classes="outline"
wpf:TextFieldAssist.Label="Text field with validation"
wpf:TextFieldAssist.Hints="{StaticResource TextFieldTip1}"
Text="{Binding Numerics}"/>
</showMeTheXaml:XamlDisplay>
<showMeTheXaml:XamlDisplay UniqueId="OutlineSinglelineFields5">
<TextBox UseFloatingWatermark="True" Classes="Outline" IsEnabled="False"
<TextBox UseFloatingWatermark="True" Classes="outline" IsEnabled="False"
wpf:TextFieldAssist.Label="Disabled Field" Text="Hello World!" />
</showMeTheXaml:XamlDisplay>
</StackPanel>
<StackPanel Orientation="Vertical">
<TextBlock Classes="Headline6 Subheadline2" Text="Single-Line fields (dense)" />
<showMeTheXaml:XamlDisplay UniqueId="OutlineSinglelineDenseFields0">
<TextBox UseFloatingWatermark="False" Classes="Outline Dense" Watermark="No floating label" />
<TextBox UseFloatingWatermark="False" Classes="outline dense" Watermark="No floating label" />
</showMeTheXaml:XamlDisplay>
<showMeTheXaml:XamlDisplay UniqueId="OutlineSinglelineDenseFields1">
<TextBox UseFloatingWatermark="True" Classes="Outline Dense"
<TextBox UseFloatingWatermark="True" Classes="outline dense"
wpf:TextFieldAssist.Label="Outline dense TextBox" />
</showMeTheXaml:XamlDisplay>
<showMeTheXaml:XamlDisplay UniqueId="OutlineSinglelineDenseFields2">
<TextBox UseFloatingWatermark="True" Classes="Outline Dense clearButton"
<TextBox UseFloatingWatermark="True" Classes="outline dense clearButton"
wpf:TextFieldAssist.Label="Dense field with clear button" />
</showMeTheXaml:XamlDisplay>
<showMeTheXaml:XamlDisplay UniqueId="OutlineSinglelineDenseFields3">
<TextBox UseFloatingWatermark="True" Classes="Outline Dense revealPasswordButton"
<TextBox UseFloatingWatermark="True" Classes="outline dense revealPasswordButton"
wpf:TextFieldAssist.Label="Password" PasswordChar="*" />
</showMeTheXaml:XamlDisplay>
<showMeTheXaml:XamlDisplay UniqueId="OutlineSinglelineDenseFields4">
<TextBox UseFloatingWatermark="True" Classes="Outline Dense" IsEnabled="False"
<TextBox UseFloatingWatermark="True" Classes="outline dense" IsEnabled="False"
wpf:TextFieldAssist.Label="Disabled Field" Text="Hello World!" />
</showMeTheXaml:XamlDisplay>
</StackPanel>
@@ -244,7 +248,7 @@
<showMeTheXaml:XamlDisplay UniqueId="OutlineMultilineFields0">
<TextBox UseFloatingWatermark="True"
wpf:TextFieldAssist.Label="Multiline textfield"
Classes="Outline"
Classes="outline"
MaxHeight="100"
AcceptsReturn="True"
TextWrapping="Wrap"
@@ -271,28 +275,28 @@
<StackPanel Orientation="Vertical">
<TextBlock Classes="Headline6 Subheadline2" Text="Solo fields" />
<showMeTheXaml:XamlDisplay UniqueId="SoloFields0">
<styles:Card Padding="0" Margin="8">
<TextBox Classes="Solo" Watermark="Solo field with Card">
<controls:Card Padding="0" Margin="8">
<TextBox Classes="solo" Watermark="Solo field with Card">
<TextBox.InnerRightContent>
<Button Classes="Flat" Padding="4" Width="{Binding $self.Bounds.Height}"
Content="{avalonia:MaterialIconExt Search, Size=24}" />
</TextBox.InnerRightContent>
</TextBox>
</styles:Card>
</controls:Card>
</showMeTheXaml:XamlDisplay>
<showMeTheXaml:XamlDisplay UniqueId="SoloFields1">
<styles:ColorZone Padding="0" Margin="8">
<TextBox Classes="Solo" Watermark="or with ColorZone">
<controls:ColorZone Padding="0" Margin="8">
<TextBox Classes="solo" Watermark="or with ColorZone">
<TextBox.InnerRightContent>
<Button Classes="Flat" Padding="4" Width="{Binding $self.Bounds.Height}"
Content="{avalonia:MaterialIconExt Search, Size=24}" />
</TextBox.InnerRightContent>
</TextBox>
</styles:ColorZone>
</controls:ColorZone>
</showMeTheXaml:XamlDisplay>
<showMeTheXaml:XamlDisplay UniqueId="SoloFields2">
<styles:ColorZone Padding="0" Margin="8">
<TextBox Watermark="Search field" Classes="Solo" Margin="0">
<controls:ColorZone Padding="0" Margin="8">
<TextBox Watermark="Search field" Classes="solo" Margin="0">
<TextBox.InnerRightContent>
<Button Width="{Binding $self.Bounds.Height}" Classes="Flat"
Foreground="{DynamicResource MaterialDesignCardBackground}">
@@ -300,12 +304,12 @@
</Button>
</TextBox.InnerRightContent>
</TextBox>
</styles:ColorZone>
</controls:ColorZone>
</showMeTheXaml:XamlDisplay>
<showMeTheXaml:XamlDisplay UniqueId="SoloFields3">
<TextBox BorderBrush="{Binding $self.Foreground}" BorderThickness="1" Classes="Solo"
<TextBox BorderBrush="{Binding $self.Foreground}" BorderThickness="1" Classes="solo"
Watermark="Search field"
wpf:TextFieldAssist.CornerRadius="32" Margin="8">
CornerRadius="32" Margin="8">
<TextBox.InnerLeftContent>
<Border Height="{Binding $parent[TextBox].Height}" Width="{Binding $self.Bounds.Height}">
<avalonia:MaterialIcon HorizontalAlignment="Center" VerticalAlignment="Center"
@@ -315,7 +319,7 @@
</TextBox>
</showMeTheXaml:XamlDisplay>
<showMeTheXaml:XamlDisplay UniqueId="SoloFields4">
<TextBox BorderBrush="Black" Margin="8" BorderThickness="1" Classes="Solo"
<TextBox BorderBrush="Black" Margin="8" BorderThickness="1" Classes="solo"
Watermark="No container but use border instead" />
</showMeTheXaml:XamlDisplay>
</StackPanel>
@@ -341,5 +345,7 @@
</StackPanel>
</StackPanel>
</WrapPanel>
</StackPanel>
</UserControl>
+2 -3
View File
@@ -1,5 +1,4 @@
using Avalonia;
using Avalonia.Controls;
using Avalonia.Controls;
using Avalonia.Markup.Xaml;
using Material.Demo.ViewModels;
@@ -19,4 +18,4 @@ namespace Material.Demo.Pages
AvaloniaXamlLoader.Load(this);
}
}
}
}
+76 -78
View File
@@ -1,84 +1,82 @@
<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"
mc:Ignorable="d"
xmlns:demo="clr-namespace:Material.Demo;assembly=Material.Demo"
xmlns:styles="clr-namespace:Material.Styles;assembly=Material.Styles"
xmlns:models="clr-namespace:Material.Demo.Models"
xmlns:conv="clr-namespace:Material.Demo.Converters"
x:Class="Material.Demo.Pages.Home" >
<UserControl.Resources>
<conv:EnumDescriptionConverter x:Key="GetDescription"/>
</UserControl.Resources>
x:Class="Material.Demo.Pages.Home">
<!--UserControl.Resources>
<conv:EnumDescriptionConverter x:Key="GetDescription"/>
</UserControl.Resources-->
<StackPanel Margin="16, 0" MaxWidth="600">
<StackPanel.Styles>
<Style Selector="TextBlock.Content, TextBlock.Subheadline">
<Setter Property="HorizontalAlignment" Value="Stretch"/>
<Setter Property="TextAlignment" Value="Center"/>
<Setter Property="TextWrapping" Value="Wrap"/>
</Style>
</StackPanel.Styles>
<Image Width="200" Height="200" HorizontalAlignment="Center" VerticalAlignment="Top"
Source="avares://Material.Demo/Assets/FavIcon_200x.png" Margin="0,0,0,-8"/>
<TextBlock Classes="Headline4 Subheadline" Text="👋 Welcome to Material.Avalonia Demo!"/>
<TextBlock Classes="Content" Text="Material.Avalonia is a library that could beauty and turning your Avalonia Application from regular design to Material Design like Material Design in XAML! It easy for use to your project! Just install NuGet package, slightly change your App.xaml / App.axaml and your application are ready to go with Material Design!"/>
<TextBlock Classes="Content" Text="This project is still in development. Not all controls are ready for use, and could be buggy. Don't worry! some basic controls (Buttons, Switch, TextBox and etc.) are ready for use for now! and other controls will be ready later!"/>
<TextBlock Classes="Content" Text="Press drawer button to start widgets tours!"/>
<TextBlock Classes="Content" Text="For attaching AvaloniaUI DevTools - Press Shift + F12."/>
<StackPanel Margin="16">
<StackPanel.Styles>
<Style Selector="Button">
<Setter Property="Margin" Value="4"/>
</Style>
<Style Selector="TextBlock.Content, TextBlock.Subheadline">
<Setter Property="HorizontalAlignment" Value="Stretch" />
<Setter Property="TextAlignment" Value="Center" />
<Setter Property="TextWrapping" Value="Wrap" />
</Style>
</StackPanel.Styles>
<WrapPanel HorizontalAlignment="Center" MaxWidth="600" >
<Button Classes="Flat" Content="PROJECT LINK" Command="{Binding Path=OpenProjectRepoLink}"/>
<Button Classes="Flat" Content="USE DARK THEME" Command="{Binding Path=UseMaterialUIDarkTheme}"/>
<Button Classes="Flat" Content="USE LIGHT THEME" Command="{Binding Path=UseMaterialUILightTheme}"/>
</WrapPanel>
<WrapPanel HorizontalAlignment="Center" MaxWidth="600" >
<Button Classes="Flat" Content="SWITCH TRANSITIONS" Command="{Binding Path=SwitchTransition}"/>
<Button Classes="Flat" Content="ABOUT AVALONIAUI" Command="{Binding Path=ShowAboutAvaloniaUI}"/>
</WrapPanel>
</StackPanel>
<StackPanel Margin="0,24">
<DataGrid Height="620"
IsReadOnly="True"
Items="{Binding Path=DataContext.Features}"
VerticalAlignment="Stretch"
VerticalScrollBarVisibility="Disabled">
<DataGrid.Columns>
<DataGridTextColumn Header="Features"
Binding="{Binding FeatureName}"
Width="20*" />
<DataGridTemplateColumn>
<DataGridTemplateColumn.Header>
<TextBlock TextAlignment="Right"
Text="Is Ready"
HorizontalAlignment="Stretch"/>
</DataGridTemplateColumn.Header>
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<TextBlock TextAlignment="Right" Text="{Binding Converter={StaticResource GetDescription}, Path=IsReady}"/>
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>
<DataGridTemplateColumn>
<DataGridTemplateColumn.Header>
<TextBlock TextAlignment="Right"
Text="Is Animated"
HorizontalAlignment="Stretch"/>
</DataGridTemplateColumn.Header>
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<TextBlock TextAlignment="Right" Text="{Binding Converter={StaticResource GetDescription}, Path=IsAnimated}"/>
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>
</DataGrid.Columns>
</DataGrid>
</StackPanel>
<Image Width="200" Height="200" HorizontalAlignment="Center" VerticalAlignment="Top"
Source="avares://Material.Demo/Assets/FavIcon_200x.png" Margin="0,0,0,-8" />
<TextBlock Classes="Headline4 Subheadline" Text="👋 Welcome to Material.Avalonia Demo!" />
<TextBlock Classes="Content"
Text="Material.Avalonia is a library that could beauty and turning your Avalonia Application from regular design to Material Design like Material Design in XAML! It easy for use to your project! Just install NuGet package, slightly change your App.xaml / App.axaml and your application are ready to go with Material Design!" />
<TextBlock Classes="Content"
Text="This project is still in development. Not all controls are ready for use, and could be buggy. Don't worry! some basic controls (Buttons, Switch, TextBox and etc.) are ready for use for now! and other controls will be ready later!" />
<TextBlock Classes="Content" Text="Press drawer button to start widgets tours!" />
<TextBlock Classes="Content" Text="For attaching AvaloniaUI DevTools - Press Shift + F12." />
<StackPanel Margin="16">
<StackPanel.Styles>
<Style Selector="Button">
<Setter Property="Margin" Value="4" />
</Style>
</StackPanel.Styles>
<WrapPanel HorizontalAlignment="Center" MaxWidth="600">
<Button Classes="Flat" Content="PROJECT LINK" Command="{Binding Path=OpenProjectRepoLink}" />
<Button Classes="Flat" Content="USE DARK THEME" Command="{Binding Path=UseMaterialUIDarkTheme}" />
<Button Classes="Flat" Content="USE LIGHT THEME" Command="{Binding Path=UseMaterialUILightTheme}" />
</WrapPanel>
<WrapPanel HorizontalAlignment="Center" MaxWidth="600">
<Button Classes="Flat" Content="SWITCH TRANSITIONS" Command="{Binding Path=SwitchTransition}" />
<Button Classes="Flat" Content="ABOUT AVALONIAUI" Command="{Binding Path=ShowAboutAvaloniaUI}" />
</WrapPanel>
</StackPanel>
<!-- Features listing is disabled. -->
<!--
<StackPanel Margin="0,24">
<DataGrid Height="620"
IsReadOnly="True"
Items="{Binding Path=DataContext.Features}"
VerticalAlignment="Stretch"
VerticalScrollBarVisibility="Disabled">
<DataGrid.Columns>
<DataGridTextColumn Header="Features"
Binding="{Binding FeatureName}"
Width="20*" />
<DataGridTemplateColumn>
<DataGridTemplateColumn.Header>
<TextBlock TextAlignment="Right"
Text="Is Ready"
HorizontalAlignment="Stretch"/>
</DataGridTemplateColumn.Header>
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<TextBlock TextAlignment="Right" Text="{Binding Converter={StaticResource GetDescription}, Path=IsReady}"/>
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>
<DataGridTemplateColumn>
<DataGridTemplateColumn.Header>
<TextBlock TextAlignment="Right"
Text="Is Animated"
HorizontalAlignment="Stretch"/>
</DataGridTemplateColumn.Header>
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<TextBlock TextAlignment="Right" Text="{Binding Converter={StaticResource GetDescription}, Path=IsAnimated}"/>
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>
</DataGrid.Columns>
</DataGrid>
</StackPanel>
-->
</StackPanel>
</UserControl>
</UserControl>
+9 -8
View File
@@ -1,18 +1,19 @@
using Avalonia.Controls;
using Avalonia.Dialogs;
using Avalonia.Markup.Xaml;
using Material.Demo.Models;
using Material.Styles.Assists;
using System.Collections.ObjectModel;
using Material.Dialog;
using static Material.Demo.Models.StatusEnum;
using Material.Styles.Assists;
namespace Material.Demo.Pages
{
public class Home : UserControl
{
{
public Home()
{
// Sadly I don't have much time to update this listing
// and doesn't get updated after any changes
// I'm gonna disable this listing
/*
Features = new ObservableCollection<FeatureStatusModels> {
new FeatureStatusModels{ FeatureName = "Button (Standard)", IsReady = Yes, IsAnimated = Yes},
new FeatureStatusModels{ FeatureName = "Button (Floating)", IsReady = Yes, IsAnimated = NotFully},
@@ -44,13 +45,13 @@ namespace Material.Demo.Pages
new FeatureStatusModels{ FeatureName = "Icons (Excluded, via Material.Icons.Avalonia)", IsReady = Yes, IsAnimated = NA},
new FeatureStatusModels{ FeatureName = "Appbar (Top)", IsReady = No, IsAnimated = NA},
new FeatureStatusModels{ FeatureName = "Appbar (Bottom)", IsReady = No, IsAnimated = NA},
};
};*/
InitializeComponent();
DataContext = this;
}
public ObservableCollection<FeatureStatusModels> Features { get; private set; }
//public ObservableCollection<FeatureStatusModels> Features { get; private set; }
public void UseMaterialUIDarkTheme() => GlobalCommand.UseMaterialUIDarkTheme();
@@ -72,4 +73,4 @@ namespace Material.Demo.Pages
AvaloniaXamlLoader.Load(this);
}
}
}
}
+11 -10
View File
@@ -10,6 +10,7 @@
xmlns:system="clr-namespace:System;assembly=System.Runtime.Extensions"
xmlns:styles="clr-namespace:Material.Styles;assembly=Material.Styles"
xmlns:assists="clr-namespace:Material.Styles.Assists;assembly=Material.Styles"
xmlns:controls="clr-namespace:Material.Styles.Controls;assembly=Material.Styles"
mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450"
x:Class="Material.Demo.Pages.IconsDemo">
<UserControl.Resources>
@@ -75,16 +76,16 @@
</ScrollViewer>
</Panel>
<styles:ColorZone Mode="Standard" Padding="8" assists:ShadowAssist.ShadowDepth="Depth2">
<controls:ColorZone Mode="Standard" Padding="8" assists:ShadowAssist.ShadowDepth="Depth2">
<StackPanel Margin="16,8,16,0">
<TextBlock Classes="Headline4" Text="Material Icons" />
<TextBlock Classes="Subtitle1 Subheadline" TextWrapping="Wrap" Text="Material.Avalonia using Material.Icons.Avalonia and Material.Icons packages to provide icons for Material design. You can always use them freely in your application with Material.Avalonia!" />
</StackPanel>
</styles:ColorZone>
</controls:ColorZone>
<styles:ColorZone Grid.Row="2" Padding="8" Mode="Standard" assists:ShadowAssist.ShadowDepth="Depth2">
<controls:ColorZone Grid.Row="2" Padding="8" Mode="Standard" assists:ShadowAssist.ShadowDepth="Depth2">
<Grid Margin="8" ColumnDefinitions="*,Auto,*,16,Auto">
<styles:ColorZone Mode="Inverted" CornerRadius="32" BorderBrush="Transparent"
<controls:ColorZone Mode="Inverted" CornerRadius="32" BorderBrush="Transparent"
ToolTip.Tip="Enter to search, ignore case">
<TextBox KeyDown="Search_OnKeyDown" Watermark="Search" Name="SearchBox" Classes="Solo"
Text="{Binding SearchText}" Margin="0">
@@ -92,28 +93,28 @@
<Button Width="{Binding $self.Bounds.Height}"
Name="SearchButton" Foreground="{DynamicResource MaterialDesignCardBackground}"
Classes="Flat" Command="{Binding SearchCommand}"
CommandParameter="{Binding ElementName=SearchBox, Path=Text}" assists:ButtonAssist.CornerRadius="0">
CommandParameter="{Binding ElementName=SearchBox, Path=Text}" CornerRadius="0">
<avalonia:MaterialIcon Kind="Magnify" Width="20" Height="20"/>
</Button>
</TextBox.InnerRightContent>
</TextBox>
</styles:ColorZone>
</controls:ColorZone>
<TextBlock Grid.Column="1" Margin="16 0" Classes="Subtitle1"
VerticalAlignment="Center" Text="Usage:"/>
<styles:ColorZone Grid.Column="2" Mode="Inverted" CornerRadius="32" BorderBrush="Transparent" >
<controls:ColorZone Grid.Column="2" Mode="Inverted" CornerRadius="32" BorderBrush="Transparent" >
<TextBox GotFocus="TextBox_OnGotFocus" IsReadOnly="True" Classes="Solo" Margin="0"
Text="{Binding SelectedGroup.KindToCopy, FallbackValue='&lt;avalonia:MaterialIcon Kind=&quot;&quot; \/>'}">
<TextBox.InnerRightContent>
<Button Width="{Binding $self.Bounds.Height}" Foreground="{DynamicResource MaterialDesignCardBackground}"
Classes="Flat" Command="{Binding CopyToClipboardCommand, Mode=OneTime}"
CommandParameter="{Binding SelectedGroup.Kind}" assists:ButtonAssist.CornerRadius="0">
CommandParameter="{Binding SelectedGroup.Kind}" CornerRadius="0">
<avalonia:MaterialIcon Kind="ContentCopy" Width="20" Height="20"/>
</Button>
</TextBox.InnerRightContent>
</TextBox>
</styles:ColorZone>
</controls:ColorZone>
<Grid Grid.Column="4" ColumnDefinitions="Auto,8,Auto" IsVisible="{Binding SelectedGroup, Converter={x:Static ObjectConverters.IsNotNull}}">
<TextBlock Classes="Subtitle1"
@@ -124,6 +125,6 @@
Kind="{Binding SelectedGroup.KindValue}" VerticalAlignment="Center" />
</Grid>
</Grid>
</styles:ColorZone>
</controls:ColorZone>
</Grid>
</UserControl>
+14 -10
View File
@@ -1,32 +1,36 @@
#nullable enable
using System;
using Avalonia.Controls;
using Avalonia.Input;
using Avalonia.Markup.Xaml;
using Avalonia.Threading;
using Material.Demo.ViewModels;
namespace Material.Demo.Pages {
public class IconsDemo : UserControl {
public IconsDemo() {
namespace Material.Demo.Pages
{
public class IconsDemo : UserControl
{
public IconsDemo()
{
InitializeComponent();
DataContext = new IconsDemoViewModel();
}
private void InitializeComponent()
{
AvaloniaXamlLoader.Load(this);
}
private void Search_OnKeyDown(object? sender, KeyEventArgs e) {
var textBox = (TextBox)sender!;
private void Search_OnKeyDown(object? sender, KeyEventArgs e)
{
var textBox = (TextBox) sender!;
if (e.Key == Key.Enter)
this.Get<Button>("SearchButton").Command.Execute(textBox.Text);
}
private void TextBox_OnGotFocus(object? sender, GotFocusEventArgs e) {
var textBox = (TextBox)sender!;
private void TextBox_OnGotFocus(object? sender, GotFocusEventArgs e)
{
var textBox = (TextBox) sender!;
Dispatcher.UIThread.Post(textBox.SelectAll);
}
}
+3 -2
View File
@@ -5,6 +5,7 @@
mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450"
xmlns:styles="clr-namespace:Material.Styles;assembly=Material.Styles"
xmlns:showMeTheXaml="clr-namespace:ShowMeTheXaml;assembly=ShowMeTheXaml.Avalonia"
xmlns:controls="clr-namespace:Material.Styles.Controls;assembly=Material.Styles"
x:Class="Material.Demo.Pages.ListsDemo">
<StackPanel Margin="16, 0">
<TextBlock Classes="Headline4 Subheadline" Text="Lists" />
@@ -16,14 +17,14 @@
</Style>
</StackPanel.Styles>
<showMeTheXaml:XamlDisplay UniqueId="Lists0">
<styles:Card Padding="0,4">
<controls:Card Padding="0,4">
<ListBox Width="300">
<TextBlock Text="Item 1" />
<TextBlock Text="Item 2" />
<TextBlock Text="Item 3" />
<TextBlock Text="Item 4" />
</ListBox>
</styles:Card>
</controls:Card>
</showMeTheXaml:XamlDisplay>
</StackPanel>
</StackPanel>
+2 -3
View File
@@ -1,5 +1,4 @@
using Avalonia;
using Avalonia.Controls;
using Avalonia.Controls;
using Avalonia.Markup.Xaml;
namespace Material.Demo.Pages
@@ -16,4 +15,4 @@ namespace Material.Demo.Pages
AvaloniaXamlLoader.Load(this);
}
}
}
}
+2 -3
View File
@@ -1,5 +1,4 @@
using Avalonia;
using Avalonia.Controls;
using Avalonia.Controls;
using Avalonia.Markup.Xaml;
namespace Material.Demo.Pages
@@ -16,4 +15,4 @@ namespace Material.Demo.Pages
AvaloniaXamlLoader.Load(this);
}
}
}
}
+8
View File
@@ -37,6 +37,14 @@
assists:DatePickerAssist.DateTimeFormat="\M\y \for\ma\t MMM dd, yyyy"></DatePicker>
</showMeTheXaml:XamlDisplay>
</StackPanel>
<StackPanel Orientation="Vertical" VerticalAlignment="Bottom">
<TextBlock Text="Multiple selection"/>
<TextBlock Text="{Binding #DatePicker3.SelectedDate, FallbackValue=Not selected}" />
<showMeTheXaml:XamlDisplay UniqueId="DatePicker3">
<DatePicker Name="DatePicker3" Classes="multiselect"/>
</showMeTheXaml:XamlDisplay>
</StackPanel>
</StackPanel>
</StackPanel>
+8 -5
View File
@@ -1,14 +1,17 @@
using Avalonia;
using Avalonia.Controls;
using Avalonia.Markup.Xaml;
namespace Material.Demo.Pages {
public class PickersDemo : UserControl {
public PickersDemo() {
namespace Material.Demo.Pages
{
public class PickersDemo : UserControl
{
public PickersDemo()
{
InitializeComponent();
}
private void InitializeComponent() {
private void InitializeComponent()
{
AvaloniaXamlLoader.Load(this);
}
}
+15 -14
View File
@@ -5,6 +5,7 @@
mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450"
xmlns:styles="clr-namespace:Material.Styles;assembly=Material.Styles"
xmlns:showMeTheXaml="clr-namespace:ShowMeTheXaml;assembly=ShowMeTheXaml.Avalonia"
xmlns:controls="clr-namespace:Material.Styles.Controls;assembly=Material.Styles"
x:Class="Material.Demo.Pages.ProgressIndicatorDemo">
<StackPanel Margin="16, 0">
<TextBlock Classes="Headline4 Subheadline" Text="Progress Indicator" />
@@ -29,39 +30,39 @@
<ProgressBar Value="{Binding Progress}" />
</showMeTheXaml:XamlDisplay>
<showMeTheXaml:XamlDisplay UniqueId="ProgressIndicators4">
<ProgressBar Value="{Binding Progress}" Classes="notransitions" />
<ProgressBar Value="{Binding Progress}" Classes="no-transitions" />
</showMeTheXaml:XamlDisplay>
</StackPanel>
<StackPanel>
<TextBlock Classes="Headline6 Subheadline2" Text="Circular progress bars" />
<showMeTheXaml:XamlDisplay UniqueId="CircularProgressBar0">
<ProgressBar Classes="Circle" Value="30" Margin="4" />
<ProgressBar Classes="circular" Value="30" Margin="4" />
</showMeTheXaml:XamlDisplay>
<showMeTheXaml:XamlDisplay UniqueId="CircularProgressBar1">
<styles:Card CornerRadius="24" Padding="4" Margin="4" HorizontalAlignment="Center"
<controls:Card CornerRadius="24" Padding="4" Margin="4" HorizontalAlignment="Center"
VerticalAlignment="Center">
<ProgressBar Classes="Circle" Value="60" />
</styles:Card>
<ProgressBar Classes="circular" Value="60" />
</controls:Card>
</showMeTheXaml:XamlDisplay>
<showMeTheXaml:XamlDisplay UniqueId="CircularProgressBar2">
<styles:Card CornerRadius="24" Padding="4" Margin="4" HorizontalAlignment="Center"
<controls:Card CornerRadius="24" Padding="4" Margin="4" HorizontalAlignment="Center"
VerticalAlignment="Center">
<ProgressBar Classes="Circle" IsIndeterminate="True" />
</styles:Card>
<ProgressBar Classes="circular" IsIndeterminate="True" />
</controls:Card>
</showMeTheXaml:XamlDisplay>
<showMeTheXaml:XamlDisplay UniqueId="CircularProgressBar3">
<styles:Card CornerRadius="24" Padding="4" Margin="4" HorizontalAlignment="Center"
<controls:Card CornerRadius="24" Padding="4" Margin="4" HorizontalAlignment="Center"
VerticalAlignment="Center">
<ProgressBar Classes="Circle" Value="{Binding Progress}" />
</styles:Card>
<ProgressBar Classes="circular" Value="{Binding Progress}" />
</controls:Card>
</showMeTheXaml:XamlDisplay>
<showMeTheXaml:XamlDisplay UniqueId="CircularProgressBar4">
<styles:Card CornerRadius="24" Padding="4" Margin="4" HorizontalAlignment="Center"
<controls:Card CornerRadius="24" Padding="4" Margin="4" HorizontalAlignment="Center"
VerticalAlignment="Center"
HorizontalContentAlignment="Center" VerticalContentAlignment="Center">
<ProgressBar Classes="Circle notransitions" Value="{Binding Progress}" />
</styles:Card>
<ProgressBar Classes="circular no-transitions" Value="{Binding Progress}" />
</controls:Card>
</showMeTheXaml:XamlDisplay>
</StackPanel>
</WrapPanel>
@@ -1,21 +1,20 @@
using Avalonia;
using System.ComponentModel;
using System.Timers;
using Avalonia;
using Avalonia.Controls;
using Avalonia.Markup.Xaml;
using System.Collections.Specialized;
using System.ComponentModel;
using System.Threading.Tasks;
using System.Timers;
namespace Material.Demo.Pages
{
public class ProgressIndicatorDemo : UserControl
{
{
private Timer timer;
private int caseProgress;
public class Context : INotifyPropertyChanged
{
private double m_Progress = 0;
public double Progress
{
get => m_Progress;
@@ -34,7 +33,7 @@ namespace Material.Demo.Pages
public ProgressIndicatorDemo()
{
this.InitializeComponent();
timer = new Timer(1000);
timer.Elapsed += Timer_Elapsed;
@@ -45,7 +44,7 @@ namespace Material.Demo.Pages
private void ProgressIndicatorDemo_AttachedToVisualTree(object sender, VisualTreeAttachmentEventArgs e)
{
timer.Start();
timer.Start();
}
private void Timer_Elapsed(object sender, ElapsedEventArgs e)
@@ -55,7 +54,7 @@ namespace Material.Demo.Pages
private double SwitchProgress()
{
switch(caseProgress)
switch (caseProgress)
{
case 0:
caseProgress++;
@@ -86,4 +85,4 @@ namespace Material.Demo.Pages
AvaloniaXamlLoader.Load(this);
}
}
}
}
+8 -7
View File
@@ -6,10 +6,11 @@
xmlns:styles="clr-namespace:Material.Styles;assembly=Material.Styles"
xmlns:pages="clr-namespace:Material.Demo.Pages"
xmlns:showMeTheXaml="clr-namespace:ShowMeTheXaml;assembly=ShowMeTheXaml.Avalonia"
xmlns:controls="clr-namespace:Material.Styles.Controls;assembly=Material.Styles"
x:Class="Material.Demo.Pages.ScrollViewerDemo">
<StackPanel Margin="16, 0">
<StackPanel.Styles>
<Style Selector="styles|Card">
<Style Selector="controls|Card">
<Setter Property="Margin" Value="8" />
</Style>
</StackPanel.Styles>
@@ -19,13 +20,13 @@
<StackPanel>
<TextBlock Classes="Headline6 Subheadline2" Text="ScrollViewer with classic scrollbar" />
<showMeTheXaml:XamlDisplay UniqueId="ScrollViewer0">
<styles:Card Width="400" Height="300" VerticalAlignment="Top" Padding="0">
<controls:Card Width="400" Height="300" VerticalAlignment="Top" Padding="0">
<ScrollViewer HorizontalScrollBarVisibility="Visible"
VerticalScrollBarVisibility="Visible"
Classes="Classic">
<pages:Home />
</ScrollViewer>
</styles:Card>
</controls:Card>
</showMeTheXaml:XamlDisplay>
</StackPanel>
<StackPanel>
@@ -33,24 +34,24 @@
<showMeTheXaml:XamlDisplay UniqueId="ScrollViewer1">
<styles:Card Width="400" Height="300" VerticalAlignment="Top" Padding="0">
<controls:Card Width="400" Height="300" VerticalAlignment="Top" Padding="0">
<ScrollViewer HorizontalScrollBarVisibility="Visible"
VerticalScrollBarVisibility="Visible">
<pages:Home />
</ScrollViewer>
</styles:Card>
</controls:Card>
</showMeTheXaml:XamlDisplay>
</StackPanel>
<StackPanel>
<TextBlock Classes="Headline6 Subheadline2" Text="ScrollViewer with mini scrollbar" />
<showMeTheXaml:XamlDisplay UniqueId="ScrollViewer2">
<styles:Card Width="400" Height="300" VerticalAlignment="Top" Padding="0">
<controls:Card Width="400" Height="300" VerticalAlignment="Top" Padding="0">
<ScrollViewer HorizontalScrollBarVisibility="Visible"
VerticalScrollBarVisibility="Visible"
Classes="MiniBar">
<pages:Home />
</ScrollViewer>
</styles:Card>
</controls:Card>
</showMeTheXaml:XamlDisplay>
</StackPanel>
</WrapPanel>
@@ -1,5 +1,4 @@
using Avalonia;
using Avalonia.Controls;
using Avalonia.Controls;
using Avalonia.Markup.Xaml;
namespace Material.Demo.Pages
@@ -16,4 +15,4 @@ namespace Material.Demo.Pages
AvaloniaXamlLoader.Load(this);
}
}
}
}
+5 -4
View File
@@ -6,6 +6,7 @@
xmlns:pages="clr-namespace:Material.Demo.Pages"
xmlns:models="clr-namespace:Material.Demo.Models"
xmlns:avalonia="clr-namespace:Material.Icons.Avalonia;assembly=Material.Icons.Avalonia"
xmlns:controls="clr-namespace:Material.Styles.Controls;assembly=Material.Styles"
mc:Ignorable="d" d:DesignWidth="500" d:DesignHeight="450"
x:Class="Material.Demo.Pages.SideSheetDemo"
x:DataType="models:SideSheetDemoViewModel">
@@ -16,21 +17,21 @@
<StackPanel Margin="16, 0">
<TextBlock Classes="Headline4 Subheadline" Text="Side sheets" />
<styles:SideSheet
<controls:SideSheet
Name="SideSheet"
Width="500" Height="560" BorderBrush="Black" BorderThickness="1"
SideSheetDirection="Right"
SideSheetOpened="{CompiledBinding SideInfoOpened}"
SideSheetContent="{CompiledBinding Information}"
SideSheetHeader="{CompiledBinding Information.Header}">
<styles:SideSheet.SideSheetContentTemplate>
<controls:SideSheet.SideSheetContentTemplate>
<DataTemplate DataType="models:SideSheetData">
<StackPanel>
<TextBlock Classes="Headline6" Text="{CompiledBinding ContentHeader}"/>
<TextBlock Text="{CompiledBinding ImportantInfos}" TextWrapping="Wrap"></TextBlock>
</StackPanel>
</DataTemplate>
</styles:SideSheet.SideSheetContentTemplate>
</controls:SideSheet.SideSheetContentTemplate>
<Panel>
<pages:Home />
<Button Classes="Icon" Width="36" Height="36"
@@ -40,6 +41,6 @@
IsVisible="{Binding !#SideSheet.SideSheetOpened}"
Click="OpenSideInfoButton_OnClick" />
</Panel>
</styles:SideSheet>
</controls:SideSheet>
</StackPanel>
</UserControl>
+2 -3
View File
@@ -1,5 +1,4 @@
using Avalonia;
using Avalonia.Controls;
using Avalonia.Controls;
using Avalonia.Interactivity;
using Avalonia.Markup.Xaml;
using Material.Demo.Models;
@@ -36,4 +35,4 @@ namespace Material.Demo.Pages
vm.SideInfoOpened = true;
}
}
}
}
+171 -45
View File
@@ -3,17 +3,18 @@
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450"
xmlns:styles="clr-namespace:Material.Styles;assembly=Material.Styles"
xmlns:showMeTheXaml="clr-namespace:ShowMeTheXaml;assembly=ShowMeTheXaml.Avalonia"
x:Class="Material.Demo.Pages.SlidersDemo">
<StackPanel Margin="16, 0">
x:Class="Material.Demo.Pages.SlidersDemo" >
<StackPanel Margin="0, 0" >
<StackPanel.Styles>
<Style Selector="StackPanel.Content Slider">
<Setter Property="Width" Value="300" />
<Style Selector="StackPanel.Content Slider" >
<Setter Property="Maximum" Value="100" />
<Setter Property="Minimum" Value="0" />
</Style>
<Style Selector="StackPanel.Content TextBlock">
<Style Selector="StackPanel.Content Slider:horizontal" >
<Setter Property="Width" Value="300" />
</Style>
<Style Selector="StackPanel.Content > TextBlock">
<Setter Property="VerticalAlignment" Value="Center" />
<Setter Property="Margin" Value="16,0" />
<Setter Property="Text" Value="{Binding $parent.Children[0].Content.Value}" />
@@ -24,110 +25,235 @@
</StackPanel.Styles>
<TextBlock Classes="Headline4 Subheadline" Text="Sliders" />
<WrapPanel>
<StackPanel>
<TextBlock Classes="Headline6 Subheadline2" Text="Regular sliders" />
<TextBlock Classes="Headline6 Subheadline2" Text="Slider (Material v1, legacy)" />
<!-- lol this one are not enabled snap to tick,
when dragging thumb could contains a long numerics with decimal point. -->
<StackPanel Classes="Content" Orientation="Horizontal">
<showMeTheXaml:XamlDisplay UniqueId="RegularSlider0">
<Slider />
<Slider Classes="material-v1" ToolTip.Tip="Just show me my tooltip!" />
</showMeTheXaml:XamlDisplay>
<TextBlock MinWidth="120" />
</StackPanel>
<StackPanel Classes="Content" Orientation="Horizontal">
<showMeTheXaml:XamlDisplay UniqueId="RegularSlider1">
<Slider IsSnapToTickEnabled="True"
<StackPanel Classes="Content" Orientation="Horizontal" >
<showMeTheXaml:XamlDisplay UniqueId="RegularSlider1" >
<Slider Classes="material-v1"
IsSnapToTickEnabled="True"
TickFrequency="1" />
</showMeTheXaml:XamlDisplay>
<TextBlock />
</StackPanel>
<StackPanel Classes="Content" Orientation="Horizontal">
<showMeTheXaml:XamlDisplay UniqueId="RegularSlider2">
<Slider IsSnapToTickEnabled="True" Classes="Accent"
<StackPanel Classes="Content" Orientation="Horizontal" >
<showMeTheXaml:XamlDisplay UniqueId="RegularSlider2" >
<Slider Classes="material-v1 Accent"
IsSnapToTickEnabled="True"
TickFrequency="1" />
</showMeTheXaml:XamlDisplay>
<TextBlock />
</StackPanel>
<StackPanel Classes="Content" Orientation="Horizontal">
<showMeTheXaml:XamlDisplay UniqueId="RegularSlider3">
<Slider IsEnabled="False" Value="20" />
<StackPanel Classes="Content" Orientation="Horizontal" >
<showMeTheXaml:XamlDisplay UniqueId="RegularSlider3" >
<Slider Classes="material-v1 Accent"
IsEnabled="False" Value="20" />
</showMeTheXaml:XamlDisplay>
<TextBlock />
</StackPanel>
</StackPanel>
<StackPanel>
<TextBlock Classes="Headline6 Subheadline2" Text="Modern slider" />
<StackPanel Classes="Content" Orientation="Horizontal">
<showMeTheXaml:XamlDisplay UniqueId="ModernSlider0">
<TextBlock Classes="Headline6 Subheadline2" Text="Standard slider" />
<StackPanel Classes="Content" Orientation="Horizontal" >
<showMeTheXaml:XamlDisplay UniqueId="ModernSlider0" >
<Slider IsSnapToTickEnabled="True"
Classes="Modern"
Classes=""
TickFrequency="1" />
</showMeTheXaml:XamlDisplay>
<TextBlock />
</StackPanel>
<StackPanel Classes="Content" Orientation="Horizontal">
<showMeTheXaml:XamlDisplay UniqueId="ModernSlider1">
<StackPanel Classes="Content" Orientation="Horizontal" >
<showMeTheXaml:XamlDisplay UniqueId="ModernSlider1" >
<Slider IsSnapToTickEnabled="True"
Classes="Modern Accent"
Classes=" Accent"
TickFrequency="1" />
</showMeTheXaml:XamlDisplay>
<TextBlock />
</StackPanel>
<StackPanel Classes="Content" Orientation="Horizontal">
<showMeTheXaml:XamlDisplay UniqueId="ModernSlider2">
<StackPanel Classes="Content" Orientation="Horizontal" >
<showMeTheXaml:XamlDisplay UniqueId="ModernSlider2" >
<Slider IsSnapToTickEnabled="True"
Classes="Modern Ticks"
Classes=" Ticks"
TickFrequency="10" />
</showMeTheXaml:XamlDisplay>
<TextBlock />
</StackPanel>
<StackPanel Classes="Content" Orientation="Horizontal">
<showMeTheXaml:XamlDisplay UniqueId="ModernSlider3">
<StackPanel Classes="Content" Orientation="Horizontal" >
<showMeTheXaml:XamlDisplay UniqueId="ModernSlider3" >
<Slider IsEnabled="False" Value="20"
IsSnapToTickEnabled="True"
Classes="Modern Ticks"
TickFrequency="1" />
Classes=" Ticks"
TickFrequency="10" />
</showMeTheXaml:XamlDisplay>
<TextBlock />
</StackPanel>
</StackPanel>
<StackPanel>
<TextBlock Classes="Headline6 Subheadline2" Text="Sliders with bubble (Discrete)" />
<StackPanel Classes="Content" Orientation="Horizontal">
<showMeTheXaml:XamlDisplay UniqueId="BubbleSlider0">
<TextBlock Classes="Headline6 Subheadline2" Text="Discrete slider" />
<StackPanel Classes="Content" Orientation="Horizontal" >
<showMeTheXaml:XamlDisplay UniqueId="BubbleSlider0" >
<Slider IsSnapToTickEnabled="True"
Classes="Discrete"
Classes="material-v1 Discrete"
TickFrequency="1" />
</showMeTheXaml:XamlDisplay>
<TextBlock />
</StackPanel>
<StackPanel Classes="Content" Orientation="Horizontal">
<showMeTheXaml:XamlDisplay UniqueId="BubbleSlider1">
<StackPanel Classes="Content" Orientation="Horizontal" >
<showMeTheXaml:XamlDisplay UniqueId="BubbleSlider1" >
<Slider IsSnapToTickEnabled="True"
Classes="Modern Discrete"
Classes=" Discrete"
TickFrequency="10" />
</showMeTheXaml:XamlDisplay>
<TextBlock />
</StackPanel>
<StackPanel Classes="Content" Orientation="Horizontal">
<showMeTheXaml:XamlDisplay UniqueId="BubbleSlider2">
<StackPanel Classes="Content" Orientation="Horizontal" >
<showMeTheXaml:XamlDisplay UniqueId="BubbleSlider2" >
<Slider IsSnapToTickEnabled="True"
Classes="Modern Discrete Accent"
Classes=" Discrete Accent"
TickFrequency="10" />
</showMeTheXaml:XamlDisplay>
<TextBlock />
</StackPanel>
<StackPanel Classes="Content" Orientation="Horizontal">
<showMeTheXaml:XamlDisplay UniqueId="BubbleSlider3">
<StackPanel Classes="Content" Orientation="Horizontal" >
<showMeTheXaml:XamlDisplay UniqueId="BubbleSlider3" >
<Slider IsSnapToTickEnabled="True"
Classes="Modern Discrete Accent Ticks"
Classes=" Discrete Accent Ticks"
TickFrequency="10" />
</showMeTheXaml:XamlDisplay>
<TextBlock />
</StackPanel>
</StackPanel>
</WrapPanel>
<TextBlock Classes="Headline4 Subheadline" Text="Vertical sliders" />
<WrapPanel>
<WrapPanel.Styles>
<Style Selector="Slider" >
<Setter Property="Orientation" Value="Vertical" />
<Setter Property="Width" Value="NaN" />
<Setter Property="Height" Value="300" />
</Style>
</WrapPanel.Styles>
<StackPanel>
<TextBlock Classes="Headline6 Subheadline2" Text="Slider (Material v1, legacy)" />
<StackPanel Orientation="Horizontal" >
<StackPanel Classes="Content" Orientation="Horizontal" >
<showMeTheXaml:XamlDisplay UniqueId="RegularVSlider0" >
<Slider Classes="material-v1" />
</showMeTheXaml:XamlDisplay>
<TextBlock />
</StackPanel>
<StackPanel Classes="Content" Orientation="Horizontal" >
<showMeTheXaml:XamlDisplay UniqueId="RegularVSlider1" >
<Slider Classes="material-v1"
IsSnapToTickEnabled="True"
TickFrequency="1" />
</showMeTheXaml:XamlDisplay>
<TextBlock />
</StackPanel>
<StackPanel Classes="Content" Orientation="Horizontal" >
<showMeTheXaml:XamlDisplay UniqueId="RegularVSlider2" >
<Slider Classes="material-v1 Accent"
IsSnapToTickEnabled="True"
TickFrequency="1" />
</showMeTheXaml:XamlDisplay>
<TextBlock />
</StackPanel>
<StackPanel Classes="Content" Orientation="Horizontal" >
<showMeTheXaml:XamlDisplay UniqueId="RegularVSlider3" >
<Slider Classes="material-v1 Accent"
IsEnabled="False" Value="20" />
</showMeTheXaml:XamlDisplay>
<TextBlock />
</StackPanel>
</StackPanel>
</StackPanel>
<StackPanel>
<TextBlock Classes="Headline6 Subheadline2" Text="Standard slider" />
<StackPanel Orientation="Horizontal" >
<StackPanel Classes="Content" Orientation="Horizontal" >
<showMeTheXaml:XamlDisplay UniqueId="ModernVSlider0" >
<Slider IsSnapToTickEnabled="True"
Classes="Modern"
TickFrequency="1" />
</showMeTheXaml:XamlDisplay>
<TextBlock />
</StackPanel>
<StackPanel Classes="Content" Orientation="Horizontal" >
<showMeTheXaml:XamlDisplay UniqueId="ModernVSlider1" >
<Slider IsSnapToTickEnabled="True"
Classes="Modern Accent"
TickFrequency="1" />
</showMeTheXaml:XamlDisplay>
<TextBlock />
</StackPanel>
<StackPanel Classes="Content" Orientation="Horizontal" >
<showMeTheXaml:XamlDisplay UniqueId="ModernVSlider2" >
<Slider IsSnapToTickEnabled="True"
Classes="Modern Ticks"
TickFrequency="10" />
</showMeTheXaml:XamlDisplay>
<TextBlock />
</StackPanel>
<StackPanel Classes="Content" Orientation="Horizontal" >
<showMeTheXaml:XamlDisplay UniqueId="ModernVSlider3" >
<Slider IsEnabled="False" Value="20"
IsSnapToTickEnabled="True"
Classes="Modern Ticks"
TickFrequency="10" />
</showMeTheXaml:XamlDisplay>
<TextBlock />
</StackPanel>
</StackPanel>
</StackPanel>
<StackPanel>
<TextBlock Classes="Headline6 Subheadline2" Text="Discrete slider" />
<StackPanel Orientation="Horizontal" >
<StackPanel Classes="Content" Orientation="Horizontal" >
<showMeTheXaml:XamlDisplay UniqueId="BubbleVSlider0" >
<Slider IsSnapToTickEnabled="True"
Classes="material-v1 Discrete"
TickFrequency="1" />
</showMeTheXaml:XamlDisplay>
<TextBlock />
</StackPanel>
<StackPanel Classes="Content" Orientation="Horizontal" >
<showMeTheXaml:XamlDisplay UniqueId="BubbleVSlider1" >
<Slider IsSnapToTickEnabled="True"
Classes="Modern Discrete"
TickFrequency="10" />
</showMeTheXaml:XamlDisplay>
<TextBlock />
</StackPanel>
<StackPanel Classes="Content" Orientation="Horizontal" >
<showMeTheXaml:XamlDisplay UniqueId="BubbleVSlider2" >
<Slider IsSnapToTickEnabled="True"
Classes="Modern Discrete Accent"
TickFrequency="10" />
</showMeTheXaml:XamlDisplay>
<TextBlock />
</StackPanel>
<StackPanel Classes="Content" Orientation="Horizontal" >
<showMeTheXaml:XamlDisplay UniqueId="BubbleVSlider3" >
<Slider IsSnapToTickEnabled="True"
Classes="Modern Discrete Accent Ticks"
TickFrequency="10" />
</showMeTheXaml:XamlDisplay>
<TextBlock />
</StackPanel>
</StackPanel>
</StackPanel>
</WrapPanel>
</StackPanel>
</UserControl>
+2 -3
View File
@@ -1,5 +1,4 @@
using Avalonia;
using Avalonia.Controls;
using Avalonia.Controls;
using Avalonia.Markup.Xaml;
namespace Material.Demo.Pages
@@ -16,4 +15,4 @@ namespace Material.Demo.Pages
AvaloniaXamlLoader.Load(this);
}
}
}
}
+2 -3
View File
@@ -1,5 +1,4 @@
using Avalonia;
using Avalonia.Controls;
using Avalonia.Controls;
using Avalonia.Markup.Xaml;
namespace Material.Demo.Pages
@@ -16,4 +15,4 @@ namespace Material.Demo.Pages
AvaloniaXamlLoader.Load(this);
}
}
}
}
+5 -4
View File
@@ -7,6 +7,7 @@
xmlns:assist="clr-namespace:Material.Styles.Assists;assembly=Material.Styles"
xmlns:avalonia="clr-namespace:Material.Icons.Avalonia;assembly=Material.Icons.Avalonia"
xmlns:showMeTheXaml="clr-namespace:ShowMeTheXaml;assembly=ShowMeTheXaml.Avalonia"
xmlns:controls="clr-namespace:Material.Styles.Controls;assembly=Material.Styles"
x:Class="Material.Demo.Pages.TogglesDemo">
<StackPanel Margin="16, 0">
<TextBlock Classes="Headline4 Subheadline" Text="Toggles" />
@@ -140,7 +141,7 @@
</StackPanel.Styles>
<StackPanel Orientation="Vertical">
<showMeTheXaml:XamlDisplay UniqueId="RadioButtonsCard0">
<styles:Card Padding="0" InsideClipping="True">
<controls:Card Padding="0" InsideClipping="True">
<StackPanel Orientation="Horizontal">
<RadioButton Classes="Button" GroupName="3"
Content="{avalonia:MaterialIconExt Kind=FormatAlignLeft}" />
@@ -153,11 +154,11 @@
<RadioButton Classes="Button" GroupName="3"
Content="{avalonia:MaterialIconExt Kind=FormatAlignJustify}" />
</StackPanel>
</styles:Card>
</controls:Card>
</showMeTheXaml:XamlDisplay>
<showMeTheXaml:XamlDisplay UniqueId="RadioButtonsCard1">
<styles:Card Padding="0" InsideClipping="True" Margin="0,16,0,0">
<controls:Card Padding="0" InsideClipping="True" Margin="0,16,0,0">
<StackPanel Orientation="Horizontal">
<RadioButton Classes="Button Accent" GroupName="4"
Content="{avalonia:MaterialIconExt Kind=FormatAlignLeft}" />
@@ -168,7 +169,7 @@
<RadioButton Classes="Button Accent" GroupName="4"
Content="{avalonia:MaterialIconExt Kind=FormatAlignJustify}" />
</StackPanel>
</styles:Card>
</controls:Card>
</showMeTheXaml:XamlDisplay>
</StackPanel>
</StackPanel>
+2 -3
View File
@@ -1,5 +1,4 @@
using Avalonia;
using Avalonia.Controls;
using Avalonia.Controls;
using Avalonia.Markup.Xaml;
namespace Material.Demo.Pages
@@ -16,4 +15,4 @@ namespace Material.Demo.Pages
AvaloniaXamlLoader.Load(this);
}
}
}
}
+34 -19
View File
@@ -5,10 +5,11 @@
mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450"
xmlns:styles="clr-namespace:Material.Styles;assembly=Material.Styles"
xmlns:avalonia="clr-namespace:Material.Icons.Avalonia;assembly=Material.Icons.Avalonia"
xmlns:controls="clr-namespace:Material.Styles.Controls;assembly=Material.Styles"
x:Class="Material.Demo.Pages.TreeViewsDemo">
<StackPanel Margin="16, 0">
<StackPanel.Styles>
<Style Selector="styles|Card.ChildDemo">
<Style Selector="controls|Card.ChildDemo">
<Setter Property="Width" Value="320" />
<Setter Property="Height" Value="320" />
<Setter Property="Padding" Value="0" />
@@ -20,7 +21,7 @@
<WrapPanel>
<!-- Demos -->
<styles:Card Classes="ChildDemo">
<controls:Card Classes="ChildDemo">
<!-- TODO: StackPanel could ignore height of parent. -->
<Grid RowDefinitions="Auto, *">
<TextBlock Classes="Headline6" Margin="8" Text="Operation systems: " />
@@ -57,6 +58,15 @@
<TextBlock Text="Linux" Grid.Column="2" />
</Grid>
</TreeViewItem.Header>
<TreeViewItem>
<TreeViewItem.Header>
<Grid ColumnDefinitions="Auto, 8, *">
<avalonia:MaterialIcon Kind="Android" />
<TextBlock Text="Android" Grid.Column="2" />
</Grid>
</TreeViewItem.Header>
</TreeViewItem>
<TreeViewItem>
<TreeViewItem.Header>
@@ -66,14 +76,7 @@
</Grid>
</TreeViewItem.Header>
</TreeViewItem>
<TreeViewItem>
<TreeViewItem.Header>
<Grid ColumnDefinitions="Auto, 8, *">
<avalonia:MaterialIcon Kind="LinuxMint" />
<TextBlock Text="Mint Linux" Grid.Column="2" />
</Grid>
</TreeViewItem.Header>
</TreeViewItem>
<TreeViewItem>
<TreeViewItem.Header>
<Grid ColumnDefinitions="Auto, 8, *">
@@ -90,14 +93,7 @@
</Grid>
</TreeViewItem.Header>
</TreeViewItem>
<TreeViewItem>
<TreeViewItem.Header>
<Grid ColumnDefinitions="Auto, 8, *">
<avalonia:MaterialIcon Kind="Ubuntu" />
<TextBlock Text="Ubuntu" Grid.Column="2" />
</Grid>
</TreeViewItem.Header>
</TreeViewItem>
<TreeViewItem>
<TreeViewItem.Header>
<Grid ColumnDefinitions="Auto, 8, *">
@@ -105,11 +101,30 @@
<TextBlock Text="Debian" Grid.Column="2" />
</Grid>
</TreeViewItem.Header>
<TreeViewItem>
<TreeViewItem.Header>
<Grid ColumnDefinitions="Auto, 8, *">
<avalonia:MaterialIcon Kind="Ubuntu" />
<TextBlock Text="Ubuntu" Grid.Column="2" />
</Grid>
</TreeViewItem.Header>
<TreeViewItem>
<TreeViewItem.Header>
<Grid ColumnDefinitions="Auto, 8, *">
<avalonia:MaterialIcon Kind="LinuxMint" />
<TextBlock Text="Mint Linux" Grid.Column="2" />
</Grid>
</TreeViewItem.Header>
</TreeViewItem>
<TreeViewItem Header="Pop!_OS"/>
<TreeViewItem Header="Lubuntu"/>
<TreeViewItem Header="Zorin OS"/>
</TreeViewItem>
</TreeViewItem>
</TreeViewItem>
</TreeView>
</Grid>
</styles:Card>
</controls:Card>
</WrapPanel>
</StackPanel>
</UserControl>
+2 -3
View File
@@ -1,5 +1,4 @@
using Avalonia;
using Avalonia.Controls;
using Avalonia.Controls;
using Avalonia.Markup.Xaml;
namespace Material.Demo.Pages
@@ -16,4 +15,4 @@ namespace Material.Demo.Pages
AvaloniaXamlLoader.Load(this);
}
}
}
}
+2 -3
View File
@@ -1,5 +1,4 @@
using Avalonia;
using Avalonia.Controls;
using Avalonia.Controls;
using Avalonia.Markup.Xaml;
namespace Material.Demo.Pages
@@ -16,4 +15,4 @@ namespace Material.Demo.Pages
AvaloniaXamlLoader.Load(this);
}
}
}
}
+28 -10
View File
@@ -1,30 +1,48 @@
using Avalonia;
using System;
using Avalonia;
using Avalonia.Controls;
using ShowMeTheXaml;
namespace Material.Demo {
internal class Program {
namespace Material.Demo
{
internal class Program
{
public static MainWindow MainWindow { get; private set; }
// Initialization code. Don't use any Avalonia, third-party APIs or any
// SynchronizationContext-reliant code before AppMain is called: things aren't initialized
// yet and stuff might break.
public static void Main(string[] args) {
// STA thread is required for IME system.
[STAThread]
public static void Main(string[] args)
{
BuildAvaloniaApp().Start(AppMain, args);
}
// Avalonia configuration, don't remove; also used by visual designer.
public static AppBuilder BuildAvaloniaApp() {
public static AppBuilder BuildAvaloniaApp()
{
return AppBuilder.Configure<App>()
.UsePlatformDetect()
.UseXamlDisplay()
.LogToTrace();
.UsePlatformDetect()
.With(new X11PlatformOptions
{
EnableMultiTouch = true,
UseDBusMenu = true,
EnableIme = true
})
.With(new Win32PlatformOptions
{
EnableMultitouch = true
})
.UseXamlDisplay()
.LogToTrace();
}
// Your application's entry point. Here you can initialize your MVVM framework, DI
// container, etc.
private static void AppMain(Application app, string[] args) {
private static void AppMain(Application app, string[] args)
{
MainWindow = new MainWindow();
app.Run(MainWindow);
}
+40 -21
View File
@@ -3,64 +3,83 @@ using Avalonia;
using Avalonia.Controls;
using Avalonia.Controls.Metadata;
namespace Material.Demo {
namespace Material.Demo
{
[PseudoClasses("selectednow")]
public class SelectionWrapper : UserControl {
static SelectionWrapper() {
PointerPressedEvent.Raised.Subscribe(tuple => {
if (tuple.Item1 is SelectionWrapper selectionWrapper) {
public class SelectionWrapper : UserControl
{
static SelectionWrapper()
{
PointerPressedEvent.Raised.Subscribe(tuple =>
{
if (tuple.Item1 is SelectionWrapper selectionWrapper)
{
selectionWrapper.CurrentSelected = selectionWrapper.DataSource;
}
});
CurrentSelectedProperty.Changed.Subscribe(args => {
if (args.Sender is SelectionWrapper selectionWrapper) {
CurrentSelectedProperty.Changed.Subscribe(args =>
{
if (args.Sender is SelectionWrapper selectionWrapper)
{
selectionWrapper.UpdateSelectedNow();
}
});
SelectedNowProperty.Changed.Subscribe(args => {
if (args.Sender is SelectionWrapper selectionWrapper) {
if (args.NewValue.Value) {
SelectedNowProperty.Changed.Subscribe(args =>
{
if (args.Sender is SelectionWrapper selectionWrapper)
{
if (args.NewValue.Value)
{
selectionWrapper.PseudoClasses.Add(":selectednow");
}
else {
else
{
selectionWrapper.PseudoClasses.Remove(":selectednow");
}
}
});
}
protected override void OnDataContextEndUpdate() {
protected override void OnDataContextEndUpdate()
{
base.OnDataContextEndUpdate();
UpdateSelectedNow();
}
public void UpdateSelectedNow() {
public void UpdateSelectedNow()
{
SelectedNow = DataSource != null && DataSource == CurrentSelected;
}
public static readonly StyledProperty<object> DataSourceProperty = AvaloniaProperty.Register<SelectionWrapper, object>(nameof(DataSource));
public static readonly StyledProperty<object> DataSourceProperty =
AvaloniaProperty.Register<SelectionWrapper, object>(nameof(DataSource));
public object DataSource {
public object DataSource
{
get => GetValue(DataSourceProperty);
set => SetValue(DataSourceProperty, value);
}
public static readonly StyledProperty<object> CurrentSelectedProperty = AvaloniaProperty.Register<SelectionWrapper, object>(nameof(CurrentSelected));
public static readonly StyledProperty<object> CurrentSelectedProperty =
AvaloniaProperty.Register<SelectionWrapper, object>(nameof(CurrentSelected));
public object CurrentSelected {
public object CurrentSelected
{
get => GetValue(CurrentSelectedProperty);
set => SetValue(CurrentSelectedProperty, value);
}
public static readonly DirectProperty<SelectionWrapper, bool> SelectedNowProperty = AvaloniaProperty.RegisterDirect<SelectionWrapper, bool>(
nameof(SelectedNow),
wrapper => wrapper.CurrentSelected == wrapper.DataSource);
public static readonly DirectProperty<SelectionWrapper, bool> SelectedNowProperty =
AvaloniaProperty.RegisterDirect<SelectionWrapper, bool>(
nameof(SelectedNow),
wrapper => wrapper.CurrentSelected == wrapper.DataSource);
private bool _selectedNow;
public bool SelectedNow {
public bool SelectedNow
{
get => _selectedNow;
private set => SetAndRaise(SelectedNowProperty, ref _selectedNow, value);
}
@@ -14,7 +14,7 @@ namespace Material.Demo.ViewModels
_command = new RelayCommand(OnExecuteCommandHandler);
}
private readonly Func<IAsyncEnumerable<string>> _commandHandler;
private ICommand _command;
@@ -28,9 +28,9 @@ namespace Material.Demo.ViewModels
OnPropertyChanged();
}
}
private string _header;
public string Header
{
get => _header;
@@ -40,9 +40,9 @@ namespace Material.Demo.ViewModels
OnPropertyChanged();
}
}
private string? _result;
public string? Result
{
get => _result;
@@ -56,7 +56,7 @@ namespace Material.Demo.ViewModels
private async void OnExecuteCommandHandler(object arg)
{
Result = "Waiting result...";
var builder = new StringBuilder();
await foreach (var str in _commandHandler())
+83 -82
View File
@@ -1,33 +1,24 @@
using Material.Dialog;
using Avalonia.Controls;
using System;
using System;
using System.Collections.Generic;
using Avalonia;
using Avalonia.Controls;
using Avalonia.Media.Imaging;
using Avalonia.Platform;
using Material.Dialog;
using Material.Dialog.Enums;
namespace Material.Demo.ViewModels
{
public class DialogDemoViewModel : ViewModelBase
{
private DialogDemoItemViewModel[] _standaloneDialogItems;
private TimeSpan _previousTimePickerResult = TimeSpan.Zero;
private DateTime _previousDatePickerResult = DateTime.Now;
public DialogDemoItemViewModel[] StandaloneDialogItems
{
get => _standaloneDialogItems;
private set
{
_standaloneDialogItems = value;
OnPropertyChanged();
}
}
public DialogDemoItemViewModel[] StandaloneDialogItems { get; }
public DialogDemoViewModel()
{
StandaloneDialogItems = new []
StandaloneDialogItems = new[]
{
new DialogDemoItemViewModel("Simple Dialog", Dialog1),
new DialogDemoItemViewModel("Dialog with confirmation", Dialog2),
@@ -61,34 +52,7 @@ namespace Material.Demo.ViewModels
StartupLocation = WindowStartupLocation.CenterOwner,
NegativeResult = new DialogResult("cancel"),
DialogHeaderIcon = Dialog.Icons.DialogIconKind.Help,
DialogButtons = new []
{
new DialogButton
{
Content = "CANCEL",
Result = "cancel"
},
new DialogButton
{
Content = "DELETE",
Result = "delete"
}
}
}).ShowDialog(Program.MainWindow);
yield return $"Result: {result.GetResult}";
}
private async IAsyncEnumerable<string> Dialog3()
{
var result = await DialogHelper.CreateAlertDialog(new AlertDialogBuilderParams
{
ContentHeader = "Confirm action",
SupportingText = "Are you sure to DELETE 20 FILES?",
DialogHeaderIcon = Dialog.Icons.DialogIconKind.Help,
StartupLocation = WindowStartupLocation.CenterOwner,
NegativeResult = new DialogResult("cancel"),
Borderless = true,
DialogButtons = new []
DialogButtons = new[]
{
new DialogButton
{
@@ -102,10 +66,37 @@ namespace Material.Demo.ViewModels
}
}
}).ShowDialog(Program.MainWindow);
yield return $"Result: {result.GetResult}";
if(result.GetResult == "delete")
}
private async IAsyncEnumerable<string> Dialog3()
{
var result = await DialogHelper.CreateAlertDialog(new AlertDialogBuilderParams
{
ContentHeader = "Confirm action",
SupportingText = "Are you sure to DELETE 20 FILES?",
DialogHeaderIcon = Dialog.Icons.DialogIconKind.Help,
StartupLocation = WindowStartupLocation.CenterOwner,
NegativeResult = new DialogResult("cancel"),
Borderless = true,
DialogButtons = new[]
{
new DialogButton
{
Content = "CANCEL",
Result = "cancel"
},
new DialogButton
{
Content = "DELETE",
Result = "delete"
}
}
}).ShowDialog(Program.MainWindow);
yield return $"Result: {result.GetResult}";
if (result.GetResult == "delete")
{
await DialogHelper.CreateAlertDialog(new AlertDialogBuilderParams
{
@@ -117,24 +108,24 @@ namespace Material.Demo.ViewModels
}).ShowDialog(Program.MainWindow);
}
}
private async IAsyncEnumerable<string> Dialog4()
{
// Get AssetLoader service
var assets = AvaloniaLocator.Current.GetService<IAssetLoader>();
// Open asset stream using assets.Open method.
await using var icon = assets?.Open(new Uri("avares://Material.Demo/Assets/avalonia-logo.png"));
var dialog = DialogHelper.CreateAlertDialog(new AlertDialogBuilderParams
{
ContentHeader = "Welcome to use Material.Avalonia",
SupportingText = "Enjoy Material Design in AvaloniaUI!",
StartupLocation = WindowStartupLocation.CenterOwner,
StartupLocation = WindowStartupLocation.CenterOwner,
Borderless = true,
// Create Image control
DialogIcon = new Bitmap(icon),
NeutralDialogButtons = new []
NeutralDialogButtons = new[]
{
new DialogButton
{
@@ -144,7 +135,7 @@ namespace Material.Demo.ViewModels
}
});
var result = await dialog.ShowDialog(Program.MainWindow);
yield return $"Result: {result.GetResult}";
}
@@ -163,22 +154,22 @@ namespace Material.Demo.ViewModels
new TextFieldBuilderParams
{
HelperText = "* Required",
Classes = "Outline",
Classes = "outline",
Label = "Account",
MaxCountChars = 24,
Validater = ValidateAccount,
Validater = ValidateAccount,
},
new TextFieldBuilderParams
{
HelperText = "* Required",
Classes = "Outline",
Classes = "outline",
Label = "Password",
MaxCountChars = 64,
FieldKind = TextFieldKind.Masked,
Validater = ValidatePassword
}
},
DialogButtons = new []
DialogButtons = new[]
{
new DialogButton
{
@@ -194,24 +185,25 @@ namespace Material.Demo.ViewModels
}
}
}).ShowDialog(Program.MainWindow);
yield return $"Result: {result.GetResult}";
if (result.GetResult != "login")
yield break;
yield return $"Account: {result.GetFieldsResult()[0].Text}";
yield return $"Password: {result.GetFieldsResult()[1].Text}";
}
private Tuple<bool,string> ValidateAccount(string text)
private Tuple<bool, string> ValidateAccount(string text)
{
var result = text?.Length > 5;
var result = text.Length > 5;
return new Tuple<bool, string>(result, result ? "" : "Too few account name.");
}
private Tuple<bool, string> ValidatePassword(string text)
private Tuple<bool, string> ValidatePassword(string text)
{
var result = text?.Length >= 1;
var result = text.Length >= 1;
return new Tuple<bool, string>(result, result ? "" : "Field should be filled.");
}
@@ -226,15 +218,16 @@ namespace Material.Demo.ViewModels
Width = 400,
TextFields = new TextFieldBuilderParams[]
{
new TextFieldBuilderParams
new()
{
Label = "Folder name",
MaxCountChars = 256,
Validater = ValidatePassword,
DefaultText = "Folder1"
},
DefaultText = "Folder1",
HelperText = "* Required"
}
},
DialogButtons = new []
DialogButtons = new[]
{
new DialogButton
{
@@ -250,9 +243,9 @@ namespace Material.Demo.ViewModels
}
},
}).ShowDialog(Program.MainWindow);
yield return $"Result: {result.GetResult}";
if (result.GetResult == "rename")
{
yield return $"Folder name: {result.GetFieldsResult()[0].Text}";
@@ -266,23 +259,27 @@ namespace Material.Demo.ViewModels
Borderless = true,
StartupLocation = WindowStartupLocation.CenterOwner,
ImplicitValue = _previousTimePickerResult,
PositiveButton = new DialogButton
DialogButtons = new[]
{
Content = "CONFIRM",
Result = "confirm"
},
new DialogButton
{
Content = "CONFIRM",
Result = "confirm",
IsPositive = true
}
}
}).ShowDialog(Program.MainWindow);
yield return $"Result: {result.GetResult}";
if (result.GetResult != "confirm")
yield break;
var r = result.GetTimeSpan();
yield return $"TimeSpan: {r.ToString()}";
_previousTimePickerResult = r;
}
private async IAsyncEnumerable<string> DatePickerDialog()
{
var result = await DialogHelper.CreateDatePicker(new DatePickerDialogBuilderParams
@@ -290,22 +287,26 @@ namespace Material.Demo.ViewModels
Borderless = true,
StartupLocation = WindowStartupLocation.CenterOwner,
ImplicitValue = _previousDatePickerResult,
PositiveButton = new DialogButton
DialogButtons = new[]
{
Content = "CONFIRM",
Result = "confirm"
},
new DialogButton
{
Content = "CONFIRM",
Result = "confirm",
IsPositive = true
}
}
}).ShowDialog(Program.MainWindow);
yield return $"Result: {result.GetResult}";
if (result.GetResult != "confirm")
yield break;
var r = result.GetDate();
// ReSharper disable once SimplifyStringInterpolation
yield return $"TimeSpan: {r.ToString("d")}";
_previousDatePickerResult = r;
}
}
}
}
@@ -0,0 +1,28 @@
using System.Collections.ObjectModel;
using System.Text;
namespace Material.Demo.ViewModels
{
public class ExpanderDemoViewModel : ViewModelBase
{
public ObservableCollection<string> LoremText => _loremText;
private ObservableCollection<string> _loremText;
public ExpanderDemoViewModel()
{
_loremText = new ObservableCollection<string>();
var builder = new StringBuilder();
builder.Append("Lorem ipsum dolor sit amet, consectetur adipiscing elit. ");
builder.AppendLine("Suspendisse malesuada lacus ex, sit amet blandit leo lobortis eget.");
for (var i = 0; i < 10; i++)
{
LoremText.Add(builder.ToString());
}
builder.Clear();
}
}
}
+27 -15
View File
@@ -2,58 +2,69 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Reactive.Subjects;
using System.Threading.Tasks;
using Avalonia;
using Material.Demo.Models;
using Material.Icons;
namespace Material.Demo.ViewModels {
public class IconsDemoViewModel : ViewModelBase {
namespace Material.Demo.ViewModels
{
public class IconsDemoViewModel : ViewModelBase
{
private IEnumerable<MaterialIconKindGroup>? _kinds;
private Lazy<List<MaterialIconKindGroup>> _materialIconKinds;
private MaterialIconKindGroup? _selectedGroup;
private string? _searchText;
public IconsDemoViewModel() {
public IconsDemoViewModel()
{
_materialIconKinds = new Lazy<List<MaterialIconKindGroup>>(() =>
Enum.GetNames(typeof(MaterialIconKind))
.GroupBy(k => (MaterialIconKind) Enum.Parse(typeof(MaterialIconKind), k))
.Select(g => new MaterialIconKindGroup(g))
.OrderBy(x => x.Kind)
.ToList());
SearchCommand = new RelayCommand(async o => {
SearchCommand = new RelayCommand(async o =>
{
if (string.IsNullOrWhiteSpace(SearchText))
Kinds = _materialIconKinds.Value;
else {
else
{
Kinds = new List<MaterialIconKindGroup>();
Kinds = await Task.Run(() =>
_materialIconKinds.Value
.Where(x => x.Aliases.Any(a => a.IndexOf(SearchText, StringComparison.CurrentCultureIgnoreCase) >= 0))
.ToList());
.Where(x => x.Aliases.Any(a =>
a.IndexOf(SearchText, StringComparison.CurrentCultureIgnoreCase) >= 0))
.ToList());
}
});
}
public IEnumerable<MaterialIconKindGroup> Kinds {
public IEnumerable<MaterialIconKindGroup> Kinds
{
get => _kinds ?? _materialIconKinds.Value;
set {
set
{
_kinds = value;
OnPropertyChanged(nameof(Kinds));
}
}
public MaterialIconKindGroup? SelectedGroup {
public MaterialIconKindGroup? SelectedGroup
{
get => _selectedGroup;
set {
set
{
_selectedGroup = value;
OnPropertyChanged(nameof(SelectedGroup));
}
}
public string? SearchText {
public string? SearchText
{
get => _searchText;
set {
set
{
_searchText = value;
OnPropertyChanged(nameof(SearchText));
}
@@ -62,6 +73,7 @@ namespace Material.Demo.ViewModels {
public RelayCommand SearchCommand { get; set; }
public RelayCommand CopyToClipboardCommand { get; set; } =
new RelayCommand(o => Application.Current.Clipboard.SetTextAsync($"<avalonia:MaterialIcon Kind=\"{o}\" />"));
new RelayCommand(o =>
Application.Current.Clipboard.SetTextAsync($"<avalonia:MaterialIcon Kind=\"{o}\" />"));
}
}
+2 -5
View File
@@ -39,11 +39,8 @@ namespace Material.Demo.ViewModels
if (handler != null)
{
// Call CanExecute via Dispatcher.UIThread.Post to prevent CanExecute can't be called from other thread.
Dispatcher.UIThread.Post(delegate
{
handler?.Invoke(this, new EventArgs());
});
Dispatcher.UIThread.Post(delegate { handler?.Invoke(this, new EventArgs()); });
}
}
}
}
}
@@ -6,6 +6,7 @@ namespace Material.Demo.ViewModels
public class TextFieldsViewModel : ViewModelBase
{
private string _numerics;
public string Numerics
{
get => _numerics;
+2 -1
View File
@@ -1,5 +1,6 @@
using System.ComponentModel;
using System.Runtime.CompilerServices;
using System.Runtime.CompilerServices;
public class ViewModelBase : INotifyPropertyChanged
{
public event PropertyChangedEventHandler PropertyChanged;

Some files were not shown because too many files have changed in this diff Show More