This commit is contained in:
Zihan Chen
2020-11-25 11:25:13 -08:00
parent 1a3a0d8e32
commit 73929ce2be
3 changed files with 20 additions and 17 deletions
Binary file not shown.
Binary file not shown.
@@ -51,7 +51,8 @@
]]> ]]>
</ref.Members> </ref.Members>
<ControlTemplate ref.Name="self" MinSizeLimitation="LimitToElementAndChildren"> <ControlTemplate ref.Name="self" MinSizeLimitation="LimitToElementAndChildren">
<RadioButton AutoFocus="false" AutoSelection="false"> <CheckBox AutoFocus="false" AutoSelection="false">
<att.ControlTemplate>sample::TabHeaderButtonTemplate</att.ControlTemplate>
<att.BoundsComposition-set AlignmentToParent="left:0 top:0 right:0 bottom:0"/> <att.BoundsComposition-set AlignmentToParent="left:0 top:0 right:0 bottom:0"/>
<att.Context-ref>CurrentTabPage</att.Context-ref> <att.Context-ref>CurrentTabPage</att.Context-ref>
<att.Text-bind>CurrentTabPage.Text</att.Text-bind> <att.Text-bind>CurrentTabPage.Text</att.Text-bind>
@@ -64,7 +65,7 @@
} }
]]> ]]>
</ev.Clicked-eval> </ev.Clicked-eval>
</RadioButton> </CheckBox>
</ControlTemplate> </ControlTemplate>
</Instance> </Instance>
</Instance> </Instance>
@@ -72,9 +73,8 @@
<Instance name="TabTemplate"> <Instance name="TabTemplate">
<Instance ref.Class="sample::TabTemplate"> <Instance ref.Class="sample::TabTemplate">
<TabTemplate ref.Name="self" ContainerComposition-ref="container" TabOrder="TopToBottom" MinSizeLimitation="LimitToElementAndChildren"> <TabTemplate ref.Name="self" ContainerComposition-ref="container" TabOrder="TopToBottom" MinSizeLimitation="LimitToElementAndChildren">
<Table AlignmentToParent="left:0 top:0 right:0 bottom:0" CellPadding="5" BorderVisible="false" MinSizeLimitation="LimitToElementAndChildren"> <Table AlignmentToParent="left:0 top:0 right:0 bottom:0" MinSizeLimitation="LimitToElementAndChildren">
<att.Rows> <att.Rows>
<CellOption>composeType:MinSize</CellOption>
<CellOption>composeType:Percentage percentage:1.0</CellOption> <CellOption>composeType:Percentage percentage:1.0</CellOption>
</att.Rows> </att.Rows>
<att.Columns> <att.Columns>
@@ -82,7 +82,7 @@
<CellOption>composeType:Percentage percentage:1.0</CellOption> <CellOption>composeType:Percentage percentage:1.0</CellOption>
</att.Columns> </att.Columns>
<Cell Site="row:0 column:0 rowSpan:2"> <Cell Site="row:0 column:0">
<RepeatStack ref.Name="header" AlignmentToParent="left:0 top:0 right:0 bottom:0" Padding="2" Direction="Vertical" MinSizeLimitation="LimitToElementAndChildren"> <RepeatStack ref.Name="header" AlignmentToParent="left:0 top:0 right:0 bottom:0" Padding="2" Direction="Vertical" MinSizeLimitation="LimitToElementAndChildren">
<att.ItemTemplate>sample::TabHeaderTemplate</att.ItemTemplate> <att.ItemTemplate>sample::TabHeaderTemplate</att.ItemTemplate>
<att.ItemSource-bind>self.TabPages</att.ItemSource-bind> <att.ItemSource-bind>self.TabPages</att.ItemSource-bind>
@@ -99,13 +99,7 @@
</Cell> </Cell>
<Cell Site="row:0 column:1"> <Cell Site="row:0 column:1">
<Label Font-bind="self.Font"> <SolidBackground Color="#3D3D3D"/>
<att.Text-format>&lt;$(self.SelectedTabPage.Text ?? '')/&gt;</att.Text-format>
</Label>
</Cell>
<Cell Site="row:1 column:1">
<FocusRectangle/>
<Bounds ref.Name="container" AlignmentToParent="left:1 top:1 right:1 bottom:1"/> <Bounds ref.Name="container" AlignmentToParent="left:1 top:1 right:1 bottom:1"/>
</Cell> </Cell>
</Table> </Table>
@@ -127,11 +121,20 @@
<Instance ref.Class="sample::MainWindow" ref.Styles="res://MainWindow/SharedStyle"> <Instance ref.Class="sample::MainWindow" ref.Styles="res://MainWindow/SharedStyle">
<Window Text="kb_ctemplates" IconVisible="true" ClientSize="x:640 y:480"> <Window Text="kb_ctemplates" IconVisible="true" ClientSize="x:640 y:480">
<att.BoundsComposition-set PreferredMinSize="x:480 y:320"/> <att.BoundsComposition-set PreferredMinSize="x:480 y:320"/>
<Stack Direction="Vertical" MinSizeLimitation="LimitToElementAndChildren" AlignmentToParent="left:5 top:5 right:-1 bottom:-1" Padding="5"> <Tab>
<StackItem><CheckBox Text="Button 1"/></StackItem> <att.ControlTemplate>sample::TabTemplate</att.ControlTemplate>
<StackItem><CheckBox Text="Button 2"/></StackItem> <att.BoundsComposition-set AlignmentToParent="left:0 top:0 right:0 bottom:0"/>
<StackItem><CheckBox Text="Button 3"/></StackItem> <att.Pages>
</Stack> <TabPage Text="First TabPage">
</TabPage>
<TabPage Text="Second TabPage">
</TabPage>
<TabPage Text="Third TabPage">
</TabPage>
</att.Pages>
</Tab>
</Window> </Window>
</Instance> </Instance>
</Instance> </Instance>