I have been trying to make this work for a while with no success.
I have a converter to pretty print dates on the page. Convert function is as follows;
class DateConverter : IValueConverter
{
public object Convert(object value, Type targetType, object parameter, string language)
{
Nullable<int> _date = value as Nullable<int>;
if (!_date.HasValue)
return DependencyProperty.UnsetValue;
if (!String.IsNullOrEmpty(parameter as String))
{
if (parameter.Equals("EDITED"))
return "edited " + UtilityFunctions.formatUnixTime(_date.Value);
}
return UtilityFunctions.formatUnixTime(_date.Value);
}
}
In XAML part I am using this converter by passing a property of a property to it.
<TextBlock Text="{Binding Wiki.EditDate, Converter={StaticResource DateConverter}, ConverterParameter=EDITED}" />
My ModelView extends BindableBase and whenever I update Wiki property, I call SetProperty which in return calls OnPropertyChanged for Wiki property.
If I try to show the date without a converter, it works fine.
<TextBlock Text="{Binding Wiki.EditDate}" />
I am using this converter in other parts of my projects so I believe it is not the cause of the problem.
What might be the cause of this problem?
Thanks for any helps...