diff --git a/Directory.Build.props b/Directory.Build.props
deleted file mode 100644
index ae8bdf5..0000000
--- a/Directory.Build.props
+++ /dev/null
@@ -1,6 +0,0 @@
-
-
- enable
- 11.0.0
-
-
diff --git a/FlowerApp/App.xaml b/FlowerApp/App.xaml
deleted file mode 100644
index 715938f..0000000
--- a/FlowerApp/App.xaml
+++ /dev/null
@@ -1,16 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/FlowerApp/App.xaml.cs b/FlowerApp/App.xaml.cs
deleted file mode 100644
index 1b612c3..0000000
--- a/FlowerApp/App.xaml.cs
+++ /dev/null
@@ -1,11 +0,0 @@
-namespace Blahblah.FlowerApp;
-
-public partial class App : Application
-{
- public App()
- {
- InitializeComponent();
-
- MainPage = new AppShell();
- }
-}
\ No newline at end of file
diff --git a/FlowerApp/AppShell.xaml b/FlowerApp/AppShell.xaml
deleted file mode 100644
index 9f45c91..0000000
--- a/FlowerApp/AppShell.xaml
+++ /dev/null
@@ -1,25 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/FlowerApp/AppShell.xaml.cs b/FlowerApp/AppShell.xaml.cs
deleted file mode 100644
index 2d7dbd4..0000000
--- a/FlowerApp/AppShell.xaml.cs
+++ /dev/null
@@ -1,13 +0,0 @@
-using Blahblah.FlowerApp.Views.Garden;
-
-namespace Blahblah.FlowerApp;
-
-public partial class AppShell : Shell
-{
- public AppShell()
- {
- InitializeComponent();
-
- //Routing.RegisterRoute("Garden/AddFlower", typeof(AddFlowerPage));
- }
-}
\ No newline at end of file
diff --git a/FlowerApp/Controls/AppContentPage.cs b/FlowerApp/Controls/AppContentPage.cs
deleted file mode 100644
index 2a084a0..0000000
--- a/FlowerApp/Controls/AppContentPage.cs
+++ /dev/null
@@ -1,226 +0,0 @@
-using Blahblah.FlowerApp.Data;
-using Microsoft.Extensions.Logging;
-using static Blahblah.FlowerApp.Extensions;
-
-namespace Blahblah.FlowerApp;
-
-public abstract class AppContentPage : ContentPage, ILoggerContent
-{
- public ILogger Logger { get; } = null!;
-
- public FlowerDatabase Database { get; } = null!;
-
- protected AppContentPage(FlowerDatabase database, ILogger logger)
- {
- Database = database;
- Logger = logger;
- }
-
- protected T GetValue(BindableProperty property)
- {
- return (T)GetValue(property);
- }
-
- bool hasLoading = true;
- ContentView? loading;
-
-#if IOS
- private async Task DoLoading(bool flag)
-#else
- private Task DoLoading(bool flag)
-#endif
- {
- if (loading == null && hasLoading)
- {
- try
- {
- loading = (ContentView)FindByName("loading");
- }
- catch
- {
- hasLoading = false;
- }
- }
- if (loading != null)
- {
- if (flag)
- {
-#if IOS
- loading.IsVisible = true;
- await loading.FadeTo(1, easing: Easing.CubicOut);
-#else
- loading.Opacity = 1;
- loading.IsVisible = true;
-#endif
- }
- else
- {
-#if IOS
- await loading.FadeTo(0, easing: Easing.CubicIn);
- loading.IsVisible = false;
-#else
- loading.IsVisible = false;
- loading.Opacity = 0;
-#endif
- }
- }
-#if ANDROID
- return Task.CompletedTask;
-#endif
- }
-
- protected Task Loading(bool flag)
- {
- IsBusy = flag;
-
- if (MainThread.IsMainThread)
- {
- return DoLoading(flag);
- }
-
- var source = new TaskCompletionSource();
- MainThread.BeginInvokeOnMainThread(async () =>
- {
- await DoLoading(flag);
- source.TrySetResult();
- });
- return source.Task;
- }
-
- async Task GetLastLocationAsyncInternal()
- {
- try
- {
- var location = await Geolocation.Default.GetLastKnownLocationAsync();
- return location;
- }
- catch (FeatureNotSupportedException fnsEx)
- {
- this.LogError(fnsEx, $"Not supported on device, {fnsEx.Message}.");
- }
- catch (FeatureNotEnabledException fneEx)
- {
- this.LogError(fneEx, $"Not enabled on device, {fneEx.Message}.");
- }
- catch (PermissionException)
- {
- this.LogWarning($"User denied.");
- }
- catch (Exception ex)
- {
- this.LogError(ex, $"Error occurs while getting cached location, {ex.Message}");
- }
- return null;
- }
-
- protected Task GetLastLocationAsync()
- {
- if (MainThread.IsMainThread)
- {
- return GetLastLocationAsyncInternal();
- }
- var source = new TaskCompletionSource();
- MainThread.BeginInvokeOnMainThread(async () =>
- {
- var location = await GetLastLocationAsyncInternal();
- source.TrySetResult(location);
- });
- return source.Task;
- }
-
- TaskCompletionSource? locationTaskSource;
- CancellationTokenSource? locationCancellationTokenSource;
-
- async Task GetCurrentLocationAsyncInternal()
- {
- if (locationTaskSource == null)
- {
- locationTaskSource = new TaskCompletionSource();
-
- try
- {
- var request = new GeolocationRequest(GeolocationAccuracy.Best, TimeSpan.FromSeconds(10));
-#if IOS
- request.RequestFullAccuracy = true;
-#endif
-
- locationCancellationTokenSource = new CancellationTokenSource();
-
- var location = await Geolocation.Default.GetLocationAsync(request, locationCancellationTokenSource.Token);
- locationTaskSource.SetResult(location);
- }
- catch (Exception ex)
- {
- this.LogError(ex, $"Error occurs while getting current location, {ex.Message}");
- }
- }
-
- return await locationTaskSource.Task;
- }
-
- protected Task GetCurrentLocationAsync()
- {
- if (MainThread.IsMainThread)
- {
- return GetCurrentLocationAsyncInternal();
- }
- var source = new TaskCompletionSource();
- MainThread.BeginInvokeOnMainThread(async () =>
- {
- var location = await GetCurrentLocationAsyncInternal();
- source.TrySetResult(location);
- });
- return source.Task;
- }
-
- protected void CancelRequestLocation()
- {
- if (locationCancellationTokenSource?.IsCancellationRequested == false)
- {
- locationCancellationTokenSource.Cancel();
- }
- }
-
- async Task TakePhotoInternal()
- {
- var status = await Permissions.CheckStatusAsync();
-
- if (status == PermissionStatus.Denied)
- {
- await this.AlertError(L("needCameraPermission", "Flower Story needs access to the camera to take photos."));
-#if IOS
- var settingsUrl = UIKit.UIApplication.OpenSettingsUrlString;
- await Launcher.TryOpenAsync(settingsUrl);
-#endif
- return null;
- }
-
- if (status != PermissionStatus.Granted)
- {
- status = await Permissions.RequestAsync();
- }
-
- if (status != PermissionStatus.Granted)
- {
- return null;
- }
-
- var file = await MediaPicker.Default.CapturePhotoAsync();
- return file;
- }
-
- protected Task TakePhoto()
- {
- if (MainThread.IsMainThread)
- {
- return TakePhotoInternal();
- }
- var source = new TaskCompletionSource();
- MainThread.BeginInvokeOnMainThread(async () =>
- {
- var file = await TakePhotoInternal();
- source.TrySetResult(file);
- });
- return source.Task;
- }
-}
diff --git a/FlowerApp/Controls/AppConverters.cs b/FlowerApp/Controls/AppConverters.cs
deleted file mode 100644
index 33e5236..0000000
--- a/FlowerApp/Controls/AppConverters.cs
+++ /dev/null
@@ -1,41 +0,0 @@
-using System.Globalization;
-
-namespace Blahblah.FlowerApp;
-
-class VisibleIfNotNullConverter : IValueConverter
-{
- public object? Convert(object? value, Type targetType, object? parameter, CultureInfo culture)
- {
- if (value is string s)
- {
- return !string.IsNullOrEmpty(s);
- }
- return value != null;
- }
-
- public object? ConvertBack(object? value, Type targetType, object? parameter, CultureInfo culture)
- {
- throw new NotImplementedException();
- }
-}
-
-
-class DateTimeStringConverter : IValueConverter
-{
- public string Format { get; init; } = "MM/dd HH:mm:ss";
-
- public object? Convert(object? value, Type targetType, object? parameter, CultureInfo culture)
- {
- if (value is long time)
- {
- var date = DateTimeOffset.FromUnixTimeMilliseconds(time);
- return date.ToLocalTime().ToString(Format);
- }
- return value;
- }
-
- public object? ConvertBack(object? value, Type targetType, object? parameter, CultureInfo culture)
- {
- throw new NotImplementedException();
- }
-}
\ No newline at end of file
diff --git a/FlowerApp/Controls/AppResources.cs b/FlowerApp/Controls/AppResources.cs
deleted file mode 100644
index 794b992..0000000
--- a/FlowerApp/Controls/AppResources.cs
+++ /dev/null
@@ -1,29 +0,0 @@
-using Blahblah.FlowerApp.Data.Model;
-using static Blahblah.FlowerApp.Extensions;
-
-namespace Blahblah.FlowerApp;
-
-internal class AppResources
-{
- public const string EmptyCover = "empty_flower.jpg";
-
- public const int EmptyUserId = -1;
-
- public static readonly Size EmptySize = new(512, 339);
-
- static readonly UserItem emptyUser = new()
- {
- Id = EmptyUserId,
- Name = L("guest", "Guest")
- };
- static UserItem? user;
-
- public static UserItem User => user ?? emptyUser;
-
- public static bool IsLogined => user != null;
-
- public static void SetUser(UserItem user)
- {
- AppResources.user = user;
- }
-}
diff --git a/FlowerApp/Controls/FlowerClientItem.cs b/FlowerApp/Controls/FlowerClientItem.cs
deleted file mode 100644
index 5c12f57..0000000
--- a/FlowerApp/Controls/FlowerClientItem.cs
+++ /dev/null
@@ -1,63 +0,0 @@
-using Blahblah.FlowerApp.Data.Model;
-using static Blahblah.FlowerApp.Extensions;
-
-namespace Blahblah.FlowerApp.Controls;
-
-public class FlowerClientItem : BindableObject
-{
- static readonly BindableProperty NameProperty = CreateProperty(nameof(Name));
- static readonly BindableProperty CategoryIdProperty = CreateProperty(nameof(CategoryId));
- static readonly BindableProperty DaysProperty = CreateProperty(nameof(Days));
- static readonly BindableProperty CoverProperty = CreateProperty(nameof(Cover));
- static readonly BindableProperty BoundsProperty = CreateProperty(nameof(Bounds));
-
- public int Id { get; }
- public FlowerItem? FlowerItem { get; }
-
- public string Name
- {
- get => (string)GetValue(NameProperty);
- set => SetValue(NameProperty, value);
- }
- public int CategoryId
- {
- get => (int)GetValue(CategoryIdProperty);
- set => SetValue(CategoryIdProperty, value);
- }
- public string Days
- {
- get => (string)GetValue(DaysProperty);
- set => SetValue(DaysProperty, value);
- }
- public ImageSource? Cover
- {
- get => (ImageSource?)GetValue(CoverProperty);
- set => SetValue(CoverProperty, value);
- }
- public Rect Bounds
- {
- get => (Rect)GetValue(BoundsProperty);
- set => SetValue(BoundsProperty, value);
- }
-
- public int? Width { get; set; }
- public int? Height { get; set; }
-
- public FlowerClientItem(int id)
- {
- Id = id;
- }
-
- public FlowerClientItem(FlowerItem item) : this(item.Id)
- {
- FlowerItem = item;
- Name = item.Name;
- CategoryId = item.CategoryId;
-
- if (item.Photos?.Length > 0 && item.Photos[0] is PhotoItem cover)
- {
- Width = cover.Width;
- Height = cover.Height;
- }
- }
-}
diff --git a/FlowerApp/Controls/ILoggerContent.cs b/FlowerApp/Controls/ILoggerContent.cs
deleted file mode 100644
index d819967..0000000
--- a/FlowerApp/Controls/ILoggerContent.cs
+++ /dev/null
@@ -1,11 +0,0 @@
-using Blahblah.FlowerApp.Data;
-using Microsoft.Extensions.Logging;
-
-namespace Blahblah.FlowerApp;
-
-public interface ILoggerContent
-{
- public ILogger Logger { get; }
-
- public FlowerDatabase Database { get; }
-}
diff --git a/FlowerApp/Controls/ItemSearchHandler.cs b/FlowerApp/Controls/ItemSearchHandler.cs
deleted file mode 100644
index 75780a0..0000000
--- a/FlowerApp/Controls/ItemSearchHandler.cs
+++ /dev/null
@@ -1,34 +0,0 @@
-using Blahblah.FlowerApp.Controls;
-using static Blahblah.FlowerApp.Extensions;
-
-namespace Blahblah.FlowerApp;
-
-public class ItemSearchHandler : SearchHandler
-{
- public static readonly BindableProperty FlowersProperty = CreateProperty(nameof(Flowers));
-
- public FlowerClientItem[] Flowers
- {
- get => (FlowerClientItem[])GetValue(FlowersProperty);
- set => SetValue(FlowersProperty, value);
- }
-
- protected override void OnQueryChanged(string oldValue, string newValue)
- {
- base.OnQueryChanged(oldValue, newValue);
-
- if (string.IsNullOrWhiteSpace(newValue))
- {
- ItemsSource = null;
- }
- else
- {
- ItemsSource = Flowers?.Where(f => f.Name.Contains(newValue, StringComparison.OrdinalIgnoreCase)).ToList();
- }
- }
-
- protected override void OnItemSelected(object item)
- {
- base.OnItemSelected(item);
- }
-}
diff --git a/FlowerApp/Controls/ItemSelectorPage.cs b/FlowerApp/Controls/ItemSelectorPage.cs
deleted file mode 100644
index cd86d1d..0000000
--- a/FlowerApp/Controls/ItemSelectorPage.cs
+++ /dev/null
@@ -1,124 +0,0 @@
-using static Blahblah.FlowerApp.Extensions;
-
-namespace Blahblah.FlowerApp.Controls;
-
-class ItemSelectorPage : ContentPage where T : IdTextItem
-{
- public EventHandler? Selected;
-
- public ItemSelectorPage(string title, T[] source, bool multiple = false, K[]? selected = null, string display = nameof(IdTextItem.Text), string? detail = null)
- {
- Title = title;
-
- var itemsSource = source.Select(t => new SelectableItem
- {
- Item = t,
- IsSelected = selected != null && selected.Contains(t.Id)
- }).ToArray();
-
- var list = new ListView
- {
- SelectionMode = ListViewSelectionMode.None,
- ItemsSource = itemsSource,
- ItemTemplate = new DataTemplate(() =>
- {
- var content = new Grid
- {
- Margin = new Thickness(12, 0),
- ColumnSpacing = 12,
- ColumnDefinitions =
- {
- new(30),
- new(GridLength.Star),
- new(GridLength.Auto)
- },
- Children =
- {
- new SecondaryLabel
- {
- VerticalOptions = LayoutOptions.Center,
- HorizontalOptions = LayoutOptions.Center,
- Text = Res.Check,
- FontFamily = "FontAwesome"
- }
- .Binding(IsVisibleProperty, nameof(SelectableItem.IsSelected)),
-
- new Label
- {
- VerticalOptions = LayoutOptions.Center
- }
- .Binding(Label.TextProperty, $"{nameof(SelectableItem.Item)}.{display}")
- .GridColumn(1)
- }
- };
- if (detail != null)
- {
- content.Children.Add(
- new SecondaryLabel
- {
- VerticalOptions = LayoutOptions.Center
- }
- .Binding(Label.TextProperty, $"{nameof(SelectableItem.Item)}.{detail}")
- .GridColumn(2));
- }
- return new ViewCell
- {
- View = content
- };
- })
- };
-
- list.ItemTapped += List_ItemTapped;
-
- Content = list;
- }
-
- private async void List_ItemTapped(object? sender, ItemTappedEventArgs e)
- {
- if (e.Item is SelectableItem item)
- {
- Selected?.Invoke(this, item.Item);
- await Navigation.PopAsync();
- }
- }
-}
-
-class SelectableItem : BindableObject
-{
- public static BindableProperty IsSelectedProperty = CreateProperty>(nameof(IsSelected));
- public static BindableProperty ItemProperty = CreateProperty>(nameof(Item));
-
- public bool IsSelected
- {
- get => (bool)GetValue(IsSelectedProperty);
- set => SetValue(IsSelectedProperty, value);
- }
- public T Item
- {
- get => (T)GetValue(ItemProperty);
- set => SetValue(ItemProperty, value);
- }
-}
-
-class IdTextItem : BindableObject
-{
- public static BindableProperty IdProperty = CreateProperty>(nameof(Id));
- public static BindableProperty TextProperty = CreateProperty>(nameof(Text));
- public static BindableProperty DetailProperty = CreateProperty>(nameof(Detail));
-
- public T Id
- {
- get => (T)GetValue(IdProperty);
- set => SetValue(IdProperty, value);
- }
- public string Text
- {
- get => (string)GetValue(TextProperty);
- set => SetValue(TextProperty, value);
- }
- public string? Detail
- {
- get => (string?)GetValue(DetailProperty);
- set => SetValue(DetailProperty, value);
- }
-}
\ No newline at end of file
diff --git a/FlowerApp/Controls/OptionCell.cs b/FlowerApp/Controls/OptionCell.cs
deleted file mode 100644
index 26791f2..0000000
--- a/FlowerApp/Controls/OptionCell.cs
+++ /dev/null
@@ -1,351 +0,0 @@
-using System.ComponentModel;
-using static Blahblah.FlowerApp.Extensions;
-using static System.Runtime.InteropServices.JavaScript.JSType;
-
-namespace Blahblah.FlowerApp.Controls;
-
-public class TitleLabel : Label { }
-
-public class SecondaryLabel : Label { }
-
-public class IconLabel : Label { }
-
-public class OptionEntry : Entry { }
-
-public class OptionEditor : Editor { }
-
-public class OptionDatePicker : DatePicker { }
-
-public class OptionTimePicker : TimePicker { }
-
-public abstract class OptionCell : ViewCell
-{
- public static readonly BindableProperty IconProperty = CreateProperty(nameof(Icon));
- public static readonly BindableProperty TitleProperty = CreateProperty(nameof(Title));
- public static readonly BindableProperty IsRequiredProperty = CreateProperty(nameof(IsRequired));
-
- [TypeConverter(typeof(ImageSourceConverter))]
- public ImageSource Icon
- {
- get => (ImageSource)GetValue(IconProperty);
- set => SetValue(IconProperty, value);
- }
- public string Title
- {
- get => (string)GetValue(TitleProperty);
- set => SetValue(TitleProperty, value);
- }
- public bool IsRequired
- {
- get => (bool)GetValue(IsRequiredProperty);
- set => SetValue(IsRequiredProperty, value);
- }
-
- protected abstract View Content { get; }
-
- public OptionCell()
- {
- View = new Grid
- {
- BindingContext = this,
- Padding = new Thickness(20, 0),
- ColumnSpacing = 12,
- ColumnDefinitions =
- {
- new(GridLength.Auto),
- new(new GridLength(.35, GridUnitType.Star)),
- new(new GridLength(.65, GridUnitType.Star))
- },
- RowDefinitions = { new(44) },
- Children =
- {
- new Image
- {
- WidthRequest = 20,
- HeightRequest = 20,
- Aspect = Aspect.AspectFit,
- VerticalOptions = LayoutOptions.Center
- }
- .Binding(VisualElement.IsVisibleProperty, nameof(Icon), converter: new VisibleIfNotNullConverter())
- .Binding(Image.SourceProperty, nameof(Icon)),
-
- new Grid
- {
- ColumnDefinitions =
- {
- new(GridLength.Auto),
- new(GridLength.Star)
- },
- Children =
- {
- new TitleLabel
- {
- LineBreakMode = LineBreakMode.TailTruncation,
- VerticalOptions = LayoutOptions.Center
- }
- .Binding(Label.TextProperty, nameof(Title)),
-
- new SecondaryLabel
- {
- VerticalOptions = LayoutOptions.Center,
- Text = "*"
- }
- .GridColumn(1)
- .AppThemeBinding(Label.TextColorProperty, Res.Red100, Res.Red300)
- .Binding(VisualElement.IsVisibleProperty, nameof(IsRequired)),
- }
- }
- .GridColumn(1),
-
- Content.GridColumn(2)
- }
- }
- .AppThemeBinding(VisualElement.BackgroundColorProperty, Colors.White, Res.Gray900);
- }
-}
-
-public abstract class OptionVerticalCell : OptionCell
-{
- public OptionVerticalCell()
- {
- View = new Grid
- {
- BindingContext = this,
- Padding = new Thickness(20, 0),
- ColumnSpacing = 12,
- ColumnDefinitions =
- {
- new(GridLength.Auto),
- new(GridLength.Star)
- },
- RowDefinitions =
- {
- new(44),
- new(GridLength.Star)
- },
- Children =
- {
- new Image
- {
- WidthRequest = 20,
- HeightRequest = 20,
- Aspect = Aspect.AspectFit,
- VerticalOptions = LayoutOptions.Center
- }
- .Binding(VisualElement.IsVisibleProperty, nameof(Icon), converter: new VisibleIfNotNullConverter())
- .Binding(Image.SourceProperty, nameof(Icon)),
-
- new TitleLabel
- {
- LineBreakMode = LineBreakMode.TailTruncation,
- VerticalOptions = LayoutOptions.Center
- }
- .GridColumn(1)
- .Binding(Label.TextProperty, nameof(Title)),
-
- Content.GridRow(1).GridColumn(1)
- }
- }
- .AppThemeBinding(VisualElement.BackgroundColorProperty, Colors.White, Res.Gray900);
- }
-}
-
-public class OptionTextCell : OptionCell
-{
- public static readonly BindableProperty DetailProperty = CreateProperty(nameof(Detail));
-
- public string Detail
- {
- get => (string)GetValue(DetailProperty);
- set => SetValue(DetailProperty, value);
- }
-
- protected override View Content => new SecondaryLabel
- {
- HorizontalOptions = LayoutOptions.End,
- VerticalOptions = LayoutOptions.Center
- }
- .Binding(Label.TextProperty, nameof(Detail));
-}
-
-public class OptionEntryCell : OptionCell
-{
- public static readonly BindableProperty TextProperty = CreateProperty(nameof(Text), defaultBindingMode: BindingMode.TwoWay);
- public static readonly BindableProperty KeyboardProperty = CreateProperty(nameof(Keyboard), defaultValue: Keyboard.Default);
- public static readonly BindableProperty PlaceholderProperty = CreateProperty(nameof(Placeholder));
-
- public event EventHandler? Unfocused;
-
- public string Text
- {
- get => (string)GetValue(TextProperty);
- set => SetValue(TextProperty, value);
- }
- public Keyboard Keyboard
- {
- get => (Keyboard)GetValue(KeyboardProperty);
- set => SetValue(KeyboardProperty, value);
- }
- public string Placeholder
- {
- get => (string)GetValue(PlaceholderProperty);
- set => SetValue(PlaceholderProperty, value);
- }
-
- protected override View Content
- {
- get
- {
- var entry = new OptionEntry()
- .Binding(Entry.TextProperty, nameof(Text))
- .Binding(InputView.KeyboardProperty, nameof(Keyboard))
- .Binding(Entry.PlaceholderProperty, nameof(Placeholder));
- entry.Unfocused += Entry_Unfocused;
- return entry;
- }
- }
-
- private void Entry_Unfocused(object? sender, FocusEventArgs e)
- {
- Unfocused?.Invoke(this, e);
- }
-}
-
-public class OptionEditorCell : OptionVerticalCell
-{
- public static readonly BindableProperty TextProperty = CreateProperty(nameof(Text), defaultBindingMode: BindingMode.TwoWay);
- public static readonly BindableProperty KeyboardProperty = CreateProperty(nameof(Keyboard), defaultValue: Keyboard.Default);
- public static readonly BindableProperty PlaceholderProperty = CreateProperty(nameof(Placeholder));
-
- public string Text
- {
- get => (string)GetValue(TextProperty);
- set => SetValue(TextProperty, value);
- }
- public Keyboard Keyboard
- {
- get => (Keyboard)GetValue(KeyboardProperty);
- set => SetValue(KeyboardProperty, value);
- }
- public string Placeholder
- {
- get => (string)GetValue(PlaceholderProperty);
- set => SetValue(PlaceholderProperty, value);
- }
-
- protected override View Content => new OptionEditor()
- .Binding(Editor.TextProperty, nameof(Text))
- .Binding(InputView.KeyboardProperty, nameof(Keyboard))
- .Binding(Editor.PlaceholderProperty, nameof(Placeholder));
-}
-
-public class OptionSwitchCell : OptionCell
-{
- public static readonly BindableProperty IsToggledProperty = CreateProperty(nameof(IsToggled), defaultBindingMode: BindingMode.TwoWay);
-
- public bool IsToggled
- {
- get => (bool)GetValue(IsToggledProperty);
- set => SetValue(IsToggledProperty, value);
- }
-
- protected override View Content => new Switch
- {
- HorizontalOptions = LayoutOptions.End,
- VerticalOptions = LayoutOptions.Center
- }
- .Binding(Switch.IsToggledProperty, nameof(IsToggled));
-}
-
-public class OptionSelectCell : OptionTextCell
-{
- public static readonly BindableProperty CommandProperty = CreateProperty(nameof(Command));
- public static readonly BindableProperty CommandParameterProperty = CreateProperty