使用 Visual Studio WPF 编辑器创建不适合 Windows GUI 的 GUI
在问题标题中很难解释,但是我想要实现的是:
我想使用 XAML(可能还有可视化编辑器)来创建不会在“MS Windows GUI”上呈现但在位图上呈现的 GUI(来自 System.Drawing 的位图类,而不是文件)。
这是因为我想创建一种简单的方法来在 G19 小屏幕上“打印”。
我已经构建了一个库,可以让我轻松地用位图图像填充屏幕。现在我想更进一步,允许使用 Visual Studio 的人们通过使用 wpf 编辑器创建小程序,从而更快、更轻松地制作小程序。
显然,我需要构建所有组件(文本块、进度条和图像),但这不是问题。
我需要遵循一些准则和一些建议,因为我不太知道在创建完全替换 xaml 文件中标记的内容时从哪里开始(就像 UserControl 那样)。
显然,我不需要与 GUI 进行鼠标/键盘交互,因为为了处理屏幕,我将使用一些为此目的而构建的按键。
关于我应该从哪里开始构建这个东西有什么建议吗?我是否需要继承 MarkupExtension 类?如果可能的话,我需要一些类似教程的链接(显然我会根据我的需要调整这些教程)
甚至可能做这样的事情吗?
感谢您的任何建议
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
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我对 DependencyObject 类比 MarkupExtension 更熟悉,所以这就是我开始的地方。 (从表面上看,MarkupExtension 在读取属性方面受到限制 进一步阅读)创建 DependencyObject 的扩展将允许您创建新的 xaml 标记,并以编程方式与它们交互(我不知道这是否有必要),并且您可以添加通过在依赖对象上公开静态 DependencyProperties 来获取属性。
这是我没有使用过的 DependencyObject 教程 ,但从表面上看似乎拥有您入门所需的大部分元素。
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.