or
<
UserControl
x:Class
=
"LasX.ApplicationFramework.Cad.EntityTreeView"
xmlns:telerik
=
"http://schemas.telerik.com/2008/xaml/presentation"
mc:Ignorable
=
"d"
d:DesignHeight
=
"300"
d:DesignWidth
=
"300"
>
<
UserControl.Resources
>
<
ResourceDictionary
>
<
ResourceDictionary.MergedDictionaries
>
<
ResourceDictionary
Source
=
"TreeViewTemplates.xaml"
/>
</
ResourceDictionary.MergedDictionaries
>
</
ResourceDictionary
>
</
UserControl.Resources
>
<
Grid
>
<
telerik:RadTreeView
Name
=
"treeView1"
HorizontalAlignment
=
"Stretch"
VerticalAlignment
=
"Stretch"
telerik:TreeViewPanel.IsVirtualizing
=
"True"
telerik:TreeViewPanel.VirtualizationMode
=
"Recycling"
ItemTemplate
=
"{StaticResource EntityDataTemplate}"
ItemsSource
=
"{Binding CadEntityManager, UpdateSourceTrigger=PropertyChanged}"
ItemContainerStyle
=
"{StaticResource RadTreeViewItemStyle1}"
Background
=
"#FF212830"
SelectionChanged
=
"treeView1_SelectionChanged"
SelectionMode
=
"Extended"
>
</
telerik:RadTreeView
>
</
Grid
>
</
UserControl
>
public
bool
? IsSDS {
get
;
set
; }
<
telerik:Label
Content
=
"Self Directed Support"
/>
<
StackPanel
Orientation
=
"Horizontal"
>
<
telerik:RadRadioButton
x:Name
=
"SelfDirectedSupportYes"
Content
=
"Yes"
/>
<
telerik:RadRadioButton
x:Name
=
"SelfDirectedSupportNo"
Content
=
"No"
/>
</
StackPanel
>
private
void
RadDocking_PreviewShowCompass(
object
sender, Telerik.Windows.Controls.Docking.PreviewShowCompassEventArgs e)
{
if
(e.TargetGroup !=
null
)
{
e.Compass.IsCenterIndicatorVisible = CanDockIn(e.DraggedSplitContainer, e.TargetGroup, DockPosition.Center);
e.Compass.IsLeftIndicatorVisible = CanDockIn(e.DraggedSplitContainer, e.TargetGroup, DockPosition.Left);
e.Compass.IsTopIndicatorVisible = CanDockIn(e.DraggedSplitContainer, e.TargetGroup, DockPosition.Top);
e.Compass.IsRightIndicatorVisible = CanDockIn(e.DraggedSplitContainer, e.TargetGroup, DockPosition.Right);
e.Compass.IsBottomIndicatorVisible = CanDockIn(e.DraggedSplitContainer, e.TargetGroup, DockPosition.Bottom);
}
else
{
e.Compass.IsLeftIndicatorVisible = CanDock(e.DraggedSplitContainer, DockPosition.Left);
e.Compass.IsTopIndicatorVisible = CanDock(e.DraggedSplitContainer, DockPosition.Top);
e.Compass.IsRightIndicatorVisible = CanDock(e.DraggedSplitContainer, DockPosition.Right);
e.Compass.IsBottomIndicatorVisible = CanDock(e.DraggedSplitContainer, DockPosition.Bottom);
}
e.Canceled = !(CompassNeedsToShow(e.Compass));
}
private
bool
CanDockIn(ISplitItem dragged, ISplitItem target, DockPosition position)
{
// If there is a pane that cannot be dropped in any of the targeted panes.
return
!dragged.EnumeratePanes().Any((RadPane p) => target.EnumeratePanes().Any((RadPane p1) => !CanDockIn(p, p1, position)));
}