0
我想強制內容頁面中的數據綁定屬性更新。在這種情況下是ContentPage
Title
參數。如何強制查看以更新Xamarin Forms中的綁定屬性?
<ContentPage x:Class="Containers.Views.ContainerPage"
xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
Title="{Binding SomeStringProperty}"
Appearing="ContentPage_Appearing">
我得到的最接近的是這個,但它不起作用。
private void ContentPage_Appearing(object sender, EventArgs e)
{
this.BindingContext = null;
this.BindingContext = myClassInstance;
}
我不想實施onPropertyChange
事件。我只想「刷新」視圖的有界數據。
你的BindingContext類實現了INotiftyPropertyChanged嗎? – Jason
是的,它確實繼承了從實現'INotifyPropertyChanged'的'ObservableObject'繼承的'BaseDataObject'; –
但我想不要實現事件更改屬性。 –