Conversation
Format code Fix ProgressBar and Slider style issue
| } | ||
|
|
||
| public static T SetEnvironment<T,TValue>(this T view, Type type, string key, Binding<TValue> binding, bool cascades = true, ControlState state = ControlState.Default) | ||
| public static T SetEnvironment<T, TValue>(this T view, Type type, string key, Binding<TValue> binding, bool cascades = true, ControlState state = ControlState.Default) |
There was a problem hiding this comment.
In the future lets try and avoid white noise changes.
There was a problem hiding this comment.
It will be better to have some tools to format code in current code base.
| public const string TrackColor = "SliderTrackColor"; | ||
| public const string ProgressColor = "SliderProgressColor"; | ||
| public const string ThumbColor = "SliderThumbColor"; | ||
| public const string TrackColor = "MinimumTrackColor"; |
There was a problem hiding this comment.
Why are the values changing?
There was a problem hiding this comment.
Cause the MAUI API changed, you know the Comet.SourceGenerator project, the Slider class output file is this.
Microsoft.Maui.Graphics.Color Microsoft.Maui.ISlider.MinimumTrackColor => this.GetEnvironment<Microsoft.Maui.Graphics.Color>("MinimumTrackColor") ?? default;
Microsoft.Maui.Graphics.Color Microsoft.Maui.ISlider.MaximumTrackColor => this.GetEnvironment<Microsoft.Maui.Graphics.Color>("MaximumTrackColor") ?? default;
Microsoft.Maui.Graphics.Color Microsoft.Maui.ISlider.ThumbColor => this.GetEnvironment<Microsoft.Maui.Graphics.Color>("ThumbColor") ?? default;
Microsoft.Maui.IImageSource Microsoft.Maui.ISlider.ThumbImageSource => this.GetEnvironment<Microsoft.Maui.IImageSource>("ThumbImageSource") ?? default;
|
|
||
| public static class Button | ||
| { | ||
| public const string Padding = "Padding"; |
There was a problem hiding this comment.
Why is this being added to Button? The Padding stuff already exists on layout, and should work for any view.
There was a problem hiding this comment.
That is MAUI button Padding property, I think it should be different from the padding of layout?
| ProgressBar = new ProgressBarStyle | ||
| { | ||
| ProgressColor = colorPalette.P500, | ||
| TrackColor = colorPalette.P100, |
There was a problem hiding this comment.
Why is this being deleted?
There was a problem hiding this comment.
MAUI API changed, there's no TrackColor property in Progress class
| { | ||
| public class ProgressBarStyle : ViewStyle | ||
| { | ||
| public StyleAwareValue<ControlState, Color> TrackColor { get; set; } |
There was a problem hiding this comment.
Why is this being deleted?
There was a problem hiding this comment.
MAUI API changed, there's no TrackColor property in Progress class
|
|
||
| protected virtual void ApplyProgresBarStyle(ContextualObject view) | ||
| { | ||
| SetEnvironment(view, "", EnvironmentKeys.ProgressBar.TrackColor, ProgressBar?.TrackColor); |
There was a problem hiding this comment.
Why is this being deleted?
There was a problem hiding this comment.
same with above
Format code
Fix ProgressBar and Slider style issue
Add new way to apply style