0
코드에서 정적 속성에 INotifyPropertyChanged
을 구현했습니다. 하지만 UI에는 영향을 미치지 않습니다. 여기에 내 코드를 추가했습니다. 누구나 이것에 대한 아이디어가 있습니다. 미리 감사드립니다. 난 당신이 'X : 정적'를 사용하고 있기 때문에 당신의 'LoginPageModel'클래스뿐만 아니라 정적 있으리라 믿고있어xamarin 양식의 정적 속성에 대해 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}">