omg
continuous-integration/drone/push Build is failing Details

test_old_branch
Jérémy Mouyon 11 months ago
parent 3f09e8e15f
commit 471679c332

@ -11,7 +11,7 @@ namespace Qwirkle.Converters
string colorstring = (string)value;
if(string.IsNullOrWhiteSpace(colorstring)) return Colors.Transparent;
if (string.IsNullOrWhiteSpace(colorstring)) return Colors.Transparent;
if (colorstring == "Yellow") return Colors.Yellow;
if (colorstring == "Red") return Colors.Red;
@ -30,4 +30,22 @@ namespace Qwirkle.Converters
throw new NotImplementedException();
}
}
public class RoundToVisibilityConverter : IValueConverter
{
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
{
if (value is not string)
return false;
string sh = (string)value;
return sh == "Round";
}
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
{
throw new NotSupportedException();
}
}
}

@ -7,6 +7,7 @@
x:Name="root">
<ContentView.Resources>
<conv:Int2ColorConverter x:Key="int2ColorConverter"/>
<conv:RoundToVisibilityConverter x:Key="roundToVisibilityConverter"/>
</ContentView.Resources>
<Grid>
<Label Text="{Binding Shape, Source={x:Reference root}}"></Label>
@ -20,9 +21,11 @@
BackgroundColor="Transparent"/>
<Ellipse HeightRequest="50"
WidthRequest="50"
BackgroundColor="{Binding Color, Source={x:Reference root}, Converter={StaticResource int2ColorConverter}}"
Fill="{Binding Color, Source={x:Reference root}, Converter={StaticResource int2ColorConverter}}"
VerticalOptions="Center"
HorizontalOptions="Center"/>
HorizontalOptions="Center"
IsVisible="{Binding Shape, Source={x:Reference root}, Converter={StaticResource roundToVisibilityConverter}}" />
</Grid>
</ContentView>
Loading…
Cancel
Save