Windows Presentation Foundation
A part of the .NET Framework that provides a unified programming model for building line-of-business desktop applications on Windows.
2,676 questions
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Tried to google for answer but didn't find something that work or a clean solution.
I'm using visual studio 2022 community. Windows 10 pro.
The project is wpf type.
Sometimes it happens in the code on this line :
string StringFromRichTextBox(System.Windows.Controls.RichTextBox rtb)
{
TextRange textRange = new TextRange(
rtb.Document.ContentStart,
rtb.Document.ContentEnd
);
return textRange.Text;
}
On the line :
return textRange.Text;
I think that there are certain reasons to try this fix of '+=' operations:
fsw.Changed += ( s, a ) => Dispatcher.Invoke( ( ) => Fsw_Changed( s, a ) );
fsw.Created += ( s, a ) => Dispatcher.Invoke( ( ) => Fsw_Created( s, a ) );
fsw.Deleted += ( s, a ) => Dispatcher.Invoke( ( ) => Fsw_Deleted( s, a ) );
fsw.Renamed += ( s, a ) => Dispatcher.Invoke( ( ) => Fsw_Renamed( s, a ) );
Or, instead of these changes, try a shorter fix:
fsw.SynchronizingObject = this;