none
how to get the Stroke Id or the order in Window.System.Ink RRS feed

  • Question

  •  

    hi, may i know the difference in using Microsoft.Ink and Window.System.Ink? Is Window.System.Ink used specially for wpf?

    Apart from that, for Stroke, how do i get the Id or other method to determine the order of the particular selected stroke. I created the stroke under Window.System.Ink. Any ideas?

     

    Thanks in advance

    Friday, October 26, 2007 9:22 AM

Answers

  • Hi nyc9,

     

    we have explicitely eliminated the concept of a StrokeID in the WPF ink object model. What is your scenario that requires a Stroke ID?

     

    In the Winforms ink object model a stroke was always contained by exactly one Ink object. The ID made sense in that context. In WPF a stroke can exist just by itself. And it can be contained by more than one StrokeCollection. An ID on the stroke object would not make much sense here.

     

    If you want to know the index of a stroke in a given stroke collection, you can use the IndexOf() method on the StrokeCollection class:

     

    Code Block

    int index = myStrokeCollection.IndexOf(myStroke);

     

     

     

    Thanks,

    Stefan Wick

     

    Microsoft - Windows Experience

    Friday, October 26, 2007 2:54 PM

All replies

  • Hi nyc9,

     

    we have explicitely eliminated the concept of a StrokeID in the WPF ink object model. What is your scenario that requires a Stroke ID?

     

    In the Winforms ink object model a stroke was always contained by exactly one Ink object. The ID made sense in that context. In WPF a stroke can exist just by itself. And it can be contained by more than one StrokeCollection. An ID on the stroke object would not make much sense here.

     

    If you want to know the index of a stroke in a given stroke collection, you can use the IndexOf() method on the StrokeCollection class:

     

    Code Block

    int index = myStrokeCollection.IndexOf(myStroke);

     

     

     

    Thanks,

    Stefan Wick

     

    Microsoft - Windows Experience

    Friday, October 26, 2007 2:54 PM
  • hi,
    Thanks for your reply. May i know which event i should use in xaml to capture the stroke clicked with a mouse? In my application the strokes are added programatically. Is there any event that will be called when i clicked on one of the strokes i added?
    Thanks in advance

    Monday, October 29, 2007 2:38 AM
  • Hi nyc9,

     

    please open a new thread for each seperate question. This way other readers will get the most benefit from this forum. I will post an answer to your new thread.

     

    Thanks,

    Stefan Wick

     

    Microsoft - Windows Experience

    Monday, October 29, 2007 3:46 AM