Closed Quade369 closed 7 years ago
Um....Good question. The event handlers shouldn't be a problem, since those are using the sender. "_isSubscribed" might have to be mapped to individual controls...
Typically, I'd have given each of them their own attached property to try to ensure it's thread safe. I mean you probably don't want to use the same keyeventhandler for each instance. In my case I'd probably want one handler per VM.
I guess the answer then is "not sure" so I'm wondering if I should switch them to attachedproperties to be safe?
Hey Quade, sorry for the delayed response. I don't know that thread safety really matters with the KeyEventHandler, because it's using the sender each time. So, it's always targeting the correct control.
You could try it your way and let me know how it works out?
I was just wondering if the statics defined in the autocomplete code.
` private static TextChangedEventHandler onTextChanged = ...
private static KeyEventHandler onKeyDown = ...
private static bool _isSubscribed = false;`
Are an issue if I want to use more than one instance of the control on a single application.