Skip to content

Commit

Permalink
Merge pull request #26 from CrossGeeks/develop
Browse files Browse the repository at this point in the history
Fix for issue #25

Thank you for your Pull Request!
  • Loading branch information
muak committed Apr 9, 2024
2 parents a74abdf + 20f2b5f commit ece7a78
Showing 1 changed file with 20 additions and 14 deletions.
34 changes: 20 additions & 14 deletions SettingsView/Handlers/SettingsViewHandler.iOS.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
using MobileCoreServices;

namespace AiForms.Settings.Handlers;


public partial class SettingsViewHandler: ViewHandler<SettingsView, AiTableView>
{
public static IPropertyMapper<SettingsView, SettingsViewHandler> Mapper =
Expand Down Expand Up @@ -42,19 +42,8 @@ protected override AiTableView CreatePlatformView()
VirtualView.SectionCollectionChanged += OnSectionCollectionChanged;
VirtualView.SectionPropertyChanged += OnSectionPropertyChanged;
VirtualView.CellPropertyChanged += OnCellPropertyChanged;

Element elm = VirtualView;
while (elm != null)
{
elm = elm.Parent;
if (elm is Page)
{
break;
}
}

_parentPage = elm as Page;
_parentPage.Appearing += ParentPageAppearing;

VirtualView.ParentChanged += ParentChanged;

_insetTracker = new KeyboardInsetTracker(_tableview, () => PlatformView.Window, insets => PlatformView.ContentInset = PlatformView.ScrollIndicatorInsets = insets, point =>
{
Expand All @@ -67,6 +56,23 @@ protected override AiTableView CreatePlatformView()

return _tableview;
}

void ParentChanged(object sender, EventArgs e)
{
Element elm = VirtualView;

while (elm != null)
{
elm = elm.Parent;
if (elm is Page)
{
break;
}
}
_parentPage = elm as Page;
_parentPage.Appearing += ParentPageAppearing;
VirtualView.ParentChanged -= ParentChanged;
}

protected override void DisconnectHandler(AiTableView platformView)
{
Expand Down

0 comments on commit ece7a78

Please sign in to comment.