Using the Visibility property enumeration Collapsed or Visible

Wow.  This took a bit to figure out, hope this helps you out.  As usual you will need to use this when you are reading some of the Windows Sample code or articles on MSDN.  The assumption is that if you are moving from C# to C++ that somehow you will get how to use enumerations in C++.

In C# your code might easily look like the following:

this.Rect2.Visibility = Windows.UI.Xaml.Visibility.Collapsed;

or

this.Rect2.Visibility = Visibility.Collapsed;

 

And you might think that C++ would be written in a similar manner:

this->Rect2->Visibility = Windows::UI::Xaml::Visibility::Collapsed;

But even if you have “using namespace Windows::UI::Xaml;” in your code, you still have to full define it in your code.

Gee.  I just couldn’t figure that out from the documentation.  Hope that helps you out.