control work fixes

This commit is contained in:
2026-01-17 08:51:13 +00:00
parent dc52f7f2bc
commit 9451611c3a
10 changed files with 169 additions and 37 deletions

View File

@@ -35,6 +35,7 @@ public partial class EntryHandler : ViewHandler<IEntry, SkiaEntry>
[nameof(ITextAlignment.VerticalTextAlignment)] = MapVerticalTextAlignment,
[nameof(IView.Background)] = MapBackground,
["BackgroundColor"] = MapBackgroundColor,
["SelectAllOnDoubleClick"] = MapSelectAllOnDoubleClick,
};
public static CommandMapper<IEntry, EntryHandler> CommandMapper = new(ViewHandler.ViewCommandMapper)
@@ -245,4 +246,14 @@ public partial class EntryHandler : ViewHandler<IEntry, SkiaEntry>
handler.PlatformView.BackgroundColor = ve.BackgroundColor;
}
}
public static void MapSelectAllOnDoubleClick(EntryHandler handler, IEntry entry)
{
if (handler.PlatformView is null) return;
if (entry is BindableObject bindable)
{
handler.PlatformView.SelectAllOnDoubleClick = EntryExtensions.GetSelectAllOnDoubleClick(bindable);
}
}
}

View File

@@ -23,6 +23,9 @@ public partial class ProgressBarHandler : ViewHandler<IProgress, SkiaProgressBar
[nameof(IView.IsEnabled)] = MapIsEnabled,
[nameof(IView.Background)] = MapBackground,
["BackgroundColor"] = MapBackgroundColor,
[nameof(IView.Height)] = MapHeight,
[nameof(IView.Width)] = MapWidth,
["VerticalOptions"] = MapVerticalOptions,
};
public static CommandMapper<IProgress, ProgressBarHandler> CommandMapper = new(ViewHandler.ViewCommandMapper)
@@ -131,4 +134,34 @@ public partial class ProgressBarHandler : ViewHandler<IProgress, SkiaProgressBar
handler.PlatformView.Invalidate();
}
}
public static void MapHeight(ProgressBarHandler handler, IProgress progress)
{
if (handler.PlatformView is null) return;
if (progress is VisualElement visualElement && visualElement.HeightRequest >= 0)
{
handler.PlatformView.HeightRequest = visualElement.HeightRequest;
}
}
public static void MapWidth(ProgressBarHandler handler, IProgress progress)
{
if (handler.PlatformView is null) return;
if (progress is VisualElement visualElement && visualElement.WidthRequest >= 0)
{
handler.PlatformView.WidthRequest = visualElement.WidthRequest;
}
}
public static void MapVerticalOptions(ProgressBarHandler handler, IProgress progress)
{
if (handler.PlatformView is null) return;
if (progress is Microsoft.Maui.Controls.View view)
{
handler.PlatformView.VerticalOptions = view.VerticalOptions;
}
}
}