or
TreeLayoutSettings settings =
new
TreeLayoutSettings()
{
TreeLayoutType = TreeLayoutType.TreeDown,
};
settings.Roots.Add(rd.Shapes[0]);
rd.RoutingService.Router =
new
OrgTreeRouter()
{
TreeLayoutType = TreeLayoutType.TreeDown,
ConnectionOuterSpacing = 20,
};
rd.LayoutAsync(LayoutType.Tree, settings);
rd.AutoFitAsync(
new
Thickness(0, 0, 0, 0),
false
);
01.
<!-- Menu Item Data Template -->
02.
<
DataTemplate
DataType
=
"{x:Type entities:MenuItemModel}"
>
03.
<
StackPanel
Orientation
=
"Horizontal"
HorizontalAlignment
=
"Stretch"
>
04.
<
StackPanel.ToolTip
>
05.
<
TextBlock
Text
=
"{Binding MenuItemDescription}"
06.
HorizontalAlignment
=
"Stretch"
/>
07.
</
StackPanel.ToolTip
>
08.
<
TextBlock
Text
=
"{Binding MenuItemText}"
HorizontalAlignment
=
"Stretch"
/>
09.
</
StackPanel
>
10.
</
DataTemplate
>
11.
12.
<!-- Menu Section Data Template -->
13.
<
HierarchicalDataTemplate
DataType
=
"{x:Type entities:MenuSectionModel}"
14.
ItemsSource
=
"{Binding MenuItems}"
>
15.
<
StackPanel
Orientation
=
"Horizontal"
HorizontalAlignment
=
"Stretch"
>
16.
<
StackPanel.ToolTip
>
17.
<
TextBlock
Text
=
"{Binding MenuSectionDescription}"
18.
HorizontalAlignment
=
"Stretch"
/>
19.
</
StackPanel.ToolTip
>
20.
<
Image
Source
=
"{Binding IconData, Converter={StaticResource StrToImgConverter}}"
21.
Height
=
"32"
Width
=
"32"
/>
22.
<
TextBlock
Text
=
"{Binding MenuSectionText}"
23.
VerticalAlignment
=
"Center"
HorizontalAlignment
=
"Stretch"
24.
Margin
=
"6,0,0,0"
/>
25.
</
StackPanel
>
26.
</
HierarchicalDataTemplate
>
27.
...
28.
<
telerik:RadPane
Header
=
"{Binding ApplicationData.ApplicationName, Mode=OneWay}"
29.
CanUserClose
=
"False"
CanFloat
=
"False"
CanDockInDocumentHost
=
"False"
>
30.
<
telerik:RadPanelBar
Height
=
"Auto"
HorizontalAlignment
=
"Stretch"
31.
ExpandMode
=
"Multiple"
32.
ItemsSource
=
"{Binding ApplicationData.ApplicationMenu.MenuSections}"
33.
SelectionMode
=
"Single"
34.
SelectedItem
=
"{Binding SelectedMenuItem, Mode=OneWayToSource}"
>
35.
</
telerik:RadPanelBar
>
36.
</
telerik:RadPane
>