Skip to content

Commit 1bdab82

Browse files
xristianstefanovradkostanev
authored andcommitted
docs(PanelBar): update content template example
1 parent f6412c8 commit 1bdab82

File tree

2 files changed

+25
-17
lines changed

2 files changed

+25
-17
lines changed

components/panelbar/templates/content.md

Lines changed: 25 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -33,15 +33,21 @@ Without a Level, the ContentTemplate will be applied to all items that have no c
3333
var item = context as PanelBarItem;
3434
3535
<div style="padding: 8px 16px;">
36-
<span style="text-decoration: underline; color: blue;">
37-
content template for: @item.Text
38-
</span>
39-
<br />
40-
@if (item.Text == "Item 2")
36+
@if (item.Text == "New Web Site")
4137
{
38+
<strong style="text-decoration: underline; color: green;">
39+
content template for: @item.Text
40+
</strong>
41+
<br />
4242
<TelerikButton ThemeColor="primary">Nested Component</TelerikButton>
4343
}
44-
44+
else
45+
{
46+
<span style="text-decoration: solid; color: blue;">
47+
content template for: @item.Text
48+
</span>
49+
<br />
50+
}
4551
</div>
4652
}
4753
</ContentTemplate>
@@ -51,12 +57,13 @@ Without a Level, the ContentTemplate will be applied to all items that have no c
5157
</div>
5258
5359
@code {
54-
public List<PanelBarItem> Items { get; set; }
60+
private List<PanelBarItem> Items { get; set; }
5561
5662
public class PanelBarItem
5763
{
5864
public string Text { get; set; }
5965
public List<PanelBarItem> Items { get; set; }
66+
public ISvgIcon Icon { get; set; }
6067
}
6168
6269
protected override void OnInitialized()
@@ -65,29 +72,34 @@ Without a Level, the ContentTemplate will be applied to all items that have no c
6572
{
6673
new PanelBarItem()
6774
{
68-
Text = "Item 1",
75+
Text = "My Documents",
76+
Icon = SvgIcon.FolderMore,
6977
Items = new List<PanelBarItem>()
7078
{
7179
new PanelBarItem()
7280
{
73-
Text = "Item 1.1"
81+
Text = "Reports",
82+
Icon = SvgIcon.Folder,
7483
},
75-
new PanelBarItem()
84+
new PanelBarItem
7685
{
77-
Text = "Item 1.2",
86+
Text = "Projects",
87+
Icon = SvgIcon.Folder,
7888
Items = new List<PanelBarItem>()
7989
{
8090
new PanelBarItem()
8191
{
82-
Text = "Item 1.2.1"
92+
Text = "November",
93+
Icon = SvgIcon.Folder
8394
}
8495
}
8596
}
8697
}
8798
},
8899
new PanelBarItem()
89100
{
90-
Text = "Item 2"
101+
Text = "New Web Site",
102+
Icon = SvgIcon.FolderMore
91103
}
92104
};
93105
@@ -96,10 +108,6 @@ Without a Level, the ContentTemplate will be applied to all items that have no c
96108
}
97109
````
98110

99-
>caption The result from the code snippet above
100-
101-
![ContentTemplate example](images/content-template-example.png)
102-
103111
## See Also
104112

105113
* [Data Binding a PanelBar]({%slug panelbar-data-binding-overview%})
Binary file not shown.

0 commit comments

Comments
 (0)