1
0
mirror of https://github.com/bitwarden/mobile synced 2025-12-20 10:13:42 +00:00

attach and detach event handlers onappearing and ondisappearing to free up views for GC

This commit is contained in:
Kyle Spearrin
2017-02-15 00:28:05 -05:00
parent 56c33ee82b
commit f5e7f9249c
18 changed files with 332 additions and 106 deletions

View File

@@ -22,7 +22,6 @@ namespace Bit.App.Controls
MaxLength = 4,
Margin = new Thickness(0, int.MaxValue, 0, 0)
};
Entry.TextChanged += Entry_TextChanged;
if(Device.OS == TargetPlatform.Android)
{
@@ -30,6 +29,9 @@ namespace Bit.App.Controls
}
}
public Label Label { get; set; }
public ExtendedEntry Entry { get; set; }
private void Entry_TextChanged(object sender, TextChangedEventArgs e)
{
if(e.NewTextValue.Length >= 4)
@@ -38,7 +40,14 @@ namespace Bit.App.Controls
}
}
public Label Label { get; set; }
public ExtendedEntry Entry { get; set; }
public void InitEvents()
{
Entry.TextChanged += Entry_TextChanged;
}
public void Dispose()
{
Entry.TextChanged -= Entry_TextChanged;
}
}
}