none
InkCanvas layout does not update after DragDrop stroke remove event RRS feed

  • Question

  • removing of strokes in DragDrop onpreviewmousedown event remove the stroke but still see the stroke in inkcanvas. Do i need to updatelayout in inkcanvas?
    Saturday, June 7, 2014 4:52 AM

Answers

  • Hi Jimmy,

    I appreciate your time. Last weekends, i managed to find the reason.

    If we call inkCanvas.Strokes.Clear(); it clear the stroke with adorner layer.

    However, it did not clear strokes in inkPresenter. Hence, I still see the left over stroke on inkcanvas where i could not do selection or deletion.

    Finally, only after i clear from inkpresenter, it got clear.

    Cheer!

    • Proposed as answer by Marvin_Guo Monday, June 9, 2014 10:21 AM
    • Marked as answer by Yang,Chenfei Friday, June 13, 2014 3:25 AM
    Monday, June 9, 2014 10:19 AM
  • Hi,

    Based on your description, I understood there is an issue regarding InkCanvas doesn’t update after stroke clear.

    I created a sample to test this issue. I tested InkCanvas’ preview events. It doesn’t work. We should use another button to clear the strokes in InkCanvas. And it will update InkCanvas.

    	private void Button_Click(object sender, RoutedEventArgs e)
    	{
    		inkCanvas.Strokes.Clear();
    	}

    If the above reply cannot help. Please post the relevant code about this issue. It will help us to figure out this issue.

    Have a nice time!

    Sincerely,


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    • Proposed as answer by Marvin_Guo Monday, June 9, 2014 10:21 AM
    • Marked as answer by Yang,Chenfei Friday, June 13, 2014 3:25 AM
    Monday, June 9, 2014 6:08 AM

All replies

  • Hi,

    Based on your description, I understood there is an issue regarding InkCanvas doesn’t update after stroke clear.

    I created a sample to test this issue. I tested InkCanvas’ preview events. It doesn’t work. We should use another button to clear the strokes in InkCanvas. And it will update InkCanvas.

    	private void Button_Click(object sender, RoutedEventArgs e)
    	{
    		inkCanvas.Strokes.Clear();
    	}

    If the above reply cannot help. Please post the relevant code about this issue. It will help us to figure out this issue.

    Have a nice time!

    Sincerely,


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    • Proposed as answer by Marvin_Guo Monday, June 9, 2014 10:21 AM
    • Marked as answer by Yang,Chenfei Friday, June 13, 2014 3:25 AM
    Monday, June 9, 2014 6:08 AM
  • Hi Jimmy,

    I appreciate your time. Last weekends, i managed to find the reason.

    If we call inkCanvas.Strokes.Clear(); it clear the stroke with adorner layer.

    However, it did not clear strokes in inkPresenter. Hence, I still see the left over stroke on inkcanvas where i could not do selection or deletion.

    Finally, only after i clear from inkpresenter, it got clear.

    Cheer!

    • Proposed as answer by Marvin_Guo Monday, June 9, 2014 10:21 AM
    • Marked as answer by Yang,Chenfei Friday, June 13, 2014 3:25 AM
    Monday, June 9, 2014 10:19 AM