mirror of
https://github.com/vczh-libraries/Release.git
synced 2026-05-20 03:11:23 +08:00
Upgrade Tutorial\GacUI_Xml
This commit is contained in:
@@ -13,9 +13,8 @@ int CALLBACK WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLi
|
||||
void GuiMain()
|
||||
{
|
||||
{
|
||||
List<WString> errors;
|
||||
FileStream fileStream(L"../UIRes/Binding_Bind.bin", FileStream::ReadOnly);
|
||||
auto resource = GuiResource::LoadPrecompiledBinary(fileStream, errors);
|
||||
auto resource = GuiResource::LoadPrecompiledBinary(fileStream);
|
||||
GetResourceManager()->SetResource(L"Resource", resource);
|
||||
}
|
||||
demo::MainWindow window;
|
||||
|
||||
@@ -13,9 +13,8 @@ int CALLBACK WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLi
|
||||
void GuiMain()
|
||||
{
|
||||
{
|
||||
List<WString> errors;
|
||||
FileStream fileStream(L"../UIRes/Binding_Eval.bin", FileStream::ReadOnly);
|
||||
auto resource = GuiResource::LoadPrecompiledBinary(fileStream, errors);
|
||||
auto resource = GuiResource::LoadPrecompiledBinary(fileStream);
|
||||
GetResourceManager()->SetResource(L"Resource", resource);
|
||||
}
|
||||
demo::MainWindow window;
|
||||
|
||||
@@ -13,9 +13,8 @@ int CALLBACK WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLi
|
||||
void GuiMain()
|
||||
{
|
||||
{
|
||||
List<WString> errors;
|
||||
FileStream fileStream(L"../UIRes/Binding_Format.bin", FileStream::ReadOnly);
|
||||
auto resource = GuiResource::LoadPrecompiledBinary(fileStream, errors);
|
||||
auto resource = GuiResource::LoadPrecompiledBinary(fileStream);
|
||||
GetResourceManager()->SetResource(L"Resource", resource);
|
||||
}
|
||||
demo::MainWindow window;
|
||||
|
||||
@@ -13,9 +13,8 @@ int CALLBACK WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLi
|
||||
void GuiMain()
|
||||
{
|
||||
{
|
||||
List<WString> errors;
|
||||
FileStream fileStream(L"../UIRes/Binding_Uri.bin", FileStream::ReadOnly);
|
||||
auto resource = GuiResource::LoadPrecompiledBinary(fileStream, errors);
|
||||
auto resource = GuiResource::LoadPrecompiledBinary(fileStream);
|
||||
GetResourceManager()->SetResource(L"Resource", resource);
|
||||
}
|
||||
demo::MainWindow window;
|
||||
|
||||
@@ -22,9 +22,8 @@ public:
|
||||
void GuiMain()
|
||||
{
|
||||
{
|
||||
List<WString> errors;
|
||||
FileStream fileStream(L"../UIRes/Binding_ViewModel.bin", FileStream::ReadOnly);
|
||||
auto resource = GuiResource::LoadPrecompiledBinary(fileStream, errors);
|
||||
auto resource = GuiResource::LoadPrecompiledBinary(fileStream);
|
||||
GetResourceManager()->SetResource(L"Resource", resource);
|
||||
}
|
||||
demo::MainWindow window(new ViewModelImpl);
|
||||
|
||||
@@ -13,9 +13,8 @@ int CALLBACK WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLi
|
||||
void GuiMain()
|
||||
{
|
||||
{
|
||||
List<WString> errors;
|
||||
FileStream fileStream(L"../UIRes/Event_Cpp.bin", FileStream::ReadOnly);
|
||||
auto resource = GuiResource::LoadPrecompiledBinary(fileStream, errors);
|
||||
auto resource = GuiResource::LoadPrecompiledBinary(fileStream);
|
||||
GetResourceManager()->SetResource(L"Resource", resource);
|
||||
}
|
||||
demo::MainWindow window;
|
||||
|
||||
@@ -13,9 +13,8 @@ int CALLBACK WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLi
|
||||
void GuiMain()
|
||||
{
|
||||
{
|
||||
List<WString> errors;
|
||||
FileStream fileStream(L"../UIRes/Event_Script.bin", FileStream::ReadOnly);
|
||||
auto resource = GuiResource::LoadPrecompiledBinary(fileStream, errors);
|
||||
auto resource = GuiResource::LoadPrecompiledBinary(fileStream);
|
||||
GetResourceManager()->SetResource(L"Resource", resource);
|
||||
}
|
||||
demo::MainWindow window;
|
||||
|
||||
@@ -27,9 +27,8 @@ public:
|
||||
void GuiMain()
|
||||
{
|
||||
{
|
||||
List<WString> errors;
|
||||
FileStream fileStream(L"../UIRes/Event_ViewModel.bin", FileStream::ReadOnly);
|
||||
auto resource = GuiResource::LoadPrecompiledBinary(fileStream, errors);
|
||||
auto resource = GuiResource::LoadPrecompiledBinary(fileStream);
|
||||
GetResourceManager()->SetResource(L"Resource", resource);
|
||||
}
|
||||
demo::MainWindow window(new ViewModelImpl);
|
||||
|
||||
@@ -13,9 +13,8 @@ int CALLBACK WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLi
|
||||
void GuiMain()
|
||||
{
|
||||
{
|
||||
List<WString> errors;
|
||||
FileStream fileStream(L"../UIRes/Instance_Control.bin", FileStream::ReadOnly);
|
||||
auto resource = GuiResource::LoadPrecompiledBinary(fileStream, errors);
|
||||
auto resource = GuiResource::LoadPrecompiledBinary(fileStream);
|
||||
GetResourceManager()->SetResource(L"Resource", resource);
|
||||
}
|
||||
demo::MainWindow window;
|
||||
|
||||
@@ -13,9 +13,8 @@ int CALLBACK WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLi
|
||||
void GuiMain()
|
||||
{
|
||||
{
|
||||
List<WString> errors;
|
||||
FileStream fileStream(L"../UIRes/Instance_MultipleWindows.bin", FileStream::ReadOnly);
|
||||
auto resource = GuiResource::LoadPrecompiledBinary(fileStream, errors);
|
||||
auto resource = GuiResource::LoadPrecompiledBinary(fileStream);
|
||||
GetResourceManager()->SetResource(L"Resource", resource);
|
||||
}
|
||||
demo::MainWindow window;
|
||||
|
||||
@@ -13,9 +13,8 @@ int CALLBACK WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLi
|
||||
void GuiMain()
|
||||
{
|
||||
{
|
||||
List<WString> errors;
|
||||
FileStream fileStream(L"../UIRes/Instance_Window.bin", FileStream::ReadOnly);
|
||||
auto resource = GuiResource::LoadPrecompiledBinary(fileStream, errors);
|
||||
auto resource = GuiResource::LoadPrecompiledBinary(fileStream);
|
||||
GetResourceManager()->SetResource(L"Resource", resource);
|
||||
}
|
||||
demo::MainWindow window;
|
||||
|
||||
@@ -13,9 +13,8 @@ int CALLBACK WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLi
|
||||
void GuiMain()
|
||||
{
|
||||
{
|
||||
List<WString> errors;
|
||||
FileStream fileStream(L"../UIRes/Member_Field.bin", FileStream::ReadOnly);
|
||||
auto resource = GuiResource::LoadPrecompiledBinary(fileStream, errors);
|
||||
auto resource = GuiResource::LoadPrecompiledBinary(fileStream);
|
||||
GetResourceManager()->SetResource(L"Resource", resource);
|
||||
}
|
||||
demo::MainWindow window;
|
||||
|
||||
@@ -11,7 +11,6 @@
|
||||
<Folder name="MainWindow">
|
||||
<Instance name="MainWindowResource">
|
||||
<Instance ref.CodeBehind="true" ref.Class="demo::MainWindow">
|
||||
<ref.State Name="integerState" Type="int" Value="0"/>
|
||||
<ref.Members>
|
||||
<![CDATA[
|
||||
@cpp:Protected
|
||||
|
||||
@@ -22,9 +22,8 @@ public:
|
||||
void GuiMain()
|
||||
{
|
||||
{
|
||||
List<WString> errors;
|
||||
FileStream fileStream(L"../UIRes/Member_Parameter.bin", FileStream::ReadOnly);
|
||||
auto resource = GuiResource::LoadPrecompiledBinary(fileStream, errors);
|
||||
auto resource = GuiResource::LoadPrecompiledBinary(fileStream);
|
||||
GetResourceManager()->SetResource(L"Resource", resource);
|
||||
}
|
||||
demo::MainWindow window(new ViewModelImpl);
|
||||
|
||||
@@ -13,9 +13,8 @@ int CALLBACK WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLi
|
||||
void GuiMain()
|
||||
{
|
||||
{
|
||||
List<WString> errors;
|
||||
FileStream fileStream(L"../UIRes/Member_Property.bin", FileStream::ReadOnly);
|
||||
auto resource = GuiResource::LoadPrecompiledBinary(fileStream, errors);
|
||||
auto resource = GuiResource::LoadPrecompiledBinary(fileStream);
|
||||
GetResourceManager()->SetResource(L"Resource", resource);
|
||||
}
|
||||
demo::MainWindow window;
|
||||
|
||||
@@ -24,25 +24,7 @@
|
||||
<Instance ref.CodeBehind="false" ref.Class="demo::MyControl" xmlns:x="presentation::controls::GuiSelectableButton::*">
|
||||
<ref.Members>
|
||||
<![CDATA[
|
||||
@cpp:Protected
|
||||
var selectedOption : string = "A";
|
||||
event SelectedOptionChanged();
|
||||
|
||||
func GetSelectedOption() : string
|
||||
{
|
||||
return selectedOption;
|
||||
}
|
||||
|
||||
func SetSelectedOption(value : string) : void
|
||||
{
|
||||
if (selectedOption != value)
|
||||
{
|
||||
selectedOption = value;
|
||||
SelectedOptionChanged();
|
||||
}
|
||||
}
|
||||
|
||||
prop SelectedOption : string {GetSelectedOption, SetSelectedOption : SelectedOptionChanged}
|
||||
prop SelectedOption : string = "A" {}
|
||||
]]>
|
||||
</ref.Members>
|
||||
<CustomControl ref.Name="self">
|
||||
|
||||
@@ -475,14 +475,13 @@ Class (::demo::MyControl)
|
||||
|
||||
::vl::WString MyControl::GetSelectedOption()
|
||||
{
|
||||
return ::vl::__vwsn::This(this)->selectedOption;
|
||||
return ::vl::__vwsn::This(this)->__vwsn_prop_SelectedOption;
|
||||
}
|
||||
|
||||
void MyControl::SetSelectedOption(const ::vl::WString& value)
|
||||
void MyControl::SetSelectedOption(const ::vl::WString& __vwsn_value_)
|
||||
{
|
||||
if ((::vl::__vwsn::This(this)->selectedOption != value))
|
||||
if ((::vl::__vwsn::This(this)->__vwsn_prop_SelectedOption != __vwsn_value_))
|
||||
{
|
||||
(::vl::__vwsn::This(this)->selectedOption = value);
|
||||
(::vl::__vwsn::This(this)->__vwsn_prop_SelectedOption = __vwsn_value_);
|
||||
::vl::__vwsn::EventInvoke(::vl::__vwsn::This(this)->SelectedOptionChanged)();
|
||||
}
|
||||
}
|
||||
@@ -539,10 +538,10 @@ namespace vl
|
||||
BEGIN_CLASS_MEMBER(::demo::MyControl)
|
||||
CLASS_MEMBER_CONSTRUCTOR(::demo::MyControl*(), NO_PARAMETER)
|
||||
CLASS_MEMBER_METHOD(GetSelectedOption, NO_PARAMETER)
|
||||
CLASS_MEMBER_METHOD(SetSelectedOption, { L"value" })
|
||||
CLASS_MEMBER_METHOD(SetSelectedOption, { L"__vwsn_value_" })
|
||||
CLASS_MEMBER_EVENT(SelectedOptionChanged)
|
||||
CLASS_MEMBER_FIELD(__vwsn_prop_SelectedOption)
|
||||
CLASS_MEMBER_PROPERTY_EVENT(SelectedOption, GetSelectedOption, SetSelectedOption, SelectedOptionChanged)
|
||||
CLASS_MEMBER_FIELD(selectedOption)
|
||||
END_CLASS_MEMBER(::demo::MyControl)
|
||||
|
||||
BEGIN_CLASS_MEMBER(::demo::MyControlConstructor)
|
||||
|
||||
@@ -111,12 +111,11 @@ namespace demo
|
||||
#ifndef VCZH_DEBUG_NO_REFLECTION
|
||||
friend struct ::vl::reflection::description::CustomTypeDescriptorSelector<MyControl>;
|
||||
#endif
|
||||
protected:
|
||||
::vl::WString selectedOption = ::vl::WString(L"A", false);
|
||||
public:
|
||||
::vl::Event<void()> SelectedOptionChanged;
|
||||
::vl::WString __vwsn_prop_SelectedOption = ::vl::WString(L"A", false);
|
||||
::vl::WString GetSelectedOption();
|
||||
void SetSelectedOption(const ::vl::WString& value);
|
||||
void SetSelectedOption(const ::vl::WString& __vwsn_value_);
|
||||
::vl::Event<void()> SelectedOptionChanged;
|
||||
MyControl();
|
||||
~MyControl();
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user