Click here to Skip to main content
15,880,608 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
item are shown on the canvas with help of dragevent
C#
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
C#
onDrop(drageventargs e) 


The item are added as , where this is actually the canvas
C#
this.Children.Add(someItem); 


I need to call that function when the canvas loads.
Posted
Updated 6-Mar-15 1:01am
v2
Comments
Sergey Alexandrovich Kryukov 5-Mar-15 11:41am    
The question makes no sense. You don't need drag-n-drop to show anything on canvas. The question suggests that you have no clue how UI/graphics is developed in general. A hint: canvas has Children property.
—SA

1 solution

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
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900