partial ref class MainPage : public Windows::UI::Xaml::Controls::Page… {…}
The partial and ref keywords are obviously not ISO standard C++. They are component extensions that you use specifically for creating instances of Windows Runtime types
partial 與 ref不是iso標準C++
是CX
The ref keyword indicates that the class is a Windows Runtime reference type; using ref saves you from having to write a lot of next-generation COM code.
using ref saves you from having to write a lot of next-generation COM code. In the class member declarations, notice a Platform::Object^. The "^" symbol is known as a "hat" and it means "a handle to an object." Use it instead of "*" when you create Windows Runtime types in dynamic memory.
Grid^ grid = ref new Grid(); // or: auto grid = ref new Grid();
grid->Width = 600;