Silverlight/XAML - How to get parent name of element after MouseLeftButtonUp event? -


i setup simple chessboard (i have hardcoded in xaml) this:

    <border name="s0" grid.column="0" grid.row="7" background="black">         <image mouseleftbuttondown="image_mouseleftbuttondown" mouseleftbuttonup="image_mouseleftbuttonup" mousemove="image_mousemove" source="/silverlightapplication4;component/all_chess_pieces_png_by_abener.png" canvas.zindex="1" />     </border> 

each border on board have name s0, s1, s2, etc.

on dragging element i'm getting name of starting square, working fine.

what want name of end square after droping element square. instead i'm still getting name of square start dragging from.

    private void image_mouseleftbuttonup(object sender, mousebuttoneventargs e)     {         image image = (image)sender;         canvas border = (canvas)image.parent;          image.releasemousecapture();         _isdragging = false;          string data = border.name;      } 

i've tried canvas , rectangle, fixed size. think that's wrong direction. (becaue not working anyway).


Comments

Popular posts from this blog

objective c - Change font of selected text in UITextView -

php - Accessing POST data in Facebook cavas app -

c# - Getting control value when switching a view as part of a multiview -