Quantcast
Channel: Windows Presentation Foundation (WPF) forum
Viewing all articles
Browse latest Browse all 18858

How to make event in Xaml works, after load back the Xaml?

$
0
0
<RichTextBox IsDocumentEnabled="True"  x:Name="first" HorizontalAlignment="Left" Height="174" Margin="21,119,0,0" VerticalAlignment="Top" Width="254"><FlowDocument><Paragraph><Run Text="RichTextBox"/></Paragraph><BlockUIContainer><RichTextBox MouseDoubleClick="second_MouseDoubleClick" IsReadOnly="True" x:Name="second"   Width="239"><FlowDocument><Paragraph><Run Text="RichTextBox1"/><Run Language="en" Text="hh"/></Paragraph></FlowDocument></RichTextBox></BlockUIContainer>              </FlowDocument></RichTextBox>

I use XamlWriter and XamlReader to save and load a Xaml (see above) to disk, but the problem is, after i load it back, the event MouseDoubleClick="second_MouseDoubleClick" can not work, no action after i double clicked it. I guess the problem probably is I only load back the Xaml file, not the code behind the MouseDoubleClick event.

I want the douleclick event still works after I load back the Xaml, how should i do?


Viewing all articles
Browse latest Browse all 18858

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>