What should be the type of owner of the routed command?

I use custom wpf commands. When writing a user command, you must determine the type of owner. The description states that this is the type that registers the command. I saw some examples of user commands, and there the owner type was UIElement, and in some others it was the class name. What's the difference? What should be the type of owner?

+4
source share
2 answers

There is a similar question , and his answer may help. Personally, I always thought of it as a namespace if there are duplicate commands. But I may have simply tried to make sense of this for no reason. I always just make it a type that declares a command.

+2
source

I don’t think it really matters. This will usually be the type in which the command is declared and created.

+1
source

Source: https://habr.com/ru/post/1306095/


All Articles