如何在没有Darg Drop的情况下在画布上显示项目? [英] How Can I Show An Item On The Canvas Without Darg Drop?

查看:51
本文介绍了如何在没有Darg Drop的情况下在画布上显示项目?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

项目显示在画布上

item are shown on the canvas with help of dragevent

protected override void OnDrop(DragEventArgs e) 





我的问题是我需要调用与



My problem is this that i need to invoke a function that is in the same class as the

onDrop(drageventargs e) 





该项目被添加为,其中这实际上是画布



The item are added as , where this is actually the canvas

this.Children.Add(someItem); 





我需要在画布加载时调用该函数。



I need to call that function when the canvas loads.

推荐答案

请看我对这个问题的评论。很明显,如果不是一般的编程,你会对WPF开发的基础知识感到困惑。



请参阅:

https://msdn.microsoft.com/ en-us / library / System.Windows.Controls.Panel%28v = vs.110%29.aspx#inheritanceContinued [ ^ ],

https://msdn.microsoft.com/ en-us / library / system.windows.controls.panel.children%28v = vs.110%29.aspx [ ^ ]。



对于WPF的一般理解,在此a至少在一般概念中你需要理解它的内容模型 https://msdn.microsoft.com/en-us/library/bb613548%28v=vs.110%29.aspx [ ^ ]。



-SA
Please see my comment to the question. It's apparent that you are quite confused with the very basics of WPF development, if not programming in general.

Please see:
https://msdn.microsoft.com/en-us/library/System.Windows.Controls.Panel%28v=vs.110%29.aspx#inheritanceContinued[^],
https://msdn.microsoft.com/en-us/library/system.windows.controls.panel.children%28v=vs.110%29.aspx[^].

For general WPF understanding, in this aspect, you need to understand its Content Model at least in general concepts: https://msdn.microsoft.com/en-us/library/bb613548%28v=vs.110%29.aspx[^].

—SA


这篇关于如何在没有Darg Drop的情况下在画布上显示项目?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆