or
using
System;
using
System.Collections.Generic;
using
System.IO;
using
System.Linq;
using
System.Text;
using
System.Threading.Tasks;
using
System.Windows;
using
System.Windows.Controls;
using
System.Windows.Data;
using
System.Windows.Documents;
using
System.Windows.Input;
using
System.Windows.Media;
using
System.Windows.Media.Imaging;
using
System.Windows.Navigation;
using
System.Windows.Shapes;
using
Telerik.Windows.Controls;
namespace
NoDocumentHost
{
/// <summary>
/// Interaction logic for DockingUC.xaml
/// </summary>
public
partial
class
DockingUC : UserControl
{
public
DockingUC()
{
InitializeComponent();
}
public
void
CreatePane()
{
RadSplitContainer l_splitContainer =
new
RadSplitContainer();
RadPaneGroup l_paneGroup =
new
RadPaneGroup();
l_splitContainer.Items.Add(l_paneGroup);
m_docking.Items.Add(l_splitContainer);
RadPane l_pane =
new
RadPane()
{
CanUserPin =
true
,
Title =
"Title"
,
Header =
"Header"
,
CanUserClose =
true
,
ContextMenuTemplate =
null
};
UserControl1 l_userControl =
new
UserControl1();
l_pane.Content = l_userControl;
l_paneGroup.Items.Add(l_pane);
l_pane.MakeFloatingDockable();
}
private
void
DockingPaneStateChange(
object
p_sender, Telerik.Windows.RadRoutedEventArgs p_args)
{
Dispatcher.BeginInvoke(
new
Action(() =>
{
RadPane l_pane = (RadPane)p_args.OriginalSource;
RadPaneGroup l_paneGroup = l_pane.PaneGroup;
l_paneGroup.TabStripPlacement = Dock.Top;
}));
}
}
}
<
Window
x:Class
=
"test.MainWindow"
xmlns:telerik
=
"http://schemas.telerik.com/2008/xaml/presentation"
Title
=
"MainWindow"
Height
=
"350"
Width
=
"525"
>
<
Grid
>
<
Grid.ColumnDefinitions
>
<
ColumnDefinition
></
ColumnDefinition
>
<
ColumnDefinition
></
ColumnDefinition
>
<
ColumnDefinition
></
ColumnDefinition
>
</
Grid.ColumnDefinitions
>
<
TextBlock
Name
=
"src"
Text
=
"src"
Grid.Column
=
"0"
PreviewMouseDown
=
"src_PreviewMouseDown"
></
TextBlock
>
<
telerik:RadDocking
Grid.Column
=
"1"
>
<
telerik:RadSplitContainer
HorizontalAlignment
=
"Stretch"
>
<
telerik:RadPaneGroup
>
<
telerik:RadPane
>
<
Grid
>
<
TextBlock
AllowDrop
=
"True"
Background
=
"LightYellow"
Text
=
"dst1"
Drop
=
"TextBlock_Drop"
/>
</
Grid
>
</
telerik:RadPane
>
</
telerik:RadPaneGroup
>
</
telerik:RadSplitContainer
>
</
telerik:RadDocking
>
<
TextBlock
AllowDrop
=
"True"
Background
=
"LightBlue"
Text
=
"dst2"
Drop
=
"TextBlock_Drop"
Grid.Column
=
"2"
/>
</
Grid
>
</
Window
>
//using blahblah...
namespace
test
{
public
partial
class
MainWindow : Window
{
public
MainWindow() {
InitializeComponent();
}
private
void
TextBlock_Drop(
object
sender, DragEventArgs e) {
(sender
as
TextBlock).Text =
"On drop"
;
}
private
void
src_PreviewMouseDown(
object
sender, MouseButtonEventArgs e){
string
k = (sender
as
TextBlock).Text;
DragDropEffects allowedEffects = DragDropEffects.Move | DragDropEffects.Copy | DragDropEffects.Link;
DragDrop.DoDragDrop(sender
as
TextBlock, k, allowedEffects);
}
}
}
<
telerik:RadChart
x:Name
=
"RadChart1"
>
<
telerik:RadChart.SeriesMappings
>
<
telerik:SeriesMapping
>
<
telerik:SeriesMapping.SeriesDefinition
>
<
telerik:StackedBarSeriesDefinition
/>
</
telerik:SeriesMapping.SeriesDefinition
>
<
telerik:SeriesMapping.GroupingSettings
>
<
telerik:GroupingSettings
ShouldCreateSeriesForLastGroup
=
"True"
>
<
telerik:GroupingSettings.GroupDescriptors
>
<
telerik:ChartGroupDescriptor
Member
=
"Team"
/>
</
telerik:GroupingSettings.GroupDescriptors
>
</
telerik:GroupingSettings
>
</
telerik:SeriesMapping.GroupingSettings
>
<
telerik:SeriesMapping.ItemMappings
>
<
telerik:ItemMapping
FieldName
=
"Value"
DataPointMember
=
"YValue"
/>
<
telerik:ItemMapping
FieldName
=
"Year"
DataPointMember
=
"XCategory"
/>
</
telerik:SeriesMapping.ItemMappings
>
</
telerik:SeriesMapping
>
</
telerik:RadChart.SeriesMappings
>
</
telerik:RadChart
>
public
partial
class
Example2 : UserControl
{
public
Example2()
{
InitializeComponent();
List<Record> data =
new
List<Record>()
{
new
Record(2009,
"First team"
, 25),
new
Record(2010,
"First team"
, 35),
new
Record(2011,
"First team"
, 45),
new
Record(2009,
"Second team"
, 15),
new
Record(2010,
"Second team"
, 25),
new
Record(2011,
"Second team"
, 75),
new
Record(2009,
"Third team"
, 67),
new
Record(2010,
"Third team"
, 20),
new
Record(2011,
"Third team"
, 88),
new
Record(2009,
"Fourth team"
, 34),
new
Record(2010,
"Fourth team"
, 67),
new
Record(2011,
"Fourth team"
, 91),
new
Record(2009,
"Fifth team"
, 87),
new
Record(2010,
"Fifth team"
, 77),
new
Record(2011,
"Fifth team"
, 12)
};
this
.RadChart1.ItemsSource = data;
}
}
public
class
Record
{
public
Record(
int
year,
string
team,
int
value)
{
Year = year;
Team = team;
Value = value;
}
public
int
Value {
get
;
set
; }
public
string
Team {
get
;
set
; }
public
int
Year {
get
;
set
; }
}