Hello,
create a new SIlverlight 5 application, add references to Telerik.Windows.Controls, Telerik.Windows.Controls.Docking and Telerik.Windows.Controls.Navigation.
Then replace MainPahe.xaml with:
and replace MainPage.xaml.cs with:
Now run the application.
The DataContext that is set at the beginning is working, but the change of the DataContext is not propagated to the children controls.
If I set the DataContext of the main page or of the StackPanel, it works correctly!
Patrick
create a new SIlverlight 5 application, add references to Telerik.Windows.Controls, Telerik.Windows.Controls.Docking and Telerik.Windows.Controls.Navigation.
Then replace MainPahe.xaml with:
<
UserControl
x:Class
=
"SilverlightApplication1.MainPage"
mc:Ignorable
=
"d"
d:DesignHeight
=
"300"
d:DesignWidth
=
"400"
>
<
tk:RadDocking
>
<
tk:RadSplitContainer
>
<
tk:RadPaneGroup
>
<
tk:RadPane
Name
=
"Pane"
Header
=
"Pane"
>
<
StackPanel
Margin
=
"5"
>
<
TextBlock
HorizontalAlignment
=
"Left"
Margin
=
"2"
Text
=
"{Binding}"
/>
<
tk:RadButton
Content
=
"Context to 123"
HorizontalAlignment
=
"Left"
Margin
=
"2"
Click
=
"RadButton_Click"
/>
<
tk:RadButton
Content
=
"Context to ABC"
HorizontalAlignment
=
"Left"
Margin
=
"2"
Click
=
"RadButton_Click_1"
/>
</
StackPanel
>
</
tk:RadPane
>
</
tk:RadPaneGroup
>
</
tk:RadSplitContainer
>
</
tk:RadDocking
>
</
UserControl
>
and replace MainPage.xaml.cs with:
using
System;
using
System.Collections.Generic;
using
System.Linq;
using
System.Net;
using
System.Windows;
using
System.Windows.Controls;
using
System.Windows.Documents;
using
System.Windows.Input;
using
System.Windows.Media;
using
System.Windows.Media.Animation;
using
System.Windows.Shapes;
namespace
SilverlightApplication1
{
public
partial
class
MainPage : UserControl
{
public
MainPage()
{
InitializeComponent();
Pane.DataContext =
"None"
;
}
private
void
RadButton_Click(
object
sender, RoutedEventArgs e)
{
Pane.DataContext =
"123"
;
}
private
void
RadButton_Click_1(
object
sender, RoutedEventArgs e)
{
Pane.DataContext =
"ABC"
;
}
}
}
Now run the application.
The DataContext that is set at the beginning is working, but the change of the DataContext is not propagated to the children controls.
If I set the DataContext of the main page or of the StackPanel, it works correctly!
Patrick