diff --git a/Import/GacUICompiler.cpp b/Import/GacUICompiler.cpp index 01a4175a..330a1452 100644 --- a/Import/GacUICompiler.cpp +++ b/Import/GacUICompiler.cpp @@ -6852,34 +6852,30 @@ Workflow_GenerateInstanceClass { if (auto type = parseType(state->typeName, L"state \"" + state->name.ToString() + L" of instance \"" + context->className + L"\"")) { + auto decl = MakePtr(); + addDecl(decl); + + decl->name.value = state->name.ToString(); + decl->type = type; if (!beforePrecompile) { - auto decl = MakePtr(); - addDecl(decl); - - decl->name.value = state->name.ToString(); - decl->type = type; decl->expression = getPropValue(state->name.ToString(), type, state->value); } else { - { - auto decl = MakePtr(); - addDecl(decl); + auto nullExpr = MakePtr(); + nullExpr->value = WfLiteralValue::Null; - decl->anonymity = WfFunctionAnonymity::Named; - decl->name.value = L"" + state->name.ToString(); - decl->returnType = CopyType(type); - decl->statement = notImplemented(); - } - { - auto decl = MakePtr(); - addDecl(decl); + auto castObject = MakePtr(); + castObject->type = GetTypeFromTypeInfo(TypeInfoRetriver::CreateTypeInfo().Obj()); + castObject->expression = nullExpr; - decl->name.value = state->name.ToString(); - decl->type = type; - decl->getter.value = L"" + state->name.ToString(); - } + auto castType = MakePtr(); + castType->strategy = WfTypeCastingStrategy::Strong; + castType->type = CopyType(type); + castType->expression = castObject; + + decl->expression = castType; } } } diff --git a/Import/GacUIReflection.h b/Import/GacUIReflection.h index a1b79a56..44226bec 100644 --- a/Import/GacUIReflection.h +++ b/Import/GacUIReflection.h @@ -2362,6 +2362,7 @@ PartialClass arguments[1] = Value::From(resolver.Obj()); initialize->Invoke(ctorInstance, arguments); } + return true; } return false; } diff --git a/Tools/GacGen.exe b/Tools/GacGen.exe index 501c3ee1..59d74329 100644 Binary files a/Tools/GacGen.exe and b/Tools/GacGen.exe differ diff --git a/Tutorial/GacUI_ControlTemplate/UIRes/BlackSkin.bin b/Tutorial/GacUI_ControlTemplate/UIRes/BlackSkin.bin index f473671a..90d89b02 100644 Binary files a/Tutorial/GacUI_ControlTemplate/UIRes/BlackSkin.bin and b/Tutorial/GacUI_ControlTemplate/UIRes/BlackSkin.bin differ diff --git a/Tutorial/GacUI_Controls/UIRes/ContainersAndButtons.bin b/Tutorial/GacUI_Controls/UIRes/ContainersAndButtons.bin index daaeb031..42b6042e 100644 Binary files a/Tutorial/GacUI_Controls/UIRes/ContainersAndButtons.bin and b/Tutorial/GacUI_Controls/UIRes/ContainersAndButtons.bin differ diff --git a/Tutorial/GacUI_Controls/UIRes/TextEditor.bin b/Tutorial/GacUI_Controls/UIRes/TextEditor.bin index f6ab4a6a..96b5fcdb 100644 Binary files a/Tutorial/GacUI_Controls/UIRes/TextEditor.bin and b/Tutorial/GacUI_Controls/UIRes/TextEditor.bin differ diff --git a/Tutorial/GacUI_HelloWorlds/UIRes/CppXml.bin b/Tutorial/GacUI_HelloWorlds/UIRes/CppXml.bin index abf0e6f8..d3887465 100644 Binary files a/Tutorial/GacUI_HelloWorlds/UIRes/CppXml.bin and b/Tutorial/GacUI_HelloWorlds/UIRes/CppXml.bin differ diff --git a/Tutorial/GacUI_HelloWorlds/UIRes/MVVM.bin b/Tutorial/GacUI_HelloWorlds/UIRes/MVVM.bin index a9720bca..96385349 100644 Binary files a/Tutorial/GacUI_HelloWorlds/UIRes/MVVM.bin and b/Tutorial/GacUI_HelloWorlds/UIRes/MVVM.bin differ diff --git a/Tutorial/GacUI_Layout/UIRes/Alignment.bin b/Tutorial/GacUI_Layout/UIRes/Alignment.bin index da328d66..910206cb 100644 Binary files a/Tutorial/GacUI_Layout/UIRes/Alignment.bin and b/Tutorial/GacUI_Layout/UIRes/Alignment.bin differ diff --git a/Tutorial/GacUI_Layout/UIRes/Flow.bin b/Tutorial/GacUI_Layout/UIRes/Flow.bin index a42c62af..332f1f87 100644 Binary files a/Tutorial/GacUI_Layout/UIRes/Flow.bin and b/Tutorial/GacUI_Layout/UIRes/Flow.bin differ diff --git a/Tutorial/GacUI_Layout/UIRes/RichTextEmbedding.bin b/Tutorial/GacUI_Layout/UIRes/RichTextEmbedding.bin index a75a11d6..507c10ed 100644 Binary files a/Tutorial/GacUI_Layout/UIRes/RichTextEmbedding.bin and b/Tutorial/GacUI_Layout/UIRes/RichTextEmbedding.bin differ diff --git a/Tutorial/GacUI_Layout/UIRes/Stack.bin b/Tutorial/GacUI_Layout/UIRes/Stack.bin index e077d42b..35695731 100644 Binary files a/Tutorial/GacUI_Layout/UIRes/Stack.bin and b/Tutorial/GacUI_Layout/UIRes/Stack.bin differ diff --git a/Tutorial/GacUI_Layout/UIRes/Table.bin b/Tutorial/GacUI_Layout/UIRes/Table.bin index 0dbf5cf4..40e83c3b 100644 Binary files a/Tutorial/GacUI_Layout/UIRes/Table.bin and b/Tutorial/GacUI_Layout/UIRes/Table.bin differ