Skip to content

Commit d2759b5

Browse files
kubaflormarinho
authored andcommitted
Used mapper instead of a control event
1 parent 2497e8d commit d2759b5

File tree

2 files changed

+8
-9
lines changed

2 files changed

+8
-9
lines changed

src/Controls/src/Core/ContentPage/ContentPage.Mapper.cs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,14 @@ public partial class ContentPage
1212
internal new static void RemapForControls()
1313
{
1414
PageHandler.Mapper.ReplaceMapping<ContentPage, IPageHandler>(nameof(ContentPage.HideSoftInputOnTapped), MapHideSoftInputOnTapped);
15+
#if IOS
16+
PageHandler.Mapper.ReplaceMapping<ContentPage, IPageHandler>(PlatformConfiguration.iOSSpecific.Page.PrefersHomeIndicatorAutoHiddenProperty.PropertyName, MapPrefersHomeIndicatorAutoHidden);
17+
#endif
18+
}
19+
20+
static void MapPrefersHomeIndicatorAutoHidden(IPageHandler handler, ContentPage page)
21+
{
22+
handler?.UpdateValue(nameof(IHomeIndicatorAutoHiddenView.IsHomeIndicatorAutoHidden));
1523
}
1624

1725
static void MapHideSoftInputOnTapped(IPageHandler handler, ContentPage page)

src/Controls/src/Core/ContentPage/ContentPage.cs

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -38,15 +38,6 @@ public bool HideSoftInputOnTapped
3838
public ContentPage()
3939
{
4040
this.NavigatedTo += (_, _) => UpdateHideSoftInputOnTapped();
41-
this.PropertyChanged += ContentPage_PropertyChanged;
42-
}
43-
44-
private void ContentPage_PropertyChanged(object sender, PropertyChangedEventArgs e)
45-
{
46-
if (e.PropertyName == PlatformConfiguration.iOSSpecific.Page.PrefersHomeIndicatorAutoHiddenProperty.PropertyName)
47-
{
48-
Handler?.UpdateValue(nameof(IHomeIndicatorAutoHiddenView.IsHomeIndicatorAutoHidden));
49-
}
5041
}
5142

5243
protected override void OnBindingContextChanged()

0 commit comments

Comments
 (0)