x:Bind image with null string
问题 In XAML I have the following line: <Image x:Name="MainImage" Source="{x:Bind ViewModel.MainPic,Mode=OneWay,TargetNullValue={x:Null}}" Stretch="UniformToFill"/> In ViewModel: public string MainPic { get { if (Data == null) return default(string); else return Data.Photos.ElementAtOrDefault(0).url; } } App compiles fine but during execution (since Data is populated after few seconds), the app crashes with the following exception: System.ArgumentException: The parameter is incorrect. Debugger