![]() The XAML is pretty simple for it:Ĭopy Code public partial class EffectOptoonDialog : UserControl The main Reflection code is placed in a separate user control, which is named EffectOptionDialog. Also, they contain a description that will be shown on the user interface. They are used to specify the effect's parameter minimum, maximum, and default value. Both DoubleCovnverter and Point2DValueConverter implement this interface. The IValueController interface specifies a general interface for parameter controlling. ![]() This is necessary because in WPF 4.0, Pixel Shader level 2.0 and 3.0 are both supported, so you need to check if the rendering hardware supports that level or not. ![]() The ShaderVersion attribute specifies the shader's version. ![]() The UML diagram of the attributes looks like this: The Reflection code looks for these attributes, and depending on the contained information of the attributes, it builds the user interface. The Reflection control is achieved using a few custom attributes. This is my first article that I publish here on CodeProject. This article shows the technique behind it. To save a lot of time manually hard coding each effect's control interface, I built a simple Reflection based controller system for the effects. Currently, I'm working on an image editor, which will use Pixel Shader effects.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |