【发布时间】:2017-11-02 06:13:43
【问题描述】:
我在我的代码中为静态属性实现了INotifyPropertyChanged。但不影响用户界面。在这里,我添加了我的代码。任何人对此都有想法。提前致谢。
private static string dateTimeValue;
public static string DateTimeValue { get { return dateTimeValue; } set
{ dateTimeValue = value; RaisedPropertyChanged("DateTimeValue"); } }
static void RaisedPropertyChanged([CallerMemberName] string name = null)
{
if (PropertyChanged != null)
PropertyChanged(null, new PropertyChangedEventArgs(name));
}
The xaml code is,
<Label Text="{Binding Source={x:Static local:LoginPageModel.DateTimeValue}, UpdateSourceEventName=PropertyChanged}">
【问题讨论】:
标签: xamarin.forms inotifypropertychanged