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:
@@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user