mirror of
https://github.com/vczh-libraries/Release.git
synced 2026-03-23 15:52:56 +08:00
demo: control_list_textlist_bindable
This commit is contained in:
Binary file not shown.
Binary file not shown.
@@ -0,0 +1,104 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Resource>
|
||||
<Folder name="GacGenConfig">
|
||||
<Folder name="ResX86">
|
||||
<Text name="Resource">..\..\UIRes\32bits\control_list_textlist_bindable.bin</Text>
|
||||
</Folder>
|
||||
<Folder name="ResX64">
|
||||
<Text name="Resource">..\..\UIRes\64bits\control_list_textlist_bindable.bin</Text>
|
||||
</Folder>
|
||||
</Folder>
|
||||
<Folder name="MainWindow">
|
||||
<Script name="ViewModel">
|
||||
<Workflow><![CDATA[
|
||||
module viewmodel;
|
||||
using system::*;
|
||||
|
||||
namespace sample
|
||||
{
|
||||
class LoremIpsumItem
|
||||
{
|
||||
prop Text : string = Sys::LoremIpsumTitle(32) {const, not observe}
|
||||
prop Checked : bool = false {not observe}
|
||||
}
|
||||
}
|
||||
]]></Workflow>
|
||||
</Script>
|
||||
<Instance name="MainWindowResource">
|
||||
<Instance ref.Class="sample::MainWindow">
|
||||
<ref.Members><![CDATA[
|
||||
@cpp:Private
|
||||
var views: TextListView[] = {
|
||||
TextListView::Text;
|
||||
TextListView::Check;
|
||||
TextListView::Radio;
|
||||
};
|
||||
|
||||
@cpp:Private
|
||||
var items: observe LoremIpsumItem^[] = {};
|
||||
]]></ref.Members>
|
||||
<ref.Ctor><![CDATA[
|
||||
{
|
||||
for (i in range [0, 20))
|
||||
{
|
||||
self.items.Add(new LoremIpsumItem^());
|
||||
}
|
||||
}
|
||||
]]></ref.Ctor>
|
||||
<Window ref.Name="self" Text="control_list_textlist_bindable" ClientSize="x:480 y:320">
|
||||
<Table AlignmentToParent="left:0 top:0 right:0 bottom:0" CellPadding="5" BorderVisible="false" MinSizeLimitation="LimitToElementAndChildren">
|
||||
<att.Rows>
|
||||
<CellOption>composeType:MinSize</CellOption>
|
||||
<CellOption>composeType:Percentage percentage:1.0</CellOption>
|
||||
</att.Rows>
|
||||
<att.Columns>
|
||||
<CellOption>composeType:MinSize</CellOption>
|
||||
<CellOption>composeType:Absolute absolute:120</CellOption>
|
||||
<CellOption>composeType:Percentage percentage:1.0</CellOption>
|
||||
</att.Columns>
|
||||
|
||||
<Cell Site="row:0 column:0">
|
||||
<Table AlignmentToParent="left:0 top:0 right:0 bottom:0" CellPadding="5" BorderVisible="false" MinSizeLimitation="LimitToElementAndChildren">
|
||||
<att.Rows>
|
||||
<CellOption>composeType:Percentage percentage:0.5</CellOption>
|
||||
<CellOption>composeType:MinSize</CellOption>
|
||||
<CellOption>composeType:Percentage percentage:0.5</CellOption>
|
||||
</att.Rows>
|
||||
<att.Columns>
|
||||
<CellOption>composeType:Percentage percentage:1.0</CellOption>
|
||||
</att.Columns>
|
||||
<Cell Site="row:1 column:0">
|
||||
<Label Text="textList.View = TextListView::"/>
|
||||
</Cell>
|
||||
</Table>
|
||||
</Cell>
|
||||
|
||||
<Cell Site="row:0 column:1">
|
||||
<ComboBox ref.Name="comboView" SelectedIndex="0">
|
||||
<att.BoundsComposition-set AlignmentToParent="left:0 top:0 right:0 bottom:0"/>
|
||||
<att.ListControl>
|
||||
<TextList HorizontalAlwaysVisible="false" VerticalAlwaysVisible="false">
|
||||
<att.Items>
|
||||
<TextItem Text="Text"/>
|
||||
<TextItem Text="Check"/>
|
||||
<TextItem Text="Radio"/>
|
||||
</att.Items>
|
||||
</TextList>
|
||||
</att.ListControl>
|
||||
</ComboBox>
|
||||
</Cell>
|
||||
|
||||
<Cell Site="row:1 column:0 columnSpan:3">
|
||||
<BindableTextList ref.Name="textList" View-bind="self.views[comboView.SelectedIndex]" HorizontalAlwaysVisible="false" VerticalAlwaysVisible="false" env.ItemType="sample::LoremIpsumItem^">
|
||||
<att.BoundsComposition-set AlignmentToParent="left:0 top:0 right:0 bottom:0"/>
|
||||
<att.ItemSource-eval>self.items</att.ItemSource-eval>
|
||||
<att.TextProperty>Text</att.TextProperty>
|
||||
<att.CheckedProperty>Checked</att.CheckedProperty>
|
||||
</BindableTextList>
|
||||
</Cell>
|
||||
</Table>
|
||||
</Window>
|
||||
</Instance>
|
||||
</Instance>
|
||||
</Folder>
|
||||
</Resource>
|
||||
Reference in New Issue
Block a user