when the user returns to another page, everything is retained in memory because the PropertyChanged event is still linked
Hi, Journeyman42-5521. How did you set binding for the contentView in xaml? I tested a basic demo to test the function, it works fine. Could you post the related code to reproduce the issue?
Here is the related code about my test, you could refer to:
Custom contentView.xaml:
<StackLayout>
<Label Text="{Binding TheText}" HorizontalOptions="CenterAndExpand" />
</StackLayout>
Page1
<StackLayout>
<Button Text="Navigation" Clicked="Button_Clicked"/>
<local:View1 />
</StackLayout>
public partial class Page1 : ContentPage
{
public string TheText { get; set; }
public Page1()
{
InitializeComponent();
TheText = "testing for the binding of contentView";
BindingContext = this;
}
private void Button_Clicked(object sender, EventArgs e)
{
Navigation.PushAsync(new Page2());
}
}
Page2
<StackLayout>
<local:View1 />
</StackLayout>
public partial class Page2 : ContentPage
{
public string TheText { get; set; }
public Page2()
{
InitializeComponent();
TheText = "the binding text in Page2.xaml.cs";
BindingContext = this;
}
}