I have a boolean property in my ViewModel called let say IsNotSupported , which is used to display some warning information if the sensor is not supported. Therefore, I use the BooleanToVisibilityConverter , which is added to ressources:
<phone:PhoneApplicationPage.Resources> <local:BooleanToVisibilityConverter x:Key="BooleanToVisibilityConverter" /> </phone:PhoneApplicationPage.Resources>
and bind it to the stack panel containing the warning:
<StackPanel x:Name="NotSupportedWarning" Visibility="{Binding IsNotSupported, Converter={StaticResource BooleanToVisibilityConverter}}">
This works very well, but when the page loads and the sensor is supported, the warning appears for only a split second and then disappears. I know that this flicker is caused by the fact that the binding has not yet been completed, and therefore it is not visible by default.
This flicker, it is annoying as hell ... It should be the default by default, and it becomes visible only after it becomes clear that the warning should be shown. In addition, this avoids the second prototyping after binding and, therefore, can have a positive impact on performance.
I had this problem again and again, and I did not find anything about it on the Internet until I found this SO question, which is closely related, but is not found, if the search instead of Windows Phone instead of Windows. Both the problem and the solution may seem simple, but I really listened to me for quite a while, so I thought it would be nice to write a Q & A-style question about this to help others who are facing the same problem.