-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
More than one foreach on the same collection, using complex content, …
…resulted in duplicate generation of the collection item type, which again resulted in fields not being found.
- Loading branch information
Showing
6 changed files
with
83 additions
and
30 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,46 @@ | ||
{{ $foreach row in Rows }} | ||
{{ $foreach cell in cells }} | ||
{{ $if .$first }}**{{ $else }} {{ $end }}{{ $if $first }}|{{ $end }}{{ cell }}{{ $if $last }}|{{ $end }}{{ $if .$last }}**{{ $else }} {{ $end }} | ||
using Microsoft.Maui.Controls; | ||
using Microsoft.Maui.Graphics; | ||
using System; | ||
using System.Diagnostics; | ||
using System.Collections.Immutable; | ||
using Go.Themes; | ||
|
||
namespace {{ namespace }}; | ||
|
||
/// <summary> | ||
/// A collection of resources divided by Dark and Light themes. | ||
/// </summary> | ||
public partial class DesignSystem | ||
{ | ||
/// <summary> | ||
/// A list of themed <see cref="Color"/>s | ||
/// </summary> | ||
public static readonly ImmutableDictionary<string, ThemedItem<Color?>> Colors; | ||
|
||
/// <summary> | ||
/// A list of themed <see cref="Brush"/>es | ||
/// </summary> | ||
public static readonly ImmutableDictionary<string, ThemedItem<Brush?>> Brushes; | ||
|
||
static DesignSystem() | ||
{ | ||
Colors = ImmutableDictionary.Create<string, ThemedItem<Color?>>(StringComparer.Ordinal) | ||
{{ $foreach color in colors }} | ||
{{ $if hasWarning }} | ||
#warning {{ warning }} | ||
{{ $end }} | ||
.Add("{{ key }}", new ThemedItem<Color?>(new Color({{ darkR }}, {{ darkG }}, {{ darkB }}, {{ darkA }}), new Color({{ lightR }}, {{ lightG }}, {{ lightB }}, {{ lightA }}))){{ $if $last }};{{ $end }} // #{{ darkA }}{{ darkR }}{{ darkG }}{{ darkB }} #{{ lightA }}{{ lightR }}{{ lightG }}{{ lightB }} | ||
{{ $next }} | ||
Brushes = ImmutableDictionary.Create<string, ThemedItem<Brush?>>(StringComparer.Ordinal) | ||
{{ $foreach color in colors }} | ||
.Add("{{ key }}", new ThemedItem<Brush?>(new SolidColorBrush(new Color({{ darkR }}, {{ darkG }}, {{ darkB }}, {{ darkA }})), new SolidColorBrush(new Color({{ lightR }}, {{ lightG }}, {{ lightB }}, {{ lightA }})))){{ $if $last }};{{ $end }} // #{{ darkA }}{{ darkR }}{{ darkG }}{{ darkB }} #{{ lightA }}{{ lightR }}{{ lightG }}{{ lightB }} | ||
{{ $next }} | ||
|
||
{{ $if hasBadKeys }} | ||
Debug.WriteLine("Problematic DesignSystem resource keys:"); | ||
{{ $end }} | ||
{{ $foreach key in badKeys }} | ||
Debug.WriteLine(" - {{ name }}: {{ reason }}"); | ||
{{ $next }} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
1.3.3-alpha | ||
1.3.4-alpha |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters