Skip to content

Commit

Permalink
Fix warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
albi005 committed Apr 7, 2023
1 parent 415db74 commit 2eecbe2
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
2 changes: 2 additions & 0 deletions MaterialColorUtilities.Maui/MaterialColorService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -242,11 +242,13 @@ private void Update()
else
{
// We have to use reflection to access the generated method with the correct return type.
#pragma warning disable IL2060 // Can not statically analyze for trimming
SchemeMaui = (TSchemeMaui)typeof(TSchemeInt)
.GetMethods()
.Where(m => m.Name == nameof(Scheme<int>.Convert))
.ToList()[0]
.MakeGenericMethod(typeof(Color))
#pragma warning restore IL2060
.Invoke(SchemeInt, new object[] { (Func<uint, Color>)Color.FromUint })!;
}

Expand Down
6 changes: 4 additions & 2 deletions Playground/Playground.Maui/ViewModels/ThemeViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ public Style Style
Style.Content
};

public Color OnSeed => _t < 49.6 ? Colors.White : Colors.Black;
public Color OnSeed => T < 49.6 ? Colors.White : Colors.Black;

public ThemeViewModel(CustomMaterialColorService colorService, IOptions<MaterialColorOptions> options)
{
Expand Down Expand Up @@ -88,9 +88,11 @@ void SetFromSeed()
{
Seed = Color.FromUint(_colorService.Seed);
Hct hct = Hct.FromInt(_colorService.Seed);
#pragma warning disable MVVMTK0034 // Direct field reference to [ObservableProperty] backing field
// It works, I don't care
_h = hct.Hue;
_c = hct.Chroma;
_t = hct.Tone;
OnPropertyChanged("");
#pragma warning restore MVVMTK0034 // Direct field reference to [ObservableProperty] backing field
}
}

0 comments on commit 2eecbe2

Please sign in to comment.