I have a FilePathPicker with the FilePath property set to a two-way binding to a view-model property. Whenever (in code-behind) I set the corresponding bound property (and then Raise a PropertyChanged notification for it), the FilePath in the text box does not update, no matter what the UpdateSourceTrigger. I cannot understand why.
I went and wrote a test application and reproduced the same effect. Isn't the FilePath property supposed to work as a two-way binding?
Here is the XAML binding.
<
tk:RadFilePathPicker
FilePath
=
"{Binding ReportHeaderImagePath, Mode=TwoWay}"
IconVisibility
=
"Collapsed"
/>
And here is the bound property in the ViewModel
private
string
_reportHeaderImagePath;
public
string
ReportHeaderImagePath
{
get
=> Settings.ReportHeaderImagePath;
set
{
_reportHeaderImagePath = value;
RaisePropertyChanged(nameof(ReportHeaderImagePath));
}
}
When my code sets this ReportHeaderImagePath property to null or string.Empty, I can see the value being set in the debugger and I can see the PropertyChanged event being raised. But still the editor in the RadFilePathPicker does not change. The previous path stays there. I have to either manually edit it or click the little "X" button inside it.
I have tried setting the Binding's UpdateSourceTrigger value all possible choices Default, LostFocus, PropertyChanged and even Explicit. Nothing works.
What am I missing?