(NOT READY) Update release

This commit is contained in:
Zihan Chen
2017-06-22 23:21:01 -07:00
parent 496e042251
commit a3671237eb
22 changed files with 832 additions and 604 deletions
+5 -5
View File
@@ -24,10 +24,10 @@ class Category : public Object, public ICategory
friend class ViewModel;
friend class Contact;
protected:
ICategory* parent;
WString name;
list::ObservableList<Ptr<ICategory>> folders;
list::ObservableList<Ptr<IContact>> contacts;
ICategory* parent;
WString name;
ObservableList<Ptr<ICategory>> folders;
ObservableList<Ptr<IContact>> contacts;
public:
Category(ICategory* _parent)
@@ -150,7 +150,7 @@ public:
class RootCategory : public Object, public ICategory
{
protected:
list::ObservableList<Ptr<ICategory>> folders;
ObservableList<Ptr<ICategory>> folders;
public:
RootCategory()
@@ -37,8 +37,8 @@
prop Parent : ICategory* {const, not observe}
prop Name : string {const, not observe}
prop Image : presentation::GuiImageData^ {const, not observe}
prop Folders : ObservableList^ {const, not observe}
prop Contacts : ObservableList^ {const, not observe}
prop Folders : observe ICategory^[] {const, not observe}
prop Contacts : observe IContact^[] {const, not observe}
}
interface IViewModel
@@ -14,7 +14,7 @@
<ref.Ctor>
<![CDATA[
{
var tempData : MyDataItem^[] =
var tempData : observe MyDataItem^[] =
{
new MyDataItem^("涼宮 春日", Female, Lime, (cast DateTime "1988-08-08 00:00:00.000"), "http://www.haruhi.tv/")
new MyDataItem^("キョン", Male, Black, (cast DateTime "1988-08-08 00:00:00.000"), "http://www.haruhi.tv/")
@@ -2494,7 +2494,7 @@ Class (::demo::MainWindow)
void MainWindow::__vwsn_instance_ctor_()
{
auto tempData = (::vl::__vwsn::CreateList().Add(::vl::Ptr<::demo::MyDataItem>(new ::demo::MyDataItem(::vl::WString(L"涼宮 春日", false), ::demo::MyGender::Female, ::demo::MyCategory::Lime, ::vl::__vwsn::Parse<::vl::DateTime>(::vl::WString(L"1988-08-08 00:00:00.000", false)), ::vl::WString(L"http://www.haruhi.tv/", false)))).Add(::vl::Ptr<::demo::MyDataItem>(new ::demo::MyDataItem(::vl::WString(L"キョン", false), ::demo::MyGender::Male, ::demo::MyCategory::Black, ::vl::__vwsn::Parse<::vl::DateTime>(::vl::WString(L"1988-08-08 00:00:00.000", false)), ::vl::WString(L"http://www.haruhi.tv/", false)))).Add(::vl::Ptr<::demo::MyDataItem>(new ::demo::MyDataItem(::vl::WString(L"长门 有希", false), ::demo::MyGender::Female, ::demo::MyCategory::White, ::vl::__vwsn::Parse<::vl::DateTime>(::vl::WString(L"2000-08-06 00:00:00.000", false)), ::vl::WString(L"http://www.haruhi.tv/", false)))).Add(::vl::Ptr<::demo::MyDataItem>(new ::demo::MyDataItem(::vl::WString(L"朝比奈 实玖瑠", false), ::demo::MyGender::Female, ::demo::MyCategory::Red, ::vl::__vwsn::Parse<::vl::DateTime>(::vl::WString(L"1987-08-30 00:00:00.000", false)), ::vl::WString(L"http://www.haruhi.tv/", false)))).Add(::vl::Ptr<::demo::MyDataItem>(new ::demo::MyDataItem(::vl::WString(L"古泉 一树", false), ::demo::MyGender::Male, ::demo::MyCategory::Blue, ::vl::__vwsn::Parse<::vl::DateTime>(::vl::WString(L"1986-08-12 00:00:00.000", false)), ::vl::WString(L"http://www.haruhi.tv/", false))))).list;
auto tempData = (::vl::__vwsn::CreateObservableList().Add(::vl::Ptr<::demo::MyDataItem>(new ::demo::MyDataItem(::vl::WString(L"涼宮 春日", false), ::demo::MyGender::Female, ::demo::MyCategory::Lime, ::vl::__vwsn::Parse<::vl::DateTime>(::vl::WString(L"1988-08-08 00:00:00.000", false)), ::vl::WString(L"http://www.haruhi.tv/", false)))).Add(::vl::Ptr<::demo::MyDataItem>(new ::demo::MyDataItem(::vl::WString(L"キョン", false), ::demo::MyGender::Male, ::demo::MyCategory::Black, ::vl::__vwsn::Parse<::vl::DateTime>(::vl::WString(L"1988-08-08 00:00:00.000", false)), ::vl::WString(L"http://www.haruhi.tv/", false)))).Add(::vl::Ptr<::demo::MyDataItem>(new ::demo::MyDataItem(::vl::WString(L"长门 有希", false), ::demo::MyGender::Female, ::demo::MyCategory::White, ::vl::__vwsn::Parse<::vl::DateTime>(::vl::WString(L"2000-08-06 00:00:00.000", false)), ::vl::WString(L"http://www.haruhi.tv/", false)))).Add(::vl::Ptr<::demo::MyDataItem>(new ::demo::MyDataItem(::vl::WString(L"朝比奈 实玖瑠", false), ::demo::MyGender::Female, ::demo::MyCategory::Red, ::vl::__vwsn::Parse<::vl::DateTime>(::vl::WString(L"1987-08-30 00:00:00.000", false)), ::vl::WString(L"http://www.haruhi.tv/", false)))).Add(::vl::Ptr<::demo::MyDataItem>(new ::demo::MyDataItem(::vl::WString(L"古泉 一树", false), ::demo::MyGender::Male, ::demo::MyCategory::Blue, ::vl::__vwsn::Parse<::vl::DateTime>(::vl::WString(L"1986-08-12 00:00:00.000", false)), ::vl::WString(L"http://www.haruhi.tv/", false))))).list;
auto largeImage = ::vl::__vwsn::Ensure(::vl::__vwsn::SharedPtrCast<::vl::presentation::GuiImageData>(this->ResolveResource(::vl::WString(L"res", false), ::vl::WString(L"Images/Large", false), true).Obj()));
auto smallImage = ::vl::__vwsn::Ensure(::vl::__vwsn::SharedPtrCast<::vl::presentation::GuiImageData>(this->ResolveResource(::vl::WString(L"res", false), ::vl::WString(L"Images/Small", false), true).Obj()));
{
+1 -27
View File
@@ -12,32 +12,6 @@ int CALLBACK WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLi
return SetupWindowsDirect2DRenderer();
}
class ViewModel : public Object, public IViewModel
{
public:
list::ObservableList<Ptr<MyTextItem>> textItems;
Ptr<IValueObservableList> GetTextItems()override
{
return textItems.GetWrapper();
}
void AddTextItem(Ptr<MyTextItem> item)override
{
textItems.Add(item);
}
void RemoveTextItem(vint32_t index)override
{
textItems.RemoveAt(index);
}
void ClearTextItems()override
{
textItems.Clear();
}
};
void GuiMain()
{
{
@@ -45,7 +19,7 @@ void GuiMain()
auto resource = GuiResource::LoadPrecompiledBinary(fileStream);
GetResourceManager()->SetResource(L"Resource", resource);
}
demo::MainWindow window(new ViewModel);
demo::MainWindow window;
window.MoveToScreenCenter();
GetApplication()->Run(&window);
}
@@ -7,12 +7,11 @@
listView.Items.Add(item);
});
var itemsToBind : ListViewItem^[] = {};
var itemsToBind : observe ListViewItem^[] = {};
LoadListView(this, func(item : ListViewItem^):void
{
itemsToBind.Add(item);
});
/* itemsToBind is not ObservableList so the ItemSource property should be assigned after the data is prepared. */
bindableListView.ItemSource = itemsToBind;
}
]]>
@@ -11,13 +11,12 @@
<Instance name="MainWindowResource">
<Instance ref.CodeBehind="false" ref.Class="demo::MainWindow" xmlns:demo="demo::*">
<ref.Parameter Name="ViewModel" Class="demo::IViewModel"/>
<Window ref.Name="self" Text="ListControls" ClientSize="x:640 y:480">
<att.BoundsComposition-set PreferredMinSize="x:640 y:480"/>
<Tab>
<att.BoundsComposition-set AlignmentToParent="left:5 top:5 right:5 bottom:5"/>
<att.Pages>
<demo:TextListTabPage Alt="T" ViewModel-eval="ViewModel"/>
<demo:TextListTabPage Alt="T"/>
<demo:ListViewTabPage Alt="L"/>
<demo:TreeViewTabPage Alt="R"/>
</att.Pages>
@@ -49,15 +48,6 @@
prop Name : string = "" {not observe}
prop Checked : bool = false {not observe}
}
interface IViewModel
{
prop TextItems : ObservableList^ {const, not observe}
func AddTextItem(item : MyTextItem^) : void;
func RemoveTextItem(index : int) : void;
func ClearTextItems() : void;
}
}
]]>
</Workflow>
@@ -23,7 +23,6 @@ namespace vl
namespace description
{
#ifndef VCZH_DEBUG_NO_REFLECTION
DECL_TYPE_INFO(::demo::IViewModel)
DECL_TYPE_INFO(::demo::ListViewTabPage)
DECL_TYPE_INFO(::demo::ListViewTabPageConstructor)
DECL_TYPE_INFO(::demo::MainWindow)
@@ -33,25 +32,6 @@ namespace vl
DECL_TYPE_INFO(::demo::TextListTabPageConstructor)
DECL_TYPE_INFO(::demo::TreeViewTabPage)
DECL_TYPE_INFO(::demo::TreeViewTabPageConstructor)
BEGIN_INTERFACE_PROXY_NOPARENT_SHAREDPTR(::demo::IViewModel)
void AddTextItem(::vl::Ptr<::demo::MyTextItem> item) override
{
INVOKE_INTERFACE_PROXY(AddTextItem, item);
}
void ClearTextItems() override
{
INVOKE_INTERFACE_PROXY_NOPARAMS(ClearTextItems);
}
::vl::Ptr<::vl::reflection::description::IValueObservableList> GetTextItems() override
{
INVOKEGET_INTERFACE_PROXY_NOPARAMS(GetTextItems);
}
void RemoveTextItem(::vl::vint32_t index) override
{
INVOKE_INTERFACE_PROXY(RemoveTextItem, index);
}
END_INTERFACE_PROXY(::demo::IViewModel)
#endif
extern bool LoadDemoTypes();
@@ -429,7 +429,6 @@ Closures
(i = (i + static_cast<::vl::vint32_t>(1)));
}
}
if (static_cast<bool>(::vl::__vwsn::This(__vwsnthis_0->ViewModel.Obj())->GetTextItems()))
{
{
auto __vwsn_for_begin_i = static_cast<::vl::vint32_t>(0);
@@ -440,7 +439,7 @@ Closures
{
auto textItem = ::vl::Ptr<::demo::MyTextItem>(new ::demo::MyTextItem());
::vl::__vwsn::This(textItem.Obj())->SetName(::vl::__vwsn::ToString((::vl::__vwsn::This(__vwsnthis_0->self)->counter + i)));
::vl::__vwsn::This(__vwsnthis_0->ViewModel.Obj())->AddTextItem(textItem);
::vl::__vwsn::This(::vl::__vwsn::This(__vwsnthis_0->self)->itemsToBind.Obj())->Add(::vl::__vwsn::Box(textItem));
}
(i = (i + static_cast<::vl::vint32_t>(1)));
}
@@ -466,12 +465,11 @@ Closures
(i = (i + static_cast<::vl::vint32_t>(1)));
}
}
if (static_cast<bool>(::vl::__vwsn::This(__vwsnthis_0->ViewModel.Obj())->GetTextItems()))
{
auto i = static_cast<::vl::vint32_t>(0);
while ((i < ::vl::__vwsn::This(::vl::__vwsn::This(__vwsnthis_0->ViewModel.Obj())->GetTextItems().Obj())->GetCount()))
while ((i < ::vl::__vwsn::This(::vl::__vwsn::This(__vwsnthis_0->self)->itemsToBind.Obj())->GetCount()))
{
::vl::__vwsn::This(__vwsnthis_0->ViewModel.Obj())->RemoveTextItem(i);
::vl::__vwsn::This(::vl::__vwsn::This(__vwsnthis_0->self)->itemsToBind.Obj())->RemoveAt(i);
(i = (i + static_cast<::vl::vint32_t>(1)));
}
}
@@ -494,12 +492,11 @@ Closures
(i = (i + static_cast<::vl::vint32_t>(1)));
}
}
if (static_cast<bool>(::vl::__vwsn::This(__vwsnthis_0->ViewModel.Obj())->GetTextItems()))
{
auto i = static_cast<::vl::vint32_t>(1);
while ((i < ::vl::__vwsn::This(::vl::__vwsn::This(__vwsnthis_0->ViewModel.Obj())->GetTextItems().Obj())->GetCount()))
while ((i < ::vl::__vwsn::This(::vl::__vwsn::This(__vwsnthis_0->self)->itemsToBind.Obj())->GetCount()))
{
::vl::__vwsn::This(__vwsnthis_0->ViewModel.Obj())->RemoveTextItem(i);
::vl::__vwsn::This(::vl::__vwsn::This(__vwsnthis_0->self)->itemsToBind.Obj())->RemoveAt(i);
(i = (i + static_cast<::vl::vint32_t>(1)));
}
}
@@ -515,10 +512,7 @@ Closures
void __vwsnf16_Demo_demo_TextListTabPageConstructor___vwsn_initialize_instance__::operator()(::vl::presentation::compositions::GuiGraphicsComposition* sender, ::vl::presentation::compositions::GuiEventArgs* arguments) const
{
::vl::__vwsn::This(::vl::__vwsn::UnboxCollection<::vl::reflection::description::IValueList>(::vl::__vwsn::This(__vwsnthis_0->textList)->GetItems()).Obj())->Clear();
if (static_cast<bool>(::vl::__vwsn::This(__vwsnthis_0->ViewModel.Obj())->GetTextItems()))
{
::vl::__vwsn::This(__vwsnthis_0->ViewModel.Obj())->ClearTextItems();
}
::vl::__vwsn::This(::vl::__vwsn::This(__vwsnthis_0->self)->itemsToBind.Obj())->Clear();
}
//-------------------------------------------------------------------
@@ -696,7 +690,7 @@ Closures
//-------------------------------------------------------------------
__vwsnf9_Demo_demo_ListViewTabPage___vwsn_instance_ctor__::__vwsnf9_Demo_demo_ListViewTabPage___vwsn_instance_ctor__(::vl::Ptr<::vl::reflection::description::IValueList> __vwsnctor_itemsToBind, ::demo::ListViewTabPage* __vwsnctorthis_0)
__vwsnf9_Demo_demo_ListViewTabPage___vwsn_instance_ctor__::__vwsnf9_Demo_demo_ListViewTabPage___vwsn_instance_ctor__(::vl::Ptr<::vl::reflection::description::IValueObservableList> __vwsnctor_itemsToBind, ::demo::ListViewTabPage* __vwsnctorthis_0)
:itemsToBind(__vwsnctor_itemsToBind)
, __vwsnthis_0(::vl::__vwsn::This(__vwsnctorthis_0))
{
@@ -1006,7 +1000,7 @@ Class (::demo::ListViewTabPage)
void ListViewTabPage::__vwsn_instance_ctor_()
{
GLOBAL_NAME LoadListView(static_cast<::vl::presentation::controls::GuiInstanceRootObject*>(this), LAMBDA(::vl_workflow_global::__vwsnf8_Demo_demo_ListViewTabPage___vwsn_instance_ctor__(this)));
auto itemsToBind = ::vl::reflection::description::IValueList::Create();
auto itemsToBind = ::vl::reflection::description::IValueObservableList::Create();
GLOBAL_NAME LoadListView(static_cast<::vl::presentation::controls::GuiInstanceRootObject*>(this), LAMBDA(::vl_workflow_global::__vwsnf9_Demo_demo_ListViewTabPage___vwsn_instance_ctor__(itemsToBind, this)));
::vl::__vwsn::This(this->bindableListView)->SetItemSource(::vl::Ptr<::vl::reflection::description::IValueEnumerable>(itemsToBind));
}
@@ -1023,7 +1017,6 @@ Class (::demo::MainWindowConstructor)
void MainWindowConstructor::__vwsn_initialize_instance_(::demo::MainWindow* __vwsn_this_)
{
(this->self = __vwsn_this_);
(this->ViewModel = ::vl::__vwsn::This(__vwsn_this_)->GetViewModel());
(this->__vwsn_precompile_5 = ::vl::__vwsn::This(this->self)->GetBoundsComposition());
{
::vl::__vwsn::This(this->__vwsn_precompile_5)->SetPreferredMinSize([&](){ ::vl::presentation::Size __vwsn_temp__; __vwsn_temp__.x = static_cast<::vl::vint32_t>(640); __vwsn_temp__.y = static_cast<::vl::vint32_t>(480); return __vwsn_temp__; }());
@@ -1038,7 +1031,7 @@ Class (::demo::MainWindowConstructor)
auto __vwsn_controlStyle_ = ::vl::__vwsn::This(::vl::presentation::theme::GetCurrentTheme())->CreateTabStyle();
(this->__vwsn_precompile_0 = new ::vl::presentation::controls::GuiTab(__vwsn_controlStyle_));
}
(this->__vwsn_precompile_2 = new ::demo::TextListTabPage(this->ViewModel));
(this->__vwsn_precompile_2 = new ::demo::TextListTabPage());
{
::vl::__vwsn::This(this->__vwsn_precompile_2)->SetAlt(::vl::WString(L"T", false));
}
@@ -1079,15 +1072,9 @@ Class (::demo::MainWindowConstructor)
Class (::demo::MainWindow)
***********************************************************************/
::vl::Ptr<::demo::IViewModel> MainWindow::GetViewModel()
{
return this->__vwsn_parameter_ViewModel;
}
MainWindow::MainWindow(::vl::Ptr<::demo::IViewModel> __vwsn_ctor_parameter_ViewModel)
MainWindow::MainWindow()
: ::vl::presentation::controls::GuiWindow(::vl::__vwsn::This(::vl::presentation::theme::GetCurrentTheme())->CreateWindowStyle())
{
(this->__vwsn_parameter_ViewModel = __vwsn_ctor_parameter_ViewModel);
auto __vwsn_resource_ = ::vl::__vwsn::This(::vl::presentation::GetResourceManager())->GetResourceFromClassName(::vl::WString(L"demo::MainWindow", false));
auto __vwsn_resolver_ = ::vl::Ptr<::vl::presentation::GuiResourcePathResolver>(new ::vl::presentation::GuiResourcePathResolver(__vwsn_resource_, ::vl::__vwsn::This(__vwsn_resource_.Obj())->GetWorkingDirectory()));
::vl::__vwsn::This(this)->SetResourceResolver(__vwsn_resolver_);
@@ -1106,7 +1093,6 @@ Class (::demo::TextListTabPageConstructor)
void TextListTabPageConstructor::__vwsn_initialize_instance_(::demo::TextListTabPage* __vwsn_this_)
{
(this->self = __vwsn_this_);
(this->ViewModel = ::vl::__vwsn::This(__vwsn_this_)->GetViewModel());
{
::vl::__vwsn::This(this->self)->SetText(::vl::WString(L"TextList", false));
}
@@ -1374,7 +1360,7 @@ Class (::demo::TextListTabPageConstructor)
::vl::__vwsn::EventAttach(::vl::__vwsn::This(this->__vwsn_precompile_21)->Clicked, __vwsn_event_handler_);
}
{
::vl::__vwsn::This(this->bindableTextList)->SetItemSource(::vl::Ptr<::vl::reflection::description::IValueEnumerable>(::vl::__vwsn::This(this->ViewModel.Obj())->GetTextItems()));
::vl::__vwsn::This(this->bindableTextList)->SetItemSource(::vl::Ptr<::vl::reflection::description::IValueEnumerable>(::vl::__vwsn::This(this->self)->itemsToBind));
}
}
@@ -1386,15 +1372,9 @@ Class (::demo::TextListTabPageConstructor)
Class (::demo::TextListTabPage)
***********************************************************************/
::vl::Ptr<::demo::IViewModel> TextListTabPage::GetViewModel()
{
return this->__vwsn_parameter_ViewModel;
}
TextListTabPage::TextListTabPage(::vl::Ptr<::demo::IViewModel> __vwsn_ctor_parameter_ViewModel)
TextListTabPage::TextListTabPage()
: ::vl::presentation::controls::GuiTabPage(::vl::__vwsn::This(::vl::presentation::theme::GetCurrentTheme())->CreateCustomControlStyle())
{
(this->__vwsn_parameter_ViewModel = __vwsn_ctor_parameter_ViewModel);
auto __vwsn_resource_ = ::vl::__vwsn::This(::vl::presentation::GetResourceManager())->GetResourceFromClassName(::vl::WString(L"demo::TextListTabPage", false));
auto __vwsn_resolver_ = ::vl::Ptr<::vl::presentation::GuiResourcePathResolver>(new ::vl::presentation::GuiResourcePathResolver(__vwsn_resource_, ::vl::__vwsn::This(__vwsn_resource_.Obj())->GetWorkingDirectory()));
::vl::__vwsn::This(this)->SetResourceResolver(__vwsn_resolver_);
@@ -1731,10 +1711,6 @@ Class (::demo::MyTextItem)
{
}
/***********************************************************************
Class (::demo::IViewModel)
***********************************************************************/
}
#undef GLOBAL_SYMBOL
#undef GLOBAL_NAME
@@ -1752,7 +1728,6 @@ namespace vl
namespace description
{
#ifndef VCZH_DEBUG_NO_REFLECTION
IMPL_CPP_TYPE_INFO(demo::IViewModel)
IMPL_CPP_TYPE_INFO(demo::ListViewTabPage)
IMPL_CPP_TYPE_INFO(demo::ListViewTabPageConstructor)
IMPL_CPP_TYPE_INFO(demo::MainWindow)
@@ -1764,14 +1739,6 @@ namespace vl
IMPL_CPP_TYPE_INFO(demo::TreeViewTabPageConstructor)
#define _ ,
BEGIN_INTERFACE_MEMBER(::demo::IViewModel)
CLASS_MEMBER_METHOD(AddTextItem, { L"item" })
CLASS_MEMBER_METHOD(ClearTextItems, NO_PARAMETER)
CLASS_MEMBER_METHOD(GetTextItems, NO_PARAMETER)
CLASS_MEMBER_METHOD(RemoveTextItem, { L"index" })
CLASS_MEMBER_PROPERTY_READONLY(TextItems, GetTextItems)
END_INTERFACE_MEMBER(::demo::IViewModel)
BEGIN_CLASS_MEMBER(::demo::ListViewTabPage)
CLASS_MEMBER_CONSTRUCTOR(::demo::ListViewTabPage*(), NO_PARAMETER)
CLASS_MEMBER_METHOD(__vwsn_instance_ctor_, NO_PARAMETER)
@@ -1809,10 +1776,7 @@ namespace vl
END_CLASS_MEMBER(::demo::ListViewTabPageConstructor)
BEGIN_CLASS_MEMBER(::demo::MainWindow)
CLASS_MEMBER_CONSTRUCTOR(::demo::MainWindow*(::vl::Ptr<::demo::IViewModel>), { L"__vwsn_ctor_parameter_ViewModel" })
CLASS_MEMBER_METHOD(GetViewModel, NO_PARAMETER)
CLASS_MEMBER_FIELD(__vwsn_parameter_ViewModel)
CLASS_MEMBER_PROPERTY_READONLY(ViewModel, GetViewModel)
CLASS_MEMBER_CONSTRUCTOR(::demo::MainWindow*(), NO_PARAMETER)
END_CLASS_MEMBER(::demo::MainWindow)
BEGIN_CLASS_MEMBER(::demo::MainWindowConstructor)
@@ -1824,7 +1788,6 @@ namespace vl
CLASS_MEMBER_FIELD(__vwsn_precompile_3)
CLASS_MEMBER_FIELD(__vwsn_precompile_4)
CLASS_MEMBER_FIELD(__vwsn_precompile_5)
CLASS_MEMBER_FIELD(ViewModel)
CLASS_MEMBER_FIELD(self)
END_CLASS_MEMBER(::demo::MainWindowConstructor)
@@ -1841,11 +1804,9 @@ namespace vl
END_CLASS_MEMBER(::demo::MyTextItem)
BEGIN_CLASS_MEMBER(::demo::TextListTabPage)
CLASS_MEMBER_CONSTRUCTOR(::demo::TextListTabPage*(::vl::Ptr<::demo::IViewModel>), { L"__vwsn_ctor_parameter_ViewModel" })
CLASS_MEMBER_METHOD(GetViewModel, NO_PARAMETER)
CLASS_MEMBER_FIELD(__vwsn_parameter_ViewModel)
CLASS_MEMBER_PROPERTY_READONLY(ViewModel, GetViewModel)
CLASS_MEMBER_CONSTRUCTOR(::demo::TextListTabPage*(), NO_PARAMETER)
CLASS_MEMBER_FIELD(counter)
CLASS_MEMBER_FIELD(itemsToBind)
END_CLASS_MEMBER(::demo::TextListTabPage)
BEGIN_CLASS_MEMBER(::demo::TextListTabPageConstructor)
@@ -1876,7 +1837,6 @@ namespace vl
CLASS_MEMBER_FIELD(__vwsn_precompile_7)
CLASS_MEMBER_FIELD(__vwsn_precompile_8)
CLASS_MEMBER_FIELD(__vwsn_precompile_9)
CLASS_MEMBER_FIELD(ViewModel)
CLASS_MEMBER_FIELD(bindableTextList)
CLASS_MEMBER_FIELD(comboView)
CLASS_MEMBER_FIELD(self)
@@ -1953,7 +1913,6 @@ namespace vl
public:
void Load(ITypeManager* manager)
{
ADD_TYPE_INFO(::demo::IViewModel)
ADD_TYPE_INFO(::demo::ListViewTabPage)
ADD_TYPE_INFO(::demo::ListViewTabPageConstructor)
ADD_TYPE_INFO(::demo::MainWindow)
@@ -60,7 +60,6 @@ namespace demo
class TreeViewTabPageConstructor;
class TreeViewTabPage;
class MyTextItem;
class IViewModel;
class ListViewTabPageConstructor : public ::vl::Object, public ::vl::reflection::Description<ListViewTabPageConstructor>
{
@@ -133,7 +132,6 @@ namespace demo
friend struct ::vl::reflection::description::CustomTypeDescriptorSelector<MainWindowConstructor>;
#endif
protected:
::vl::Ptr<::demo::IViewModel> ViewModel = ::vl::Ptr<::demo::IViewModel>();
::demo::MainWindow* self = static_cast<::demo::MainWindow*>(nullptr);
::vl::presentation::controls::GuiTab* __vwsn_precompile_0 = static_cast<::vl::presentation::controls::GuiTab*>(nullptr);
::vl::presentation::compositions::GuiBoundsComposition* __vwsn_precompile_1 = static_cast<::vl::presentation::compositions::GuiBoundsComposition*>(nullptr);
@@ -153,9 +151,7 @@ namespace demo
friend struct ::vl::reflection::description::CustomTypeDescriptorSelector<MainWindow>;
#endif
public:
::vl::Ptr<::demo::IViewModel> __vwsn_parameter_ViewModel = ::vl::Ptr<::demo::IViewModel>();
::vl::Ptr<::demo::IViewModel> GetViewModel();
MainWindow(::vl::Ptr<::demo::IViewModel> __vwsn_ctor_parameter_ViewModel);
MainWindow();
~MainWindow();
};
@@ -172,7 +168,6 @@ namespace demo
friend struct ::vl::reflection::description::CustomTypeDescriptorSelector<TextListTabPageConstructor>;
#endif
protected:
::vl::Ptr<::demo::IViewModel> ViewModel = ::vl::Ptr<::demo::IViewModel>();
::demo::TextListTabPage* self = static_cast<::demo::TextListTabPage*>(nullptr);
::vl::presentation::controls::GuiComboBoxListControl* comboView = static_cast<::vl::presentation::controls::GuiComboBoxListControl*>(nullptr);
::vl::presentation::controls::GuiTextList* textList = static_cast<::vl::presentation::controls::GuiTextList*>(nullptr);
@@ -222,9 +217,8 @@ namespace demo
#endif
public:
::vl::vint32_t counter = static_cast<::vl::vint32_t>(0);
::vl::Ptr<::demo::IViewModel> __vwsn_parameter_ViewModel = ::vl::Ptr<::demo::IViewModel>();
::vl::Ptr<::demo::IViewModel> GetViewModel();
TextListTabPage(::vl::Ptr<::demo::IViewModel> __vwsn_ctor_parameter_ViewModel);
::vl::Ptr<::vl::reflection::description::IValueObservableList> itemsToBind = ::vl::reflection::description::IValueObservableList::Create();
TextListTabPage();
~TextListTabPage();
};
@@ -326,18 +320,6 @@ namespace demo
MyTextItem();
};
class IViewModel : public virtual ::vl::reflection::IDescriptable, public ::vl::reflection::Description<IViewModel>
{
#ifndef VCZH_DEBUG_NO_REFLECTION
friend struct ::vl::reflection::description::CustomTypeDescriptorSelector<IViewModel>;
#endif
public:
virtual ::vl::Ptr<::vl::reflection::description::IValueObservableList> GetTextItems() = 0;
virtual void AddTextItem(::vl::Ptr<::demo::MyTextItem> item) = 0;
virtual void RemoveTextItem(::vl::vint32_t index) = 0;
virtual void ClearTextItems() = 0;
};
}
/***********************************************************************
Global Variables and Functions
@@ -522,10 +504,10 @@ Closures
struct __vwsnf9_Demo_demo_ListViewTabPage___vwsn_instance_ctor__
{
::vl::Ptr<::vl::reflection::description::IValueList> itemsToBind;
::vl::Ptr<::vl::reflection::description::IValueObservableList> itemsToBind;
::demo::ListViewTabPage* __vwsnthis_0;
__vwsnf9_Demo_demo_ListViewTabPage___vwsn_instance_ctor__(::vl::Ptr<::vl::reflection::description::IValueList> __vwsnctor_itemsToBind, ::demo::ListViewTabPage* __vwsnctorthis_0);
__vwsnf9_Demo_demo_ListViewTabPage___vwsn_instance_ctor__(::vl::Ptr<::vl::reflection::description::IValueObservableList> __vwsnctor_itemsToBind, ::demo::ListViewTabPage* __vwsnctorthis_0);
void operator()(::vl::Ptr<::vl::presentation::controls::list::ListViewItem> item) const;
};
@@ -2,9 +2,9 @@
<ref.Members>
<![CDATA[
var counter : int = 0;
var itemsToBind : observe MyTextItem^[] = {};
]]>
</ref.Members>
<ref.Parameter Name="ViewModel" Class="demo::IViewModel"/>
<TabPage ref.Name="self" Text="TextList">
<Table AlignmentToParent="left:0 top:0 right:0 bottom:0" CellPadding="5">
<att.Rows>
@@ -76,13 +76,12 @@
textList.Items.Add(textItem);
}
if (ViewModel.TextItems is not null)
{
for (i in range [0, 9])
{
var textItem = new demo::MyTextItem^();
textItem.Name = cast string (self.counter + i);
ViewModel.AddTextItem(textItem);
self.itemsToBind.Add(textItem);
}
}
@@ -107,12 +106,11 @@
}
}
if (ViewModel.TextItems is not null)
{
var i = 0;
while (i < ViewModel.TextItems.Count)
while (i < self.itemsToBind.Count)
{
ViewModel.RemoveTextItem(i);
self.itemsToBind.RemoveAt(i);
i = i + 1;
}
}
@@ -136,12 +134,11 @@
}
}
if (ViewModel.TextItems is not null)
{
var i = 1;
while (i < ViewModel.TextItems.Count)
while (i < self.itemsToBind.Count)
{
ViewModel.RemoveTextItem(i);
self.itemsToBind.RemoveAt(i);
i = i + 1;
}
}
@@ -157,11 +154,7 @@
<![CDATA[
{
textList.Items.Clear();
if (ViewModel.TextItems is not null)
{
ViewModel.ClearTextItems();
}
self.itemsToBind.Clear();
}
]]>
</ev.Clicked-eval>
@@ -173,7 +166,7 @@
<Cell Site="row:1 column:2">
<BindableTextList ref.Name="bindableTextList" Alt="B" env.ItemType="demo::MyTextItem^" HorizontalAlwaysVisible="false" VerticalAlwaysVisible="false">
<att.BoundsComposition-set AlignmentToParent="left:0 top:0 right:0 bottom:0"/>
<att.ItemSource-eval>ViewModel.TextItems</att.ItemSource-eval>
<att.ItemSource-eval>self.itemsToBind</att.ItemSource-eval>
<att.TextProperty>Name</att.TextProperty>
<att.CheckedProperty>Checked</att.CheckedProperty>
</BindableTextList>
Binary file not shown.