diff --git a/Import/GacUI.UnitTest.UI.cpp b/Import/GacUI.UnitTest.UI.cpp index a8dc70da..001ca6b6 100644 --- a/Import/GacUI.UnitTest.UI.cpp +++ b/Import/GacUI.UnitTest.UI.cpp @@ -211,6 +211,21 @@ Helper Functions auto element = Ptr(GuiImageFrameElement::Create()); bounds->SetOwnedElement(element); auto& desc = frame.elements->Get(dom->element.Value()).Get(); + + element->SetAlignments(GetAlignment(desc.horizontalAlignment), GetAlignment(desc.verticalAlignment)); + element->SetStretch(desc.stretch); + element->SetEnabled(desc.enabled); + + if (desc.imageId) + { + vint index = trace.imageCreations->Keys().IndexOf(desc.imageId.Value()); + if (index!= 1) + { + auto binary = trace.imageCreations->Values()[index].imageData; + binary->SeekFromBegin(0); + element->SetImage(GetCurrentController()->ImageService()->CreateImageFromStream(*binary.Obj()), desc.imageFrame); + } + } } break; default: @@ -956,15 +971,15 @@ Class (::gaclib_controls::UnitTestSnapshotViewerWindowConstructor) ::vl::__vwsn::This(this->self)->SetClientSize([&](){ ::vl::presentation::Size __vwsn_temp__; __vwsn_temp__.x = static_cast<::vl::vint>(1920); __vwsn_temp__.y = static_cast<::vl::vint>(1080); return __vwsn_temp__; }()); } (this->__vwsn_precompile_0 = new ::vl::presentation::compositions::GuiTableComposition()); - { - ::vl::__vwsn::This(this->__vwsn_precompile_0)->SetMinSizeLimitation(::vl::presentation::compositions::GuiGraphicsComposition::MinSizeLimitation::LimitToElementAndChildren); - } { ::vl::__vwsn::This(this->__vwsn_precompile_0)->SetCellPadding(static_cast<::vl::vint>(5)); } { ::vl::__vwsn::This(this->__vwsn_precompile_0)->SetAlignmentToParent([&](){ ::vl::presentation::Margin __vwsn_temp__; __vwsn_temp__.left = static_cast<::vl::vint>(0); __vwsn_temp__.top = static_cast<::vl::vint>(0); __vwsn_temp__.right = static_cast<::vl::vint>(0); __vwsn_temp__.bottom = static_cast<::vl::vint>(0); return __vwsn_temp__; }()); } + { + ::vl::__vwsn::This(this->__vwsn_precompile_0)->SetMinSizeLimitation(::vl::presentation::compositions::GuiGraphicsComposition::MinSizeLimitation::LimitToElementAndChildren); + } { ::vl::__vwsn::This(this->__vwsn_precompile_0)->SetRowsAndColumns(static_cast<::vl::vint>(1), static_cast<::vl::vint>(4)); ::vl::__vwsn::This(this->__vwsn_precompile_0)->SetRowOption(static_cast<::vl::vint>(0), [&](){ ::vl::presentation::compositions::GuiCellOption __vwsn_temp__; __vwsn_temp__.composeType = ::vl::presentation::compositions::GuiCellOption::ComposeType::Percentage; __vwsn_temp__.percentage = static_cast(1.0); return __vwsn_temp__; }()); @@ -998,6 +1013,12 @@ Class (::gaclib_controls::UnitTestSnapshotViewerWindowConstructor) { ::vl::__vwsn::This(this->treeViewFileNodes)->SetChildrenProperty(vl::Func(::vl_workflow_global::__vwsnf1_GuiUnitTestSnapshotViewer_gaclib_controls_UnitTestSnapshotViewerWindowConstructor___vwsn_gaclib_controls_UnitTestSnapshotViewerWindow_Initialize_(this))); } + { + ::vl::__vwsn::This(this->treeViewFileNodes)->SetHorizontalAlwaysVisible(false); + } + { + ::vl::__vwsn::This(this->treeViewFileNodes)->SetVerticalAlwaysVisible(false); + } { ::vl::__vwsn::This(this->treeViewFileNodes)->SetTextProperty(vl::Func(::vl_workflow_global::__vwsnf2_GuiUnitTestSnapshotViewer_gaclib_controls_UnitTestSnapshotViewerWindowConstructor___vwsn_gaclib_controls_UnitTestSnapshotViewerWindow_Initialize_(this))); } @@ -1005,12 +1026,6 @@ Class (::gaclib_controls::UnitTestSnapshotViewerWindowConstructor) { ::vl::__vwsn::This(this->__vwsn_precompile_4)->SetAlignmentToParent([&](){ ::vl::presentation::Margin __vwsn_temp__; __vwsn_temp__.left = static_cast<::vl::vint>(0); __vwsn_temp__.top = static_cast<::vl::vint>(0); __vwsn_temp__.right = static_cast<::vl::vint>(0); __vwsn_temp__.bottom = static_cast<::vl::vint>(0); return __vwsn_temp__; }()); } - { - ::vl::__vwsn::This(this->treeViewFileNodes)->SetHorizontalAlwaysVisible(false); - } - { - ::vl::__vwsn::This(this->treeViewFileNodes)->SetVerticalAlwaysVisible(false); - } { ::vl::__vwsn::This(this->__vwsn_precompile_3)->AddChild(static_cast<::vl::presentation::compositions::GuiGraphicsComposition*>(::vl::__vwsn::This(this->treeViewFileNodes)->GetBoundsComposition())); } @@ -1034,6 +1049,12 @@ Class (::gaclib_controls::UnitTestSnapshotViewerWindowConstructor) (this->textListFrames = new ::vl::presentation::controls::GuiBindableTextList(::vl::presentation::theme::ThemeName::TextList)); ::vl::__vwsn::This(__vwsn_this_)->SetNamedObject(::vl::WString::Unmanaged(L"textListFrames"), ::vl::__vwsn::Box(this->textListFrames)); } + { + ::vl::__vwsn::This(this->textListFrames)->SetHorizontalAlwaysVisible(false); + } + { + ::vl::__vwsn::This(this->textListFrames)->SetVerticalAlwaysVisible(false); + } { ::vl::__vwsn::This(this->textListFrames)->SetTextProperty(vl::Func(::vl_workflow_global::__vwsnf3_GuiUnitTestSnapshotViewer_gaclib_controls_UnitTestSnapshotViewerWindowConstructor___vwsn_gaclib_controls_UnitTestSnapshotViewerWindow_Initialize_(this))); } @@ -1041,12 +1062,6 @@ Class (::gaclib_controls::UnitTestSnapshotViewerWindowConstructor) { ::vl::__vwsn::This(this->__vwsn_precompile_9)->SetAlignmentToParent([&](){ ::vl::presentation::Margin __vwsn_temp__; __vwsn_temp__.left = static_cast<::vl::vint>(0); __vwsn_temp__.top = static_cast<::vl::vint>(0); __vwsn_temp__.right = static_cast<::vl::vint>(0); __vwsn_temp__.bottom = static_cast<::vl::vint>(0); return __vwsn_temp__; }()); } - { - ::vl::__vwsn::This(this->textListFrames)->SetHorizontalAlwaysVisible(false); - } - { - ::vl::__vwsn::This(this->textListFrames)->SetVerticalAlwaysVisible(false); - } { ::vl::__vwsn::This(this->__vwsn_precompile_8)->AddChild(static_cast<::vl::presentation::controls::GuiControl*>(this->textListFrames)); } @@ -1081,16 +1096,16 @@ Class (::gaclib_controls::UnitTestSnapshotViewerWindowConstructor) (this->scRendering = new ::vl::presentation::controls::GuiScrollContainer(::vl::presentation::theme::ThemeName::ScrollView)); ::vl::__vwsn::This(__vwsn_this_)->SetNamedObject(::vl::WString::Unmanaged(L"scRendering"), ::vl::__vwsn::Box(this->scRendering)); } - (this->__vwsn_precompile_14 = ::vl::__vwsn::This(this->scRendering)->GetBoundsComposition()); - { - ::vl::__vwsn::This(this->__vwsn_precompile_14)->SetAlignmentToParent([&](){ ::vl::presentation::Margin __vwsn_temp__; __vwsn_temp__.left = static_cast<::vl::vint>(5); __vwsn_temp__.top = static_cast<::vl::vint>(5); __vwsn_temp__.right = static_cast<::vl::vint>(5); __vwsn_temp__.bottom = static_cast<::vl::vint>(5); return __vwsn_temp__; }()); - } { ::vl::__vwsn::This(this->scRendering)->SetHorizontalAlwaysVisible(false); } { ::vl::__vwsn::This(this->scRendering)->SetVerticalAlwaysVisible(false); } + (this->__vwsn_precompile_14 = ::vl::__vwsn::This(this->scRendering)->GetBoundsComposition()); + { + ::vl::__vwsn::This(this->__vwsn_precompile_14)->SetAlignmentToParent([&](){ ::vl::presentation::Margin __vwsn_temp__; __vwsn_temp__.left = static_cast<::vl::vint>(5); __vwsn_temp__.top = static_cast<::vl::vint>(5); __vwsn_temp__.right = static_cast<::vl::vint>(5); __vwsn_temp__.bottom = static_cast<::vl::vint>(5); return __vwsn_temp__; }()); + } { ::vl::__vwsn::This(this->__vwsn_precompile_13)->AddChild(static_cast<::vl::presentation::controls::GuiControl*>(this->scRendering)); } @@ -1107,16 +1122,16 @@ Class (::gaclib_controls::UnitTestSnapshotViewerWindowConstructor) { (this->__vwsn_precompile_16 = new ::vl::presentation::controls::GuiMultilineTextBox(::vl::presentation::theme::ThemeName::MultilineTextBox)); } - (this->__vwsn_precompile_17 = ::vl::__vwsn::This(this->__vwsn_precompile_16)->GetBoundsComposition()); - { - ::vl::__vwsn::This(this->__vwsn_precompile_17)->SetAlignmentToParent([&](){ ::vl::presentation::Margin __vwsn_temp__; __vwsn_temp__.left = static_cast<::vl::vint>(5); __vwsn_temp__.top = static_cast<::vl::vint>(5); __vwsn_temp__.right = static_cast<::vl::vint>(5); __vwsn_temp__.bottom = static_cast<::vl::vint>(5); return __vwsn_temp__; }()); - } { ::vl::__vwsn::This(this->__vwsn_precompile_16)->SetHorizontalAlwaysVisible(false); } { ::vl::__vwsn::This(this->__vwsn_precompile_16)->SetVerticalAlwaysVisible(false); } + (this->__vwsn_precompile_17 = ::vl::__vwsn::This(this->__vwsn_precompile_16)->GetBoundsComposition()); + { + ::vl::__vwsn::This(this->__vwsn_precompile_17)->SetAlignmentToParent([&](){ ::vl::presentation::Margin __vwsn_temp__; __vwsn_temp__.left = static_cast<::vl::vint>(5); __vwsn_temp__.top = static_cast<::vl::vint>(5); __vwsn_temp__.right = static_cast<::vl::vint>(5); __vwsn_temp__.bottom = static_cast<::vl::vint>(5); return __vwsn_temp__; }()); + } { ::vl::__vwsn::This(this->__vwsn_precompile_15)->AddChild(static_cast<::vl::presentation::controls::GuiControl*>(this->__vwsn_precompile_16)); } @@ -1133,16 +1148,16 @@ Class (::gaclib_controls::UnitTestSnapshotViewerWindowConstructor) { (this->__vwsn_precompile_19 = new ::vl::presentation::controls::GuiMultilineTextBox(::vl::presentation::theme::ThemeName::MultilineTextBox)); } - (this->__vwsn_precompile_20 = ::vl::__vwsn::This(this->__vwsn_precompile_19)->GetBoundsComposition()); - { - ::vl::__vwsn::This(this->__vwsn_precompile_20)->SetAlignmentToParent([&](){ ::vl::presentation::Margin __vwsn_temp__; __vwsn_temp__.left = static_cast<::vl::vint>(5); __vwsn_temp__.top = static_cast<::vl::vint>(5); __vwsn_temp__.right = static_cast<::vl::vint>(5); __vwsn_temp__.bottom = static_cast<::vl::vint>(5); return __vwsn_temp__; }()); - } { ::vl::__vwsn::This(this->__vwsn_precompile_19)->SetHorizontalAlwaysVisible(false); } { ::vl::__vwsn::This(this->__vwsn_precompile_19)->SetVerticalAlwaysVisible(false); } + (this->__vwsn_precompile_20 = ::vl::__vwsn::This(this->__vwsn_precompile_19)->GetBoundsComposition()); + { + ::vl::__vwsn::This(this->__vwsn_precompile_20)->SetAlignmentToParent([&](){ ::vl::presentation::Margin __vwsn_temp__; __vwsn_temp__.left = static_cast<::vl::vint>(5); __vwsn_temp__.top = static_cast<::vl::vint>(5); __vwsn_temp__.right = static_cast<::vl::vint>(5); __vwsn_temp__.bottom = static_cast<::vl::vint>(5); return __vwsn_temp__; }()); + } { ::vl::__vwsn::This(this->__vwsn_precompile_18)->AddChild(static_cast<::vl::presentation::controls::GuiControl*>(this->__vwsn_precompile_19)); } @@ -1159,16 +1174,16 @@ Class (::gaclib_controls::UnitTestSnapshotViewerWindowConstructor) { (this->__vwsn_precompile_22 = new ::vl::presentation::controls::GuiMultilineTextBox(::vl::presentation::theme::ThemeName::MultilineTextBox)); } - (this->__vwsn_precompile_23 = ::vl::__vwsn::This(this->__vwsn_precompile_22)->GetBoundsComposition()); - { - ::vl::__vwsn::This(this->__vwsn_precompile_23)->SetAlignmentToParent([&](){ ::vl::presentation::Margin __vwsn_temp__; __vwsn_temp__.left = static_cast<::vl::vint>(5); __vwsn_temp__.top = static_cast<::vl::vint>(5); __vwsn_temp__.right = static_cast<::vl::vint>(5); __vwsn_temp__.bottom = static_cast<::vl::vint>(5); return __vwsn_temp__; }()); - } { ::vl::__vwsn::This(this->__vwsn_precompile_22)->SetHorizontalAlwaysVisible(false); } { ::vl::__vwsn::This(this->__vwsn_precompile_22)->SetVerticalAlwaysVisible(false); } + (this->__vwsn_precompile_23 = ::vl::__vwsn::This(this->__vwsn_precompile_22)->GetBoundsComposition()); + { + ::vl::__vwsn::This(this->__vwsn_precompile_23)->SetAlignmentToParent([&](){ ::vl::presentation::Margin __vwsn_temp__; __vwsn_temp__.left = static_cast<::vl::vint>(5); __vwsn_temp__.top = static_cast<::vl::vint>(5); __vwsn_temp__.right = static_cast<::vl::vint>(5); __vwsn_temp__.bottom = static_cast<::vl::vint>(5); return __vwsn_temp__; }()); + } { ::vl::__vwsn::This(this->__vwsn_precompile_21)->AddChild(static_cast<::vl::presentation::controls::GuiControl*>(this->__vwsn_precompile_22)); } @@ -1228,11 +1243,8 @@ Class (::gaclib_controls::UnitTestSnapshotViewerWindowConstructor) } UnitTestSnapshotViewerWindowConstructor::UnitTestSnapshotViewerWindowConstructor() - : ViewModel(::vl::Ptr<::gaclib_controls::IUnitTestSnapshotViewerViewModel>()) - , self(static_cast<::gaclib_controls::UnitTestSnapshotViewerWindow*>(nullptr)) - , treeViewFileNodes(static_cast<::vl::presentation::controls::GuiBindableTreeView*>(nullptr)) - , textListFrames(static_cast<::vl::presentation::controls::GuiBindableTextList*>(nullptr)) - , scRendering(static_cast<::vl::presentation::controls::GuiScrollContainer*>(nullptr)) + : self(static_cast<::gaclib_controls::UnitTestSnapshotViewerWindow*>(nullptr)) + , ViewModel(::vl::Ptr<::gaclib_controls::IUnitTestSnapshotViewerViewModel>()) , __vwsn_precompile_0(static_cast<::vl::presentation::compositions::GuiTableComposition*>(nullptr)) , __vwsn_precompile_1(static_cast<::vl::presentation::compositions::GuiColumnSplitterComposition*>(nullptr)) , __vwsn_precompile_2(static_cast<::vl::presentation::compositions::GuiColumnSplitterComposition*>(nullptr)) @@ -1257,6 +1269,9 @@ Class (::gaclib_controls::UnitTestSnapshotViewerWindowConstructor) , __vwsn_precompile_21(static_cast<::vl::presentation::controls::GuiTabPage*>(nullptr)) , __vwsn_precompile_22(static_cast<::vl::presentation::controls::GuiMultilineTextBox*>(nullptr)) , __vwsn_precompile_23(static_cast<::vl::presentation::compositions::GuiBoundsComposition*>(nullptr)) + , treeViewFileNodes(static_cast<::vl::presentation::controls::GuiBindableTreeView*>(nullptr)) + , textListFrames(static_cast<::vl::presentation::controls::GuiBindableTextList*>(nullptr)) + , scRendering(static_cast<::vl::presentation::controls::GuiScrollContainer*>(nullptr)) { } diff --git a/Import/GacUI.UnitTest.UI.h b/Import/GacUI.UnitTest.UI.h index 7e4bdccf..6551dcba 100644 --- a/Import/GacUI.UnitTest.UI.h +++ b/Import/GacUI.UnitTest.UI.h @@ -158,11 +158,8 @@ namespace gaclib_controls friend struct ::vl::reflection::description::CustomTypeDescriptorSelector; #endif protected: - ::vl::Ptr<::gaclib_controls::IUnitTestSnapshotViewerViewModel> ViewModel; ::gaclib_controls::UnitTestSnapshotViewerWindow* self; - ::vl::presentation::controls::GuiBindableTreeView* treeViewFileNodes; - ::vl::presentation::controls::GuiBindableTextList* textListFrames; - ::vl::presentation::controls::GuiScrollContainer* scRendering; + ::vl::Ptr<::gaclib_controls::IUnitTestSnapshotViewerViewModel> ViewModel; ::vl::presentation::compositions::GuiTableComposition* __vwsn_precompile_0; ::vl::presentation::compositions::GuiColumnSplitterComposition* __vwsn_precompile_1; ::vl::presentation::compositions::GuiColumnSplitterComposition* __vwsn_precompile_2; @@ -187,6 +184,9 @@ namespace gaclib_controls ::vl::presentation::controls::GuiTabPage* __vwsn_precompile_21; ::vl::presentation::controls::GuiMultilineTextBox* __vwsn_precompile_22; ::vl::presentation::compositions::GuiBoundsComposition* __vwsn_precompile_23; + ::vl::presentation::controls::GuiBindableTreeView* treeViewFileNodes; + ::vl::presentation::controls::GuiBindableTextList* textListFrames; + ::vl::presentation::controls::GuiScrollContainer* scRendering; void __vwsn_gaclib_controls_UnitTestSnapshotViewerWindow_Initialize(::gaclib_controls::UnitTestSnapshotViewerWindow* __vwsn_this_); public: UnitTestSnapshotViewerWindowConstructor(); @@ -223,7 +223,9 @@ namespace gaclib_controls ::vl::Ptr<::gaclib_controls::IUnitTestSnapshotViewerStringsStrings> GetStrings(); void SetStrings(::vl::Ptr<::gaclib_controls::IUnitTestSnapshotViewerStringsStrings> __vwsn_value_); ::vl::Event StringsChanged; + private: ::vl::Ptr<::gaclib_controls::IUnitTestSnapshotViewerViewModel> __vwsn_parameter_ViewModel; + public: ::vl::Ptr<::gaclib_controls::IUnitTestSnapshotViewerViewModel> GetViewModel(); UnitTestSnapshotViewerWindow(::vl::Ptr<::gaclib_controls::IUnitTestSnapshotViewerViewModel> __vwsn_ctor_parameter_ViewModel); ~UnitTestSnapshotViewerWindow(); diff --git a/Import/GacUI.UnitTest.cpp b/Import/GacUI.UnitTest.cpp index 594c435c..c64ac3f6 100644 --- a/Import/GacUI.UnitTest.cpp +++ b/Import/GacUI.UnitTest.cpp @@ -225,12 +225,11 @@ Ptr GacUIUnitTest_CompileAndLoad(const WString& xmlResource) GuiResourceError::List errors; { auto resourcePath = (GetUnitTestFrameworkConfig().resourceFolder / L"Resource.xml").GetFullPath(); - auto resourceFolder = GetUnitTestFrameworkConfig().resourceFolder.GetFullPath(); auto parser = GetParserManager()->GetParser(L"XML"); auto xml = parser->Parse({ WString::Empty,resourcePath }, xmlResource, errors); CHECK_ERROR(xml && errors.Count() == 0, ERROR_MESSAGE_PREFIX L"Failed to parse XML resource."); - resource = GuiResource::LoadFromXml(xml, resourcePath, resourceFolder, errors); + resource = GuiResource::LoadFromXml(xml, resourcePath, GetFolderPath(resourcePath), errors); CHECK_ERROR(resource && errors.Count() == 0, ERROR_MESSAGE_PREFIX L"Failed to load XML resource."); } diff --git a/Import/GacUI.UnitTest.h b/Import/GacUI.UnitTest.h index 2376d863..a163212a 100644 --- a/Import/GacUI.UnitTest.h +++ b/Import/GacUI.UnitTest.h @@ -583,6 +583,7 @@ UnitTestRemoteProtocol class UnitTestRemoteProtocol_Rendering : public TProtocol { using IdSet = collections::SortedList; + using Base64ToImageMetadataMap = collections::Dictionary; using ElementDescMap = collections::Dictionary; using ImageMetadataMap = collections::Dictionary; using CommandList = UnitTestRenderingCommandList; @@ -593,6 +594,7 @@ UnitTestRemoteProtocol ElementDescMap lastElementDescs; IdSet removedElementIds; IdSet removedImageIds; + Ptr cachedImageMetadatas; remoteprotocol::ElementMeasurings measuringForNextRendering; regex::Regex regexCrLf{ L"/n|/r(/n)?" }; @@ -602,7 +604,8 @@ UnitTestRemoteProtocol void ResetCreatedObjects() { loggedTrace.createdElements = Ptr(new collections::Dictionary); - loggedTrace.createdImages = Ptr(new remoteprotocol::ArrayMap); + loggedTrace.imageCreations = Ptr(new remoteprotocol::ArrayMap); + loggedTrace.imageMetadatas = Ptr(new remoteprotocol::ArrayMap); lastElementDescs.Clear(); } public: @@ -695,7 +698,6 @@ IGuiRemoteProtocolMessages (Elements) { CHECK_ERROR(!loggedTrace.createdElements->Keys().Contains(creation.id), ERROR_MESSAGE_PREFIX L"Renderer with the specified id has been created or used."); loggedTrace.createdElements->Add(creation.id, creation.type); - removedElementIds.Remove(creation.id); } } #undef ERROR_MESSAGE_PREFIX @@ -932,16 +934,113 @@ IGuiRemoteProtocolMessages (Elements - SolidLabel) IGuiRemoteProtocolMessages (Elements - Image) ***********************************************************************/ + WString GetBinaryKeyFromBinary(stream::IStream& binary) + { + stream::MemoryStream base64WStringStream; + { + stream::UtfGeneralEncoder utf8ToWCharEncoder; + stream::EncoderStream utf8ToWCharStream(base64WStringStream, utf8ToWCharEncoder); + stream::Utf8Base64Encoder binaryToBase64Utf8Encoder; + stream::EncoderStream binaryToBase64Utf8Stream(utf8ToWCharStream, binaryToBase64Utf8Encoder); + binary.SeekFromBegin(0); + stream::CopyStream(binary, binaryToBase64Utf8Stream); + } + { + base64WStringStream.SeekFromBegin(0); + stream::StreamReader reader(base64WStringStream); + return reader.ReadToEnd(); + } + } + + WString GetBinaryKeyFromImage(Ptr image) + { +#define ERROR_MESSAGE_PREFIX L"vl::presentation::unittest::UnitTestRemoteProtocol_Rendering::GetBinaryKeyFromImage(Ptr)#" + auto remoteImage = image.Cast(); + CHECK_ERROR(remoteImage, ERROR_MESSAGE_PREFIX L"The image object must be GuiRemoteGraphicsImage."); + return GetBinaryKeyFromBinary(remoteImage->GetBinaryData()); +#undef ERROR_MESSAGE_PREFIX + } + remoteprotocol::ImageMetadata MakeImageMetadata(const remoteprotocol::ImageCreation& arguments) { - CHECK_FAIL(L"Not Implemented!"); +#define ERROR_MESSAGE_PREFIX L"vl::presentation::unittest::UnitTestRemoteProtocol_Rendering::MakeImageMetadata(const remoteprotocol::ImageCreation)#" + if (!cachedImageMetadatas) + { + cachedImageMetadatas = Ptr(new Base64ToImageMetadataMap); + for (auto resource : GetResourceManager()->GetLoadedResources()) + { + if (auto xmlImageData = resource->GetValueByPath(WString::Unmanaged(L"UnitTestConfig/ImageData")).Cast()) + { + for (auto elementImage : glr::xml::XmlGetElements(xmlImageData->rootElement, WString::Unmanaged(L"Image"))) + { + WString path, format, frames = WString::Unmanaged(L"1"), width, height; + + auto attPath = glr::xml::XmlGetAttribute(elementImage.Obj(), WString::Unmanaged(L"Path")); + auto attFormat = glr::xml::XmlGetAttribute(elementImage.Obj(), WString::Unmanaged(L"Format")); + auto attFrames = glr::xml::XmlGetAttribute(elementImage.Obj(), WString::Unmanaged(L"Frames")); + auto attWidth = glr::xml::XmlGetAttribute(elementImage.Obj(), WString::Unmanaged(L"Width")); + auto attHeight = glr::xml::XmlGetAttribute(elementImage.Obj(), WString::Unmanaged(L"Height")); + + CHECK_ERROR(attPath, ERROR_MESSAGE_PREFIX L"Missing Path attribute in Image element in an UnitTestConfig/ImageData."); + CHECK_ERROR(attFormat, ERROR_MESSAGE_PREFIX L"Missing Format attribute in Image element in an UnitTestConfig/ImageData."); + CHECK_ERROR(attWidth, ERROR_MESSAGE_PREFIX L"Missing Width attribute in Image element in an UnitTestConfig/ImageData."); + CHECK_ERROR(attHeight, ERROR_MESSAGE_PREFIX L"Missing Height attribute in Image element in an UnitTestConfig/ImageData."); + + path = attPath->value.value; + format = attFormat->value.value; + width = attWidth->value.value; + height = attHeight->value.value; + if (attFrames) frames = attFrames->value.value; + + vint valueFrames = wtoi(frames); + vint valueWidth = wtoi(width); + vint valueHeight = wtoi(height); + + CHECK_ERROR(itow(valueFrames) == frames, ERROR_MESSAGE_PREFIX L"Frames attribute must be an integer in Image element in an UnitTestConfig/ImageData."); + CHECK_ERROR(itow(valueWidth) == width, ERROR_MESSAGE_PREFIX L"Width attribute must be an integer in Image element in an UnitTestConfig/ImageData."); + CHECK_ERROR(itow(valueHeight) == height, ERROR_MESSAGE_PREFIX L"Height attribute must be an integer in Image element in an UnitTestConfig/ImageData."); + + auto imageData = resource->GetImageByPath(path); + WString binaryKey = GetBinaryKeyFromImage(imageData->GetImage()); + + if (!cachedImageMetadatas->Keys().Contains(binaryKey)) + { + remoteprotocol::ImageMetadata imageMetadata; + imageMetadata.id = -1; + imageMetadata.frames = Ptr(new collections::List); + { + auto node = Ptr(new glr::json::JsonString); + node->content.value = format; + remoteprotocol::ConvertJsonToCustomType(node, imageMetadata.format); + } + for (vint frame = 0; frame < valueFrames; frame++) + { + imageMetadata.frames->Add({ {valueWidth,valueHeight} }); + } + + cachedImageMetadatas->Add(binaryKey, imageMetadata); + } + } + } + } + } + + auto binaryKey = GetBinaryKeyFromBinary(*arguments.imageData.Obj()); + vint binaryIndex = cachedImageMetadatas->Keys().IndexOf(binaryKey); + CHECK_ERROR(binaryIndex != -1, ERROR_MESSAGE_PREFIX L"The image is not registered in any UnitTestConfig/ImageData."); + auto metadata = cachedImageMetadatas->Values()[binaryIndex]; + metadata.id = arguments.id; + + loggedTrace.imageCreations->Add(arguments); + loggedTrace.imageMetadatas->Add(metadata); + return metadata; +#undef ERROR_MESSAGE_PREFIX } void RequestImageCreated(vint id, const remoteprotocol::ImageCreation& arguments) override { #define ERROR_MESSAGE_PREFIX L"vl::presentation::unittest::UnitTestRemoteProtocol_Rendering::RequestImageCreated(vint, const vint&)#" - CHECK_ERROR(!loggedTrace.createdImages->Keys().Contains(arguments.id), ERROR_MESSAGE_PREFIX L"Image with the specified id has been created or used."); - removedImageIds.Remove(arguments.id); + CHECK_ERROR(!loggedTrace.imageMetadatas->Keys().Contains(arguments.id), ERROR_MESSAGE_PREFIX L"Image with the specified id has been created or used."); this->GetEvents()->RespondImageCreated(id, MakeImageMetadata(arguments)); #undef ERROR_MESSAGE_PREFIX } @@ -949,7 +1048,7 @@ IGuiRemoteProtocolMessages (Elements - Image) void RequestImageDestroyed(const vint& arguments) override { #define ERROR_MESSAGE_PREFIX L"vl::presentation::unittest::UnitTestRemoteProtocol_Rendering::RequestImageDestroyed(const vint&)#" - CHECK_ERROR(loggedTrace.createdImages->Keys().Contains(arguments), ERROR_MESSAGE_PREFIX L"Image with the specified id has not been created."); + CHECK_ERROR(loggedTrace.imageMetadatas->Keys().Contains(arguments), ERROR_MESSAGE_PREFIX L"Image with the specified id has not been created."); CHECK_ERROR(!removedImageIds.Contains(arguments), ERROR_MESSAGE_PREFIX L"Image with the specified id has been destroyed."); removedImageIds.Add(arguments); #undef ERROR_MESSAGE_PREFIX @@ -964,7 +1063,7 @@ IGuiRemoteProtocolMessages (Elements - Image) if (!imageCreation.imageDataOmitted) { CHECK_ERROR(arguments.imageId && arguments.imageId.Value() != !imageCreation.id, ERROR_MESSAGE_PREFIX L"It should satisfy that (arguments.imageId.Value()id == imageCreation.id)."); - CHECK_ERROR(!loggedTrace.createdImages->Keys().Contains(imageCreation.id), ERROR_MESSAGE_PREFIX L"Image with the specified id has been created."); + CHECK_ERROR(!loggedTrace.imageMetadatas->Keys().Contains(imageCreation.id), ERROR_MESSAGE_PREFIX L"Image with the specified id has been created."); CHECK_ERROR(imageCreation.imageData, ERROR_MESSAGE_PREFIX L"When imageDataOmitted == false, imageData should not be null."); if (!measuringForNextRendering.createdImages) { @@ -979,7 +1078,7 @@ IGuiRemoteProtocolMessages (Elements - Image) } else if (arguments.imageId) { - CHECK_ERROR(loggedTrace.createdImages->Keys().Contains(arguments.imageId.Value()), ERROR_MESSAGE_PREFIX L"Image with the specified id has not been created."); + CHECK_ERROR(loggedTrace.imageMetadatas->Keys().Contains(arguments.imageId.Value()), ERROR_MESSAGE_PREFIX L"Image with the specified id has not been created."); } auto element = arguments; @@ -1412,7 +1511,12 @@ extern vl::Ptr GacUIUnitTest_CompileAndLoad(const #ifdef VCZH_DESCRIPTABLEOBJECT_WITH_METADATA template -void GacUIUnitTest_StartFast_WithResourceAsText(const vl::WString& appName, const vl::WString& windowTypeFullName, const vl::WString& resourceText, vl::Nullable config = {}) +void GacUIUnitTest_StartFast_WithResourceAsText( + const vl::WString& appName, + const vl::WString& windowTypeFullName, + const vl::WString& resourceText, vl::Func installWindow, + vl::Nullable config +) { GacUIUnitTest_LinkGuiMainProxy([=]( vl::presentation::unittest::UnitTestRemoteProtocol* protocol, @@ -1430,6 +1534,10 @@ void GacUIUnitTest_StartFast_WithResourceAsText(const vl::WString& appName, cons auto window = vl::Ptr(windowValue.GetRawPtr()->SafeAggregationCast()); TEST_ASSERT(window); + if (installWindow) + { + installWindow(window.Obj()); + } window->MoveToScreenCenter(); previousMainProxy(protocol, context); vl::presentation::controls::GetApplication()->Run(window.Obj()); @@ -1439,6 +1547,38 @@ void GacUIUnitTest_StartFast_WithResourceAsText(const vl::WString& appName, cons GacUIUnitTest_Start_WithResourceAsText(appName, config, resourceText); } +template +void GacUIUnitTest_StartFast_WithResourceAsText( + const vl::WString& appName, + const vl::WString& windowTypeFullName, + const vl::WString& resourceText, + vl::Nullable config +) +{ + GacUIUnitTest_StartFast_WithResourceAsText(appName, windowTypeFullName, resourceText, {}, config); +} + +template +void GacUIUnitTest_StartFast_WithResourceAsText( + const vl::WString& appName, + const vl::WString& windowTypeFullName, + const vl::WString& resourceText, + vl::Func installWindow +) +{ + GacUIUnitTest_StartFast_WithResourceAsText(appName, windowTypeFullName, resourceText, installWindow, {}); +} + +template +void GacUIUnitTest_StartFast_WithResourceAsText( + const vl::WString& appName, + const vl::WString& windowTypeFullName, + const vl::WString& resourceText +) +{ + GacUIUnitTest_StartFast_WithResourceAsText(appName, windowTypeFullName, resourceText, {}, {}); +} + #endif #endif diff --git a/Import/GacUI.cpp b/Import/GacUI.cpp index b92bd2bd..8dc9a512 100644 --- a/Import/GacUI.cpp +++ b/Import/GacUI.cpp @@ -35489,9 +35489,12 @@ GuiHostedController::WindowManager void GuiHostedController::OnOpened(hosted_window_manager::Window* window) { - for (auto listener : window->id->listeners) + if (!mainWindow || window != &mainWindow->wmWindow) { - listener->Opened(); + for (auto listener : window->id->listeners) + { + listener->Opened(); + } } } @@ -35643,6 +35646,17 @@ GuiHostedController::INativeWindowListener } } + void GuiHostedController::Opened() + { + if (mainWindow) + { + for (auto listener : mainWindow->wmWindow.id->listeners) + { + listener->Opened(); + } + } + } + void GuiHostedController::LostFocus() { lastFocusedWindow = wmManager->activeWindow ? wmManager->activeWindow->id : nullptr; @@ -39508,6 +39522,11 @@ GuiRemoteGraphicsImage } } + stream::IStream& GuiRemoteGraphicsImage::GetBinaryData() + { + return *binary.Obj(); + } + remoteprotocol::ImageCreation GuiRemoteGraphicsImage::GenerateImageCreation() { #define ERROR_MESSAGE_PREFIX L"vl::presentation::GuiRemoteGraphicsImage::GenerateImageCreation()#" @@ -41112,7 +41131,8 @@ namespace vl::presentation::remoteprotocol { auto node = Ptr(new glr::json::JsonObject); ConvertCustomTypeToJsonField(node, L"createdElements", value.createdElements); - ConvertCustomTypeToJsonField(node, L"createdImages", value.createdImages); + ConvertCustomTypeToJsonField(node, L"imageCreations", value.imageCreations); + ConvertCustomTypeToJsonField(node, L"imageMetadatas", value.imageMetadatas); ConvertCustomTypeToJsonField(node, L"frames", value.frames); return node; } @@ -41976,7 +41996,8 @@ namespace vl::presentation::remoteprotocol for (auto field : jsonNode->fields) { if (field->name.value == L"createdElements") ConvertJsonToCustomType(field->value, value.createdElements); else - if (field->name.value == L"createdImages") ConvertJsonToCustomType(field->value, value.createdImages); else + if (field->name.value == L"imageCreations") ConvertJsonToCustomType(field->value, value.imageCreations); else + if (field->name.value == L"imageMetadatas") ConvertJsonToCustomType(field->value, value.imageMetadatas); else if (field->name.value == L"frames") ConvertJsonToCustomType(field->value, value.frames); else CHECK_FAIL(ERROR_MESSAGE_PREFIX L"Unsupported struct member."); } diff --git a/Import/GacUI.h b/Import/GacUI.h index 443a5440..f14d7732 100644 --- a/Import/GacUI.h +++ b/Import/GacUI.h @@ -22311,7 +22311,8 @@ namespace vl::presentation::remoteprotocol struct RenderingTrace { ::vl::Ptr<::vl::collections::Dictionary<::vl::vint, ::vl::presentation::remoteprotocol::RendererType>> createdElements; - ::vl::Ptr<::vl::presentation::remoteprotocol::ArrayMap<::vl::vint, ::vl::presentation::remoteprotocol::ImageMetadata, &::vl::presentation::remoteprotocol::ImageMetadata::id>> createdImages; + ::vl::Ptr<::vl::presentation::remoteprotocol::ArrayMap<::vl::vint, ::vl::presentation::remoteprotocol::ImageCreation, &::vl::presentation::remoteprotocol::ImageCreation::id>> imageCreations; + ::vl::Ptr<::vl::presentation::remoteprotocol::ArrayMap<::vl::vint, ::vl::presentation::remoteprotocol::ImageMetadata, &::vl::presentation::remoteprotocol::ImageMetadata::id>> imageMetadatas; ::vl::Ptr<::vl::collections::List<::vl::presentation::remoteprotocol::RenderingFrame>> frames; }; @@ -22622,6 +22623,7 @@ GuiRemoteGraphicsImage GuiRemoteGraphicsImage(GuiRemoteController* _remote, vint _id, Ptr _binary); ~GuiRemoteGraphicsImage(); + stream::IStream& GetBinaryData(); remoteprotocol::ImageCreation GenerateImageCreation(); void UpdateFromImageMetadata(const remoteprotocol::ImageMetadata& imageMetadata); @@ -25251,7 +25253,9 @@ namespace gaclib_controls ::vl::Ptr<::gaclib_controls::IDialogStringsStrings> GetStrings(); void SetStrings(::vl::Ptr<::gaclib_controls::IDialogStringsStrings> __vwsn_value_); ::vl::Event StringsChanged; + private: ::vl::Ptr<::vl::presentation::IColorDialogViewModel> __vwsn_parameter_ViewModel; + public: ::vl::Ptr<::vl::presentation::IColorDialogViewModel> GetViewModel(); ColorDialogControl(::vl::Ptr<::vl::presentation::IColorDialogViewModel> __vwsn_ctor_parameter_ViewModel); ~ColorDialogControl(); @@ -25311,7 +25315,9 @@ namespace gaclib_controls ::vl::Ptr<::gaclib_controls::IDialogStringsStrings> GetStrings(); void SetStrings(::vl::Ptr<::gaclib_controls::IDialogStringsStrings> __vwsn_value_); ::vl::Event StringsChanged; + private: ::vl::Ptr<::vl::presentation::IColorDialogViewModel> __vwsn_parameter_ViewModel; + public: ::vl::Ptr<::vl::presentation::IColorDialogViewModel> GetViewModel(); ColorDialogWindow(::vl::Ptr<::vl::presentation::IColorDialogViewModel> __vwsn_ctor_parameter_ViewModel); ~ColorDialogWindow(); @@ -25387,7 +25393,9 @@ namespace gaclib_controls ::vl::Ptr<::gaclib_controls::IDialogStringsStrings> GetStrings(); void SetStrings(::vl::Ptr<::gaclib_controls::IDialogStringsStrings> __vwsn_value_); ::vl::Event StringsChanged; + private: ::vl::Ptr<::vl::presentation::IFileDialogViewModel> __vwsn_parameter_ViewModel; + public: ::vl::Ptr<::vl::presentation::IFileDialogViewModel> GetViewModel(); FileDialogWindow(::vl::Ptr<::vl::presentation::IFileDialogViewModel> __vwsn_ctor_parameter_ViewModel); void __vwsn_instance_ctor_(); @@ -25505,7 +25513,9 @@ namespace gaclib_controls ::vl::Ptr<::gaclib_controls::IDialogStringsStrings> GetStrings(); void SetStrings(::vl::Ptr<::gaclib_controls::IDialogStringsStrings> __vwsn_value_); ::vl::Event StringsChanged; + private: ::vl::Ptr<::vl::presentation::IFileDialogViewModel> __vwsn_parameter_ViewModel; + public: ::vl::Ptr<::vl::presentation::IFileDialogViewModel> GetViewModel(); FilePickerControl(::vl::Ptr<::vl::presentation::IFileDialogViewModel> __vwsn_ctor_parameter_ViewModel); void __vwsn_instance_ctor_(); @@ -25577,7 +25587,9 @@ namespace gaclib_controls ::vl::Ptr<::gaclib_controls::IDialogStringsStrings> GetStrings(); void SetStrings(::vl::Ptr<::gaclib_controls::IDialogStringsStrings> __vwsn_value_); ::vl::Event StringsChanged; + private: ::vl::Ptr<::vl::presentation::ICommonFontDialogViewModel> __vwsn_parameter_ViewModel; + public: ::vl::Ptr<::vl::presentation::ICommonFontDialogViewModel> GetViewModel(); FontNameControl(::vl::Ptr<::vl::presentation::ICommonFontDialogViewModel> __vwsn_ctor_parameter_ViewModel); ~FontNameControl(); @@ -25789,7 +25801,9 @@ namespace gaclib_controls ::vl::Ptr<::gaclib_controls::IDialogStringsStrings> GetStrings(); void SetStrings(::vl::Ptr<::gaclib_controls::IDialogStringsStrings> __vwsn_value_); ::vl::Event StringsChanged; + private: ::vl::Ptr<::vl::presentation::IFullFontDialogViewModel> __vwsn_parameter_ViewModel; + public: ::vl::Ptr<::vl::presentation::IFullFontDialogViewModel> GetViewModel(); FullFontDialogWindow(::vl::Ptr<::vl::presentation::IFullFontDialogViewModel> __vwsn_ctor_parameter_ViewModel); void __vwsn_instance_ctor_(); @@ -25885,7 +25899,9 @@ namespace gaclib_controls ::vl::Ptr<::gaclib_controls::IDialogStringsStrings> GetStrings(); void SetStrings(::vl::Ptr<::gaclib_controls::IDialogStringsStrings> __vwsn_value_); ::vl::Event StringsChanged; + private: ::vl::Ptr<::vl::presentation::IMessageBoxDialogAction> __vwsn_parameter_Action; + public: ::vl::Ptr<::vl::presentation::IMessageBoxDialogAction> GetAction(); MessageBoxButtonTemplate(::vl::Ptr<::vl::presentation::IMessageBoxDialogAction> __vwsn_ctor_parameter_Action); void __vwsn_instance_ctor_(); @@ -25931,7 +25947,9 @@ namespace gaclib_controls #endif public: ::vl::Ptr<::vl::presentation::INativeImage> GetIcon(::vl::presentation::INativeDialogService::MessageBoxIcons icon); + private: ::vl::Ptr<::vl::presentation::IMessageBoxDialogViewModel> __vwsn_parameter_ViewModel; + public: ::vl::Ptr<::vl::presentation::IMessageBoxDialogViewModel> GetViewModel(); MessageBoxWindow(::vl::Ptr<::vl::presentation::IMessageBoxDialogViewModel> __vwsn_ctor_parameter_ViewModel); void __vwsn_instance_ctor_(); @@ -26016,7 +26034,9 @@ namespace gaclib_controls ::vl::Ptr<::gaclib_controls::IDialogStringsStrings> GetStrings(); void SetStrings(::vl::Ptr<::gaclib_controls::IDialogStringsStrings> __vwsn_value_); ::vl::Event StringsChanged; + private: ::vl::Ptr<::vl::presentation::ISimpleFontDialogViewModel> __vwsn_parameter_ViewModel; + public: ::vl::Ptr<::vl::presentation::ISimpleFontDialogViewModel> GetViewModel(); SimpleFontDialogWindow(::vl::Ptr<::vl::presentation::ISimpleFontDialogViewModel> __vwsn_ctor_parameter_ViewModel); void __vwsn_instance_ctor_(); @@ -28246,6 +28266,7 @@ GuiHostedController void DpiChanged(bool preparing) override; void GotFocus() override; void LostFocus() override; + void Opened() override; void BeforeClosing(bool& cancel) override; void AfterClosing() override; void Paint() override; diff --git a/Import/GacUICompiler.cpp b/Import/GacUICompiler.cpp index a7290c00..f1e2e5f4 100644 --- a/Import/GacUICompiler.cpp +++ b/Import/GacUICompiler.cpp @@ -13668,6 +13668,11 @@ Workflow_GenerateInstanceClass decl->type = CopyType(type); decl->expression = CreateDefaultValue(parameterTypeInfoTuple.get<0>().Obj()); + auto att = Ptr(new WfAttribute); + att->category.value = L"cpp"; + att->name.value = L"Private"; + decl->attributes.Add(att); + Workflow_RecordScriptPosition(precompileContext, parameter->tagPosition, (Ptr)decl); } { diff --git a/Import/Skins/DarkSkin/DarkSkin.h b/Import/Skins/DarkSkin/DarkSkin.h index e84661b4..f3be226a 100644 --- a/Import/Skins/DarkSkin/DarkSkin.h +++ b/Import/Skins/DarkSkin/DarkSkin.h @@ -3426,7 +3426,9 @@ namespace darkskin ::vl::presentation::controls::ITabCommandExecutor* GetCommands(); void SetCommands(::vl::presentation::controls::ITabCommandExecutor* __vwsn_value_); ::vl::Event CommandsChanged; + private: ::vl::presentation::controls::GuiTabPage* __vwsn_parameter_CurrentTabPage; + public: ::vl::presentation::controls::GuiTabPage* GetCurrentTabPage(); TabHeaderTemplate(::vl::presentation::controls::GuiTabPage* __vwsn_ctor_parameter_CurrentTabPage); ~TabHeaderTemplate(); diff --git a/Import/Vlpp.h b/Import/Vlpp.h index cfcc5e56..fa93e480 100644 --- a/Import/Vlpp.h +++ b/Import/Vlpp.h @@ -7360,7 +7360,7 @@ Functions: [T] .OrderBySelf() => [T] [T] .Aggregate(T->T->T) => T - [T] .Aggregate(T->T->T, T) => T + [T] .Aggregate(T, T->T->T) => T [T] .All(T->bool) => bool [T] .Any(T->bool) => bool [T] .Max() => T diff --git a/Tutorial/GacUI_ControlTemplate/BlackSkin/UI/FullControlTest/Source/DemoPartialClasses.h b/Tutorial/GacUI_ControlTemplate/BlackSkin/UI/FullControlTest/Source/DemoPartialClasses.h index 1848a498..7439e330 100644 --- a/Tutorial/GacUI_ControlTemplate/BlackSkin/UI/FullControlTest/Source/DemoPartialClasses.h +++ b/Tutorial/GacUI_ControlTemplate/BlackSkin/UI/FullControlTest/Source/DemoPartialClasses.h @@ -868,8 +868,9 @@ namespace demo #ifdef VCZH_DESCRIPTABLEOBJECT_WITH_METADATA friend struct ::vl::reflection::description::CustomTypeDescriptorSelector; #endif - public: + private: ::demo::MyCategory __vwsn_parameter_SelectedCategory; + public: ::demo::MyCategory GetSelectedCategory(); CategoryItemTemplate(::demo::MyCategory __vwsn_ctor_parameter_SelectedCategory); ~CategoryItemTemplate(); @@ -1976,8 +1977,9 @@ namespace demo #ifdef VCZH_DESCRIPTABLEOBJECT_WITH_METADATA friend struct ::vl::reflection::description::CustomTypeDescriptorSelector; #endif - public: + private: ::demo::MyGender __vwsn_parameter_SelectedGender; + public: ::demo::MyGender GetSelectedGender(); GenderItemTemplate(::demo::MyGender __vwsn_ctor_parameter_SelectedGender); ~GenderItemTemplate(); @@ -3279,8 +3281,9 @@ namespace demo #ifdef VCZH_DESCRIPTABLEOBJECT_WITH_METADATA friend struct ::vl::reflection::description::CustomTypeDescriptorSelector; #endif - public: + private: ::vl::Ptr<::demo::MyTextItem> __vwsn_parameter_ViewModel; + public: ::vl::Ptr<::demo::MyTextItem> GetViewModel(); RepeatItemTemplate(::vl::Ptr<::demo::MyTextItem> __vwsn_ctor_parameter_ViewModel); ~RepeatItemTemplate(); @@ -3671,8 +3674,9 @@ namespace demo #ifdef VCZH_DESCRIPTABLEOBJECT_WITH_METADATA friend struct ::vl::reflection::description::CustomTypeDescriptorSelector; #endif - public: + private: ::vl::Ptr<::demo::MyTextItem> __vwsn_parameter_ViewModel; + public: ::vl::Ptr<::demo::MyTextItem> GetViewModel(); SharedSizeItemTemplate(::vl::Ptr<::demo::MyTextItem> __vwsn_ctor_parameter_ViewModel); ~SharedSizeItemTemplate(); @@ -3711,8 +3715,9 @@ namespace demo #ifdef VCZH_DESCRIPTABLEOBJECT_WITH_METADATA friend struct ::vl::reflection::description::CustomTypeDescriptorSelector; #endif - public: + private: ::vl::Ptr<::demo::MyTextItem> __vwsn_parameter_ViewModel; + public: ::vl::Ptr<::demo::MyTextItem> GetViewModel(); SharedSizeTextItemTemplate(::vl::Ptr<::demo::MyTextItem> __vwsn_ctor_parameter_ViewModel); ~SharedSizeTextItemTemplate(); @@ -3796,8 +3801,9 @@ namespace demo #ifdef VCZH_DESCRIPTABLEOBJECT_WITH_METADATA friend struct ::vl::reflection::description::CustomTypeDescriptorSelector; #endif - public: + private: ::vl::Ptr<::demo::StyleItem> __vwsn_parameter_ViewModel; + public: ::vl::Ptr<::demo::StyleItem> GetViewModel(); StyleItemTemplate(::vl::Ptr<::demo::StyleItem> __vwsn_ctor_parameter_ViewModel); void __vwsn_instance_ctor_(); diff --git a/Tutorial/GacUI_Controls/AddressBook/UI/Source/MainWindow.h b/Tutorial/GacUI_Controls/AddressBook/UI/Source/MainWindow.h index b0c940cd..1f664f18 100644 --- a/Tutorial/GacUI_Controls/AddressBook/UI/Source/MainWindow.h +++ b/Tutorial/GacUI_Controls/AddressBook/UI/Source/MainWindow.h @@ -74,7 +74,9 @@ namespace demo #endif public: void ClearViewSelection(); + private: ::vl::Ptr<::demo::IViewModel> __vwsn_parameter_ViewModel; + public: ::vl::Ptr<::demo::IViewModel> GetViewModel(); MainWindow(::vl::Ptr<::demo::IViewModel> __vwsn_ctor_parameter_ViewModel); ~MainWindow(); diff --git a/Tutorial/GacUI_Controls/CalculatorAndStateMachine/UI/Source/DemoPartialClasses.h b/Tutorial/GacUI_Controls/CalculatorAndStateMachine/UI/Source/DemoPartialClasses.h index 53f7000d..5cf76c11 100644 --- a/Tutorial/GacUI_Controls/CalculatorAndStateMachine/UI/Source/DemoPartialClasses.h +++ b/Tutorial/GacUI_Controls/CalculatorAndStateMachine/UI/Source/DemoPartialClasses.h @@ -185,8 +185,9 @@ namespace demo #ifdef VCZH_DESCRIPTABLEOBJECT_WITH_METADATA friend struct ::vl::reflection::description::CustomTypeDescriptorSelector; #endif - public: + private: ::vl::Ptr<::demo::Calculator> __vwsn_parameter_calculator; + public: ::vl::Ptr<::demo::Calculator> Getcalculator(); MainWindow(::vl::Ptr<::demo::Calculator> __vwsn_ctor_parameter_calculator); ~MainWindow(); diff --git a/Tutorial/GacUI_Controls/ColorPicker/UI/Source/DemoPartialClasses.h b/Tutorial/GacUI_Controls/ColorPicker/UI/Source/DemoPartialClasses.h index 43b54d02..03fd7fcf 100644 --- a/Tutorial/GacUI_Controls/ColorPicker/UI/Source/DemoPartialClasses.h +++ b/Tutorial/GacUI_Controls/ColorPicker/UI/Source/DemoPartialClasses.h @@ -72,8 +72,9 @@ namespace demo #ifdef VCZH_DESCRIPTABLEOBJECT_WITH_METADATA friend struct ::vl::reflection::description::CustomTypeDescriptorSelector; #endif - public: + private: ::vl::Ptr<::demo::IColorItem> __vwsn_parameter_ViewModel; + public: ::vl::Ptr<::demo::IColorItem> GetViewModel(); ColorComboItemTemplate(::vl::Ptr<::demo::IColorItem> __vwsn_ctor_parameter_ViewModel); ~ColorComboItemTemplate(); @@ -103,8 +104,9 @@ namespace demo #ifdef VCZH_DESCRIPTABLEOBJECT_WITH_METADATA friend struct ::vl::reflection::description::CustomTypeDescriptorSelector; #endif - public: + private: ::vl::Ptr<::demo::IColorItem> __vwsn_parameter_ViewModel; + public: ::vl::Ptr<::demo::IColorItem> GetViewModel(); ColorListItemTemplate(::vl::Ptr<::demo::IColorItem> __vwsn_ctor_parameter_ViewModel); ~ColorListItemTemplate(); @@ -162,8 +164,9 @@ namespace demo #ifdef VCZH_DESCRIPTABLEOBJECT_WITH_METADATA friend struct ::vl::reflection::description::CustomTypeDescriptorSelector; #endif - public: + private: ::vl::Ptr<::demo::IViewModel> __vwsn_parameter_ViewModel; + public: ::vl::Ptr<::demo::IViewModel> GetViewModel(); MainWindow(::vl::Ptr<::demo::IViewModel> __vwsn_ctor_parameter_ViewModel); ~MainWindow(); diff --git a/Tutorial/GacUI_Controls/ColorPicker2/UI/Source/DemoPartialClasses.h b/Tutorial/GacUI_Controls/ColorPicker2/UI/Source/DemoPartialClasses.h index 5d69d0e3..dd16fb64 100644 --- a/Tutorial/GacUI_Controls/ColorPicker2/UI/Source/DemoPartialClasses.h +++ b/Tutorial/GacUI_Controls/ColorPicker2/UI/Source/DemoPartialClasses.h @@ -75,8 +75,9 @@ namespace demo #ifdef VCZH_DESCRIPTABLEOBJECT_WITH_METADATA friend struct ::vl::reflection::description::CustomTypeDescriptorSelector; #endif - public: + private: ::vl::Ptr<::demo::IColorItem> __vwsn_parameter_ViewModel; + public: ::vl::Ptr<::demo::IColorItem> GetViewModel(); ColorBomboItemTemplate(::vl::Ptr<::demo::IColorItem> __vwsn_ctor_parameter_ViewModel); ~ColorBomboItemTemplate(); @@ -146,8 +147,9 @@ namespace demo #ifdef VCZH_DESCRIPTABLEOBJECT_WITH_METADATA friend struct ::vl::reflection::description::CustomTypeDescriptorSelector; #endif - public: + private: ::vl::Ptr<::demo::IViewModel> __vwsn_parameter_ViewModel; + public: ::vl::Ptr<::demo::IViewModel> GetViewModel(); MainWindow(::vl::Ptr<::demo::IViewModel> __vwsn_ctor_parameter_ViewModel); ~MainWindow(); diff --git a/Tutorial/GacUI_Controls/DataGrid/UI/Source/DemoPartialClasses.h b/Tutorial/GacUI_Controls/DataGrid/UI/Source/DemoPartialClasses.h index 93187dc2..7bafc309 100644 --- a/Tutorial/GacUI_Controls/DataGrid/UI/Source/DemoPartialClasses.h +++ b/Tutorial/GacUI_Controls/DataGrid/UI/Source/DemoPartialClasses.h @@ -268,8 +268,9 @@ namespace demo #ifdef VCZH_DESCRIPTABLEOBJECT_WITH_METADATA friend struct ::vl::reflection::description::CustomTypeDescriptorSelector; #endif - public: + private: ::demo::MyCategory __vwsn_parameter_SelectedCategory; + public: ::demo::MyCategory GetSelectedCategory(); CategoryItemTemplate(::demo::MyCategory __vwsn_ctor_parameter_SelectedCategory); ~CategoryItemTemplate(); @@ -492,8 +493,9 @@ namespace demo #ifdef VCZH_DESCRIPTABLEOBJECT_WITH_METADATA friend struct ::vl::reflection::description::CustomTypeDescriptorSelector; #endif - public: + private: ::demo::MyGender __vwsn_parameter_SelectedGender; + public: ::demo::MyGender GetSelectedGender(); GenderItemTemplate(::demo::MyGender __vwsn_ctor_parameter_SelectedGender); ~GenderItemTemplate(); diff --git a/Tutorial/GacUI_Controls/DocumentEditorRibbon/UI/Source/EditorRibbonPartialClasses.h b/Tutorial/GacUI_Controls/DocumentEditorRibbon/UI/Source/EditorRibbonPartialClasses.h index 48027805..44ff7167 100644 --- a/Tutorial/GacUI_Controls/DocumentEditorRibbon/UI/Source/EditorRibbonPartialClasses.h +++ b/Tutorial/GacUI_Controls/DocumentEditorRibbon/UI/Source/EditorRibbonPartialClasses.h @@ -357,8 +357,9 @@ namespace demo #ifdef VCZH_DESCRIPTABLEOBJECT_WITH_METADATA friend struct ::vl::reflection::description::CustomTypeDescriptorSelector; #endif - public: + private: ::vl::Ptr<::demo::StyleItem> __vwsn_parameter_ViewModel; + public: ::vl::Ptr<::demo::StyleItem> GetViewModel(); StyleItemTemplate(::vl::Ptr<::demo::StyleItem> __vwsn_ctor_parameter_ViewModel); void __vwsn_instance_ctor_(); diff --git a/Tutorial/GacUI_Controls/ProgressAndAsync/UI/Source/DemoPartialClasses.h b/Tutorial/GacUI_Controls/ProgressAndAsync/UI/Source/DemoPartialClasses.h index 5f10ca23..cc54ed8d 100644 --- a/Tutorial/GacUI_Controls/ProgressAndAsync/UI/Source/DemoPartialClasses.h +++ b/Tutorial/GacUI_Controls/ProgressAndAsync/UI/Source/DemoPartialClasses.h @@ -113,8 +113,9 @@ namespace demo #ifdef VCZH_DESCRIPTABLEOBJECT_WITH_METADATA friend struct ::vl::reflection::description::CustomTypeDescriptorSelector; #endif - public: + private: ::vl::Ptr<::demo::IViewModel> __vwsn_parameter_ViewModel; + public: ::vl::Ptr<::demo::IViewModel> GetViewModel(); MainWindow(::vl::Ptr<::demo::IViewModel> __vwsn_ctor_parameter_ViewModel); ~MainWindow(); diff --git a/Tutorial/GacUI_Controls/TextEditor/UI/Source/DemoPartialClasses.h b/Tutorial/GacUI_Controls/TextEditor/UI/Source/DemoPartialClasses.h index 9fae7fdd..360192bd 100644 --- a/Tutorial/GacUI_Controls/TextEditor/UI/Source/DemoPartialClasses.h +++ b/Tutorial/GacUI_Controls/TextEditor/UI/Source/DemoPartialClasses.h @@ -300,8 +300,9 @@ namespace demo #ifdef VCZH_DESCRIPTABLEOBJECT_WITH_METADATA friend struct ::vl::reflection::description::CustomTypeDescriptorSelector; #endif - public: + private: ::vl::presentation::controls::GuiToolstripCommand* __vwsn_parameter_ViewModel; + public: ::vl::presentation::controls::GuiToolstripCommand* GetViewModel(); RecentFileItemTemplate(::vl::presentation::controls::GuiToolstripCommand* __vwsn_ctor_parameter_ViewModel); ~RecentFileItemTemplate(); diff --git a/Tutorial/GacUI_HelloWorlds/MVVM/UI/Source/MainWindow.h b/Tutorial/GacUI_HelloWorlds/MVVM/UI/Source/MainWindow.h index 74ec221d..deac4b38 100644 --- a/Tutorial/GacUI_HelloWorlds/MVVM/UI/Source/MainWindow.h +++ b/Tutorial/GacUI_HelloWorlds/MVVM/UI/Source/MainWindow.h @@ -47,7 +47,9 @@ namespace helloworld bool GetHasLoggedIn(); void SetHasLoggedIn(bool __vwsn_value_); ::vl::Event HasLoggedInChanged; + private: ::vl::Ptr<::vm::IViewModel> __vwsn_parameter_ViewModel; + public: ::vl::Ptr<::vm::IViewModel> GetViewModel(); protected: void buttonSignUp_Clicked(::vl::presentation::compositions::GuiGraphicsComposition* sender, ::vl::presentation::compositions::GuiEventArgs* arguments); diff --git a/Tutorial/GacUI_HelloWorlds/UIRes/Xml.bin.x64 b/Tutorial/GacUI_HelloWorlds/UIRes/Xml.bin.x64 index fb0e6663..3fe99ea3 100644 Binary files a/Tutorial/GacUI_HelloWorlds/UIRes/Xml.bin.x64 and b/Tutorial/GacUI_HelloWorlds/UIRes/Xml.bin.x64 differ diff --git a/Tutorial/GacUI_HelloWorlds/UIRes/Xml.bin.x86 b/Tutorial/GacUI_HelloWorlds/UIRes/Xml.bin.x86 index 511af69f..058fd491 100644 Binary files a/Tutorial/GacUI_HelloWorlds/UIRes/Xml.bin.x86 and b/Tutorial/GacUI_HelloWorlds/UIRes/Xml.bin.x86 differ diff --git a/Tutorial/GacUI_Layout/Responsive2/UI/Source/DemoPartialClasses.h b/Tutorial/GacUI_Layout/Responsive2/UI/Source/DemoPartialClasses.h index f850d3eb..b68e3c67 100644 --- a/Tutorial/GacUI_Layout/Responsive2/UI/Source/DemoPartialClasses.h +++ b/Tutorial/GacUI_Layout/Responsive2/UI/Source/DemoPartialClasses.h @@ -188,8 +188,9 @@ namespace demo #ifdef VCZH_DESCRIPTABLEOBJECT_WITH_METADATA friend struct ::vl::reflection::description::CustomTypeDescriptorSelector; #endif - public: + private: ::vl::Ptr<::demo::AccountButtonViewModel> __vwsn_parameter_ViewModel; + public: ::vl::Ptr<::demo::AccountButtonViewModel> GetViewModel(); AccountItemTemplate(::vl::Ptr<::demo::AccountButtonViewModel> __vwsn_ctor_parameter_ViewModel); ~AccountItemTemplate(); @@ -220,8 +221,9 @@ namespace demo #ifdef VCZH_DESCRIPTABLEOBJECT_WITH_METADATA friend struct ::vl::reflection::description::CustomTypeDescriptorSelector; #endif - public: + private: ::vl::Ptr<::demo::AccountButtonViewModel> __vwsn_parameter_ViewModel; + public: ::vl::Ptr<::demo::AccountButtonViewModel> GetViewModel(); AccountMenuItemTemplate(::vl::Ptr<::demo::AccountButtonViewModel> __vwsn_ctor_parameter_ViewModel); ~AccountMenuItemTemplate(); @@ -332,8 +334,9 @@ namespace demo #ifdef VCZH_DESCRIPTABLEOBJECT_WITH_METADATA friend struct ::vl::reflection::description::CustomTypeDescriptorSelector; #endif - public: + private: ::vl::Ptr<::demo::VideoViewModel> __vwsn_parameter_ViewModel; + public: ::vl::Ptr<::demo::VideoViewModel> GetViewModel(); VideoItemTemplate(::vl::Ptr<::demo::VideoViewModel> __vwsn_ctor_parameter_ViewModel); ~VideoItemTemplate(); diff --git a/Tutorial/GacUI_Layout/RichTextEmbedding/UI/Source/DemoPartialClasses.h b/Tutorial/GacUI_Layout/RichTextEmbedding/UI/Source/DemoPartialClasses.h index a5cabc28..c751044c 100644 --- a/Tutorial/GacUI_Layout/RichTextEmbedding/UI/Source/DemoPartialClasses.h +++ b/Tutorial/GacUI_Layout/RichTextEmbedding/UI/Source/DemoPartialClasses.h @@ -115,8 +115,9 @@ namespace demo #ifdef VCZH_DESCRIPTABLEOBJECT_WITH_METADATA friend struct ::vl::reflection::description::CustomTypeDescriptorSelector; #endif - public: + private: ::vl::Ptr<::demo::IViewModel> __vwsn_parameter_ViewModel; + public: ::vl::Ptr<::demo::IViewModel> GetViewModel(); MainWindow(::vl::Ptr<::demo::IViewModel> __vwsn_ctor_parameter_ViewModel); ~MainWindow(); diff --git a/Tutorial/GacUI_Layout/SharedSize/UI/Source/DemoPartialClasses.h b/Tutorial/GacUI_Layout/SharedSize/UI/Source/DemoPartialClasses.h index 59370da4..708194d8 100644 --- a/Tutorial/GacUI_Layout/SharedSize/UI/Source/DemoPartialClasses.h +++ b/Tutorial/GacUI_Layout/SharedSize/UI/Source/DemoPartialClasses.h @@ -246,8 +246,9 @@ namespace demo #ifdef VCZH_DESCRIPTABLEOBJECT_WITH_METADATA friend struct ::vl::reflection::description::CustomTypeDescriptorSelector; #endif - public: + private: ::vl::Ptr<::demo::MyTextItem> __vwsn_parameter_ViewModel; + public: ::vl::Ptr<::demo::MyTextItem> GetViewModel(); SharedSizeItemTemplate(::vl::Ptr<::demo::MyTextItem> __vwsn_ctor_parameter_ViewModel); ~SharedSizeItemTemplate(); @@ -286,8 +287,9 @@ namespace demo #ifdef VCZH_DESCRIPTABLEOBJECT_WITH_METADATA friend struct ::vl::reflection::description::CustomTypeDescriptorSelector; #endif - public: + private: ::vl::Ptr<::demo::MyTextItem> __vwsn_parameter_ViewModel; + public: ::vl::Ptr<::demo::MyTextItem> GetViewModel(); SharedSizeTextItemTemplate(::vl::Ptr<::demo::MyTextItem> __vwsn_ctor_parameter_ViewModel); ~SharedSizeTextItemTemplate(); diff --git a/Tutorial/GacUI_Xml/Binding_ViewModel/UI/Source/DemoPartialClasses.h b/Tutorial/GacUI_Xml/Binding_ViewModel/UI/Source/DemoPartialClasses.h index 25c70734..9d669100 100644 --- a/Tutorial/GacUI_Xml/Binding_ViewModel/UI/Source/DemoPartialClasses.h +++ b/Tutorial/GacUI_Xml/Binding_ViewModel/UI/Source/DemoPartialClasses.h @@ -75,8 +75,9 @@ namespace demo #ifdef VCZH_DESCRIPTABLEOBJECT_WITH_METADATA friend struct ::vl::reflection::description::CustomTypeDescriptorSelector; #endif - public: + private: ::vl::Ptr<::demo::IViewModel> __vwsn_parameter_ViewModel; + public: ::vl::Ptr<::demo::IViewModel> GetViewModel(); MainWindow(::vl::Ptr<::demo::IViewModel> __vwsn_ctor_parameter_ViewModel); ~MainWindow(); diff --git a/Tutorial/GacUI_Xml/Event_ViewModel/UI/Source/DemoPartialClasses.h b/Tutorial/GacUI_Xml/Event_ViewModel/UI/Source/DemoPartialClasses.h index bc946c35..d9d6fea0 100644 --- a/Tutorial/GacUI_Xml/Event_ViewModel/UI/Source/DemoPartialClasses.h +++ b/Tutorial/GacUI_Xml/Event_ViewModel/UI/Source/DemoPartialClasses.h @@ -84,8 +84,9 @@ namespace demo #ifdef VCZH_DESCRIPTABLEOBJECT_WITH_METADATA friend struct ::vl::reflection::description::CustomTypeDescriptorSelector; #endif - public: + private: ::vl::Ptr<::demo::IViewModel> __vwsn_parameter_ViewModel; + public: ::vl::Ptr<::demo::IViewModel> GetViewModel(); MainWindow(::vl::Ptr<::demo::IViewModel> __vwsn_ctor_parameter_ViewModel); ~MainWindow(); diff --git a/Tutorial/GacUI_Xml/Member_Parameter/UI/Source/DemoPartialClasses.h b/Tutorial/GacUI_Xml/Member_Parameter/UI/Source/DemoPartialClasses.h index c33d70fb..6bfe15fa 100644 --- a/Tutorial/GacUI_Xml/Member_Parameter/UI/Source/DemoPartialClasses.h +++ b/Tutorial/GacUI_Xml/Member_Parameter/UI/Source/DemoPartialClasses.h @@ -58,8 +58,9 @@ namespace demo #ifdef VCZH_DESCRIPTABLEOBJECT_WITH_METADATA friend struct ::vl::reflection::description::CustomTypeDescriptorSelector; #endif - public: + private: ::vl::Ptr<::demo::IViewModel> __vwsn_parameter_ViewModel; + public: ::vl::Ptr<::demo::IViewModel> GetViewModel(); MainWindow(::vl::Ptr<::demo::IViewModel> __vwsn_ctor_parameter_ViewModel); ~MainWindow();