如何在没有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