From 3f09e8e15f1644f65ab414e7b7df300069c5fe26 Mon Sep 17 00:00:00 2001 From: "jeremy.mouyon" Date: Sat, 1 Jun 2024 12:47:06 +0200 Subject: [PATCH] good start --- Qwirkle/QwirkleViews/Views/TileCircle.xaml | 5 ++--- Qwirkle/QwirkleViews/Views/TileCircle.xaml.cs | 9 ++++++++- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/Qwirkle/QwirkleViews/Views/TileCircle.xaml b/Qwirkle/QwirkleViews/Views/TileCircle.xaml index d31ed0a..7edc29f 100644 --- a/Qwirkle/QwirkleViews/Views/TileCircle.xaml +++ b/Qwirkle/QwirkleViews/Views/TileCircle.xaml @@ -20,10 +20,9 @@ BackgroundColor="Transparent"/> - - + \ No newline at end of file diff --git a/Qwirkle/QwirkleViews/Views/TileCircle.xaml.cs b/Qwirkle/QwirkleViews/Views/TileCircle.xaml.cs index 3e65540..0d32df2 100644 --- a/Qwirkle/QwirkleViews/Views/TileCircle.xaml.cs +++ b/Qwirkle/QwirkleViews/Views/TileCircle.xaml.cs @@ -38,7 +38,7 @@ public partial class TileCircle : ContentView } public static readonly BindableProperty ColorProperty = - BindableProperty.Create("Color", typeof(string), typeof(TileCircle), ""); + BindableProperty.Create(nameof(Color), typeof(string), typeof(TileCircle), "", propertyChanged: OnColorChanged); public string Color { @@ -46,6 +46,13 @@ public partial class TileCircle : ContentView set => SetValue(ColorProperty, value); } + private static void OnColorChanged(BindableObject bindable, object oldValue, object newValue) + { + var bin = (TileCircle)bindable; + bin.OnPropertyChanged(nameof(Color)); + } + + public static readonly BindableProperty ShapeProperty = BindableProperty.Create("Shape", typeof(string), typeof(TileCircle), "");