optimized and add diagnostic feature

This commit is contained in:
2022-03-15 15:17:02 +08:00
parent 77b4e54734
commit 5b209cc19c
45 changed files with 380 additions and 122 deletions

View File

@ -244,4 +244,23 @@ namespace Billing.UI
throw new NotImplementedException();
}
}
public class TintColorConverter : IValueConverter
{
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
{
if (value is long l)
{
return l.IsTransparent() ?
BaseTheme.CurrentPrimaryColor :
l.ToColor();
}
return Color.Transparent;
}
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
{
throw new NotImplementedException();
}
}
}

View File

@ -9,6 +9,7 @@ namespace Billing.UI
{
public const string PrimaryColorKey = "PrimaryColor";
public const string DefaultIcon = "ic_default";
public const long TransparentColor = 0x00ffffffL;
public static partial (string main, long build) GetVersion();
public static partial string GetRegularFontFamily();

View File

@ -237,6 +237,13 @@ namespace Billing.UI
.Binding(Image.SourceProperty, nameof(ImageSource))
.Binding(TintHelper.TintColorProperty, nameof(TintColor)),
new Label
{
VerticalOptions = LayoutOptions.Center
}
.Binding(Label.TextProperty, nameof(Detail))
.DynamicResource(Label.TextColorProperty, BaseTheme.SecondaryTextColor),
new TintImage
{
HeightRequest = 20,