After studying and using WPF for a while, I felt a little bit about WPF as a less mature framework, not knowing that I was too shallow to learn, or that there were too many bugs in WPF!
>>>>>>> Simulation Scenarios <<<<<<<<<
Customer : Can I use WPF to write a small program for me?
programmer : Oh, what kind of small program?
customer : Once I enter something, you give me a pop-up warning box.
Programmer: so simple?! Is there anything else you want?
Customer : support Various input methods, can not crash!
programmer : Oh, will you accept 500?
customer : Well, not expensive ~ programmer : (Hey, people silly money more)
>>>>>>> programmers start working hard to write code <<<<<<<<<
Programmer Heart said, such a simple program, no XAML, a CS file will be done, look at me!
- Using System;
- Using System.Windows;
- Using System.Windows.Controls;
- Namespace BAIDUCRASHESWPF
- {
- // <summary>
- // Interaction logic for App.xaml
- // </summary>
- public class Program
- {
- [STAThread]
- static void Main (string[] args)
- {
- TextBox txtbox = new TextBox ();
- Txtbox.width = 400;
- Txtbox.textchanged + = txtbox_textchanged;
- Window Mainwin = new Window ();
- Mainwin.windowstartuplocation = Windowstartuplocation.centerscreen;
- Mainwin.content = Txtbox;
- Mainwin.sizetocontent = Sizetocontent.widthandheight;
- Application app = new application ();
- App. Shutdownmode = Shutdownmode.onmainwindowclose;
- App. Run (Mainwin);
- }
- static void txtbox_textchanged (object sender, Textchangedeventargs e)
- {
- MessageBox.Show ("Chinese input Method?") If you use it, the program is going to crash! ");
- }
- }
- }
OK, run down and try ... Enter Chinese! Hit "China" two words (must be 2 words OH)! Wow, the dialog box is bouncing out! Wow, the program crashed!!! tnnd! After testing, Baidu Input method, Google V2 Input method, QQ, Sogou Input method will cause the program crash. Microsoft Pinyin Input method will not, Google V3 will not.
For specific reasons, see later blog post ~ ~ ~
One of the conflicts between WPF and IME: Baidu Input method will cause the WPF program to crash!