Test your knowledge
1. You are writing a Silverlight 4 application. The application contains a class that has a Boolean property named
ToShow
. You wish to have a field that will only be shown to the user if the boundToShow
property returnstrue
. Which code segment should you use?a. Only implement the
Convert
method with the following code snippet:if (value != null) { bool result = (Boolean)value; return result == true ? Visibility.Visible : Visibility.Collapsed; return result == true ? Visibility.Visible : Visibility.Collapsed; } return Visibility.Collapsed;
b. Only implement the
ConvertBack
method with the following code snippet:if (value != null) { bool result = (Boolean)value; return result == true ? Visibility.Visible : Visibility.Collapsed; } return Visibility.Collapsed;
c. Only implement the
Convert
method with the following code snippet:if (value != null) { bool result = (Boolean)value; return result; } return Visibility.Collapsed;
d. Only implement the
ConvertBack
method with...