The core element of note is RichTextBox control. In previous versions of PNotes and PNotes.NET based on WinForms technology, it was native Win32 RichTextBox (or, in case of WinForms, the .NET wrapper of Win32 RichTextBox).
After migrating from WinForms to WPF it would be logical to expect the use of WPF RichTextBox, but it was completely unusable. May be it supports a lot of new cool, WPF related, features, but is very weak when it comes to functionality the program is needed.
Luckily, WPF allows using WinForms controls through WindowsFormsHost element. You can just put one on your window and insert desired WinnForms control into it. Seems easy and cool, isn't it?
Not exactly. All windows in PNotes (especially notes’ windows) have to be borderless. In order to reach this effect you have set two properties WindowStyle="None" and AllowsTransparency="True". When you change the AllowsTransparency property to true, any WinnForms control on your window becomes invisible. And this is known bug, or “feature”, or any other glitch of WPF. They know about it, but do nothing to fix and I think it is from “won’t be fixed” category.
After months of research and questions, I found the one only solution: Win32 RichTextBox is at separated borderless Window Form, which is located over WPF window and moves and resizes when WPF window moves and resizes. It is ugly solution, but it is the only one. Since this Window Form is independent window it takes time to interact with WPF window and there may be (and are) gaps, glitches and other nasty things.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
The core element of note is RichTextBox control. In previous versions of PNotes and PNotes.NET based on WinForms technology, it was native Win32 RichTextBox (or, in case of WinForms, the .NET wrapper of Win32 RichTextBox).
After migrating from WinForms to WPF it would be logical to expect the use of WPF RichTextBox, but it was completely unusable. May be it supports a lot of new cool, WPF related, features, but is very weak when it comes to functionality the program is needed.
Luckily, WPF allows using WinForms controls through WindowsFormsHost element. You can just put one on your window and insert desired WinnForms control into it. Seems easy and cool, isn't it?
Not exactly. All windows in PNotes (especially notes’ windows) have to be borderless. In order to reach this effect you have set two properties WindowStyle="None" and AllowsTransparency="True". When you change the AllowsTransparency property to true, any WinnForms control on your window becomes invisible. And this is known bug, or “feature”, or any other glitch of WPF. They know about it, but do nothing to fix and I think it is from “won’t be fixed” category.
After months of research and questions, I found the one only solution: Win32 RichTextBox is at separated borderless Window Form, which is located over WPF window and moves and resizes when WPF window moves and resizes. It is ugly solution, but it is the only one. Since this Window Form is independent window it takes time to interact with WPF window and there may be (and are) gaps, glitches and other nasty things.