Hi,
I have no experience with C++/WinRT. In VS 2017 15.9.28 I installed the VSIX extension, created a blank C++/WinRT UWP app, installed the CppWinRT Nuget package and tried to write some code. But I have no Intellisense and nothing of my own code is compilable.
In a C++/CX project the following code works well. How should this code look like in C++/WinRT style?
MainPage::MainPage()
{
InitializeComponent();
TextBlock ^textBlock = ref new TextBlock();
textBlock->Text = L"Sampletext 1";
textBlock->FontFamily = ref new Windows::UI::Xaml::Media::FontFamily(L"Trebuchet MS");
textBlock->FontSize = 24;
textBlock->FontWeight = FontWeights::Light;
textBlock->FontStyle = Windows::UI::Text::FontStyle::Italic;
textBlock->FontStretch = Windows::UI::Text::FontStretch::Normal;
textBlock->CharacterSpacing = 0;
textBlock->IsColorFontEnabled = false;
textBlock->SetValue(Typography::StylisticAlternatesProperty, __abi_create_box(1));
textBlock->SetValue(Typography::StandardSwashesProperty, __abi_create_box(0));
textBlock->SetValue(Typography::ContextualSwashesProperty, __abi_create_box(0));
textBlock->SetValue(Typography::AnnotationAlternatesProperty, __abi_create_box(0));
textBlock->SetValue(Typography::StylisticSet2Property, false);
textBlock->SetValue(Typography::StylisticSet3Property, true);
textBlock->SetValue(Typography::EastAsianWidthsProperty, FontEastAsianWidths::Full);
panelMain->Children->Append(textBlock);
textBlock = ref new TextBlock();
textBlock->Text = L"Sampletext 2";
textBlock->FontFamily = ref new Windows::UI::Xaml::Media::FontFamily(L"Yu Gothic");
textBlock->FontSize = 24;
textBlock->FontWeight = FontWeights::Light;
textBlock->FontStyle = Windows::UI::Text::FontStyle::Normal;
textBlock->FontStretch = Windows::UI::Text::FontStretch::Normal;
textBlock->CharacterSpacing = 0;
textBlock->IsColorFontEnabled = false;
textBlock->SetValue(Typography::StylisticAlternatesProperty, __abi_create_box(1));
textBlock->SetValue(Typography::StandardSwashesProperty, __abi_create_box(0));
textBlock->SetValue(Typography::ContextualSwashesProperty, __abi_create_box(0));
textBlock->SetValue(Typography::AnnotationAlternatesProperty, __abi_create_box(5));
textBlock->SetValue(Typography::StylisticSet2Property, false);
textBlock->SetValue(Typography::StylisticSet3Property, true);
textBlock->SetValue(Typography::EastAsianWidthsProperty, FontEastAsianWidths::Full);
panelMain->Children->Append(textBlock);
}