Hi,
I have a problem with dependencyproperty in a RadWindow. It doesn't work if I bind my window on another element, this is my code : :
My RadWindow XAML :
My RadWindow code behind:
My MainPage XAML:
I want to see "My text" in my RadWindow and I see nothing. Can anybody help?
Thanks.
I have a problem with dependencyproperty in a RadWindow. It doesn't work if I bind my window on another element, this is my code : :
My RadWindow XAML :
<
telerik:RadWindow
x:Class
=
"Env.Nc.App.Views.MyRadWindow"
xmlns:telerik
=
"http://schemas.telerik.com/2008/xaml/presentation"
Header
=
"MyRadWindow"
Height
=
"300"
Width
=
"300"
DataContext
=
"{Binding RelativeSource={RelativeSource Self}}"
>
<
Grid
>
<
TextBlock
Text
=
"{Binding testDp}"
/>
</
Grid
>
</
telerik:RadWindow
>
My RadWindow code behind:
using System;
using System.Windows;
namespace Env.Nc.App.Views
{
/// <
summary
>
/// Interaction logic for MyRadWindow.xaml
/// </
summary
>
public partial class MyRadWindow
{
public String testDp
{
get { return (String)GetValue(testDpProperty); }
set { SetValue(testDpProperty, value); }
}
// Using a DependencyProperty as the backing store for testDp. This enables animation, styling, binding, etc...
public static readonly DependencyProperty testDpProperty =
DependencyProperty.Register("testDp", typeof(String), typeof(MyRadWindow), new PropertyMetadata(null));
public MyRadWindow()
{
InitializeComponent();
}
}
}
My MainPage XAML:
<
TextBlock
x:Name
=
"ttt"
Text
=
"My text"
></
TextBlock
>
<
views:MyRadWindow
x:Name
=
"MyWindow"
testDp
=
"{Binding ElementName=ttt, Path=Text}"
></
views:MyRadWindow
>
I want to see "My text" in my RadWindow and I see nothing. Can anybody help?
Thanks.