In the previous article [ WPF practical tutorial 4 ], I increase the input box on the search button and search for events, but in actual use, we might just put the search button upload button style becomes a style like we certainly can not re-write a custom control.
1. The new control features
In response to these needs, I put on a re-edit of ClearTextBox modified into a common LabelInput controls, the effect is as follows:
Expand button after the revision of the current functions are as follows:
-
● support the original style TextBox
-
● support the Clear button to customize and enable deactivation button size and color
-
● support the expansion button to customize and enable deactivation button size and color
-
● support the expansion buttons custom events
-
● Support title display and modify the title of the property
-
● Support control the mouse over the highlighted edge
Not added features:
-
● support content data validation
-
● Support Command bindings
-
● Other functions not yet thought of, not to add more functions related to some of the more important points, and then added after I finished MVVM.
2. demonstration project
Newly added controls basically just the name has changed and the control slightly modified style, no new knowledge points function, drawing as follows:
More than two files. Point to note here:
After each increase Themes.xaml a new control, remember to increase this referenced style files in Themes \ Generic.xaml in the following chart:
At the same time, in order to expand, I added a lot of Iconfont.ttf icons commonly used fonts, font use on Iconfont, you can go to the article " WPF practical tutorial 1 " view. The same should note that if you modify the contents of the file Iconfont.ttf changed, we first iconfont.ttf delete the original project :
After deleted, re-import the new iconfont.ttf files to the Fonts folder, remember to remember .
About this time I iconfont.ttf download files into the directory of the program Doc folder:
Can extract the catalog, view the code unicode icons, here I would like to attach a unicode code section as shown below:
/////////////////////////////////////////////////////////////////////////////////////////
** original article, reproduced, please attach the declaration part
** Source: https://blog.csdn.net/mybelief321
** Author: Nine Zero Zhuang
/////////////////////////////////////////////////////////////////////////////////////////