Using the visual studio wpf editor to create an gui not for windows gui

℡╲_俬逩灬. 提交于 2019-12-12 18:12:34

问题


It's quite hard to explain in question title, however what I want to achieve is this:

I would like to use XAML (and possibly the visual editor) to create GUIs that won't be rendered on "MS Windows GUI" but on Bitmaps (the bitmap class from System.Drawing, not files).

This because I would like to create an easy way to "print" over the G19 small screen that it has.

I already built a library that allows me to easily fill the screen with Bitmap images. Now I would like to take the step further, allowing people with visual studio to make applet faster and easier by creating them with wpf editor.

Obviusly I need to build all components (TextBlocks, Progressbars and Images), but that's not a problem.

I need some guidelines to follow and some suggestion because I don't know very well where to start from when creating something that will totally replace the tag in a xaml file (like UserControl does).

I obviusly don't need mouse/keyboard interaction with the gui because to handle the screen I'll use some keys that are built for that purpose.

Any suggestion on where should I start from to built this thing? Do I need to inherit from MarkupExtension class?I need some links to tutorials for something similar if possible (obviusly I will adapt those tutorials to my needs)

Is even possible to do such a thing?

Thanks for any suggestion


回答1:


I'm more familiar with the DependencyObject class than MarkupExtension, so that is where I would start. (On it's surface it looks like MarkupExtension is limited in reading properties Further Reading) Creating an extension of DependencyObject will allow you to create new xaml tags, and interact with them programaticly (I don't know if that's necessary or not), and you can add properties by exposing static DependencyProperties on the dependency objects.

Here's a DependencyObject tutorial that I haven't used, but on the surface appears to have most of the elements that you would need to get started.



来源:https://stackoverflow.com/questions/8243363/using-the-visual-studio-wpf-editor-to-create-an-gui-not-for-windows-gui

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!