This question is locked. New answers and comments are not allowed.
Hi there,
I use the RadRichTextBox and I need the DocumentChanged event in my ViewModel.
Fisrt I try use command but the RadRichTextBox control doesn´t support that, only use RadRichTextBox"Commands"!
After that, I try use Triggers and InvokeDataCommand, like this:
And the method that I want put my logic for when event fired:
Nothing...I can´t catch the event on ViewModel.
Any help please?
Thanks
I use the RadRichTextBox and I need the DocumentChanged event in my ViewModel.
Fisrt I try use command but the RadRichTextBox control doesn´t support that, only use RadRichTextBox"Commands"!
After that, I try use Triggers and InvokeDataCommand, like this:
<Grid Name="grdWord" Width="Auto" Grid.Row="1"> <!--<TextBlock Text="{Binding Path=ConteudoTemplate,ElementName=PrevisualizarTemplate}"/>--> <!--<UC:SGAControloWord HorizontalAlignment="Center" VerticalAlignment="Bottom" Height="Auto" Margin="0,40,0,10"/>--> <Grid Height="450"> <Grid.RowDefinitions> <RowDefinition Height="Auto"/> <RowDefinition Height="*" /> <RowDefinition Height="Auto" /> </Grid.RowDefinitions> <telerikHtml:HtmlDataProvider x:Name="HtmlProvider" RichTextBox="{Binding ElementName=radRichTextBox1}" Html="{Binding Path=ConteudoTemplate,ElementName=PrevisualizarTemplate, Mode=TwoWay}"/> <telerik:RadRichTextBox Grid.Row="1" HorizontalAlignment="Left" Margin="40 0 0 0" IsContextMenuEnabled="True" IsSelectionMiniToolBarEnabled="True" IsSpellCheckingEnabled="True" LayoutMode="Flow" Width="550" Name="radRichTextBox1" VerticalAlignment="Stretch" telerik:StyleManager.Theme="Summer">
<swi:Interaction.Triggers>
<swi:EventTrigger EventName="DocumentChanged">
<esi:InvokeDataCommand Command="{Binding Path=ComandoSeleccao, Source={StaticResource VisualizaNotificacoesVM}}"/>
</swi:EventTrigger>
</swi:Interaction.Triggers>
</telerik:RadRichTextBox>
in my ViewModel I have This in constructor:
_comandoSeleccao = new RelayCommandOriginal(TESTECOMANDO);
And the method that I want put my logic for when event fired:
private void TESTECOMANDO(object sender){MessageBox.Show("Hello");}Nothing...I can´t catch the event on ViewModel.
Any help please?
Thanks
