Hi everybody,
I have a problem with the Rich Text Box + HtmlDataProvider.
I make a simple an isolated example.
<telerikDocumentsHtml:HtmlDataProvider
x:Name="provider"
RichTextBox="{Binding ElementName=rtb}"
Html="{Binding Text, Mode=TwoWay}" Grid.RowSpan="2" />
<telerik:RadRichTextBox Name="rtb" Margin="20"/>
This is my "main page" and the datacontext is setted to a simple class:
public class ViewModel
{
private string text;
public string Text
{
get { return text; }
set
{
text = value;
}
}
}
the main page ctor works like this:
public partial class MainPage : UserControl
{
public MainPage()
{
InitializeComponent();
var vm = new ViewModel();
vm.Text = "XXXXXXXXXXX";
DataContext = vm;
}
}
Seems that the SET accessor of the Text property is called TWICE, one during the first set on the ctor of the main page, the second from the binding in the Provider.
If i use a normal textbox the binding set is not called on the beginning.
How can i avoid this?
Thanks to everybody.
Ray
I have a problem with the Rich Text Box + HtmlDataProvider.
I make a simple an isolated example.
<telerikDocumentsHtml:HtmlDataProvider
x:Name="provider"
RichTextBox="{Binding ElementName=rtb}"
Html="{Binding Text, Mode=TwoWay}" Grid.RowSpan="2" />
<telerik:RadRichTextBox Name="rtb" Margin="20"/>
This is my "main page" and the datacontext is setted to a simple class:
public class ViewModel
{
private string text;
public string Text
{
get { return text; }
set
{
text = value;
}
}
}
the main page ctor works like this:
public partial class MainPage : UserControl
{
public MainPage()
{
InitializeComponent();
var vm = new ViewModel();
vm.Text = "XXXXXXXXXXX";
DataContext = vm;
}
}
Seems that the SET accessor of the Text property is called TWICE, one during the first set on the ctor of the main page, the second from the binding in the Provider.
If i use a normal textbox the binding set is not called on the beginning.
How can i avoid this?
Thanks to everybody.
Ray