I am using wpf Custom Commands. While writing a custom Command, one need to define the owner type. It's Description says that it is the type that is registering the command. I was seeing some sample of custom commands and there the Owner type was UIElement and in some others it was the class name itself. Whats the difference? What should be the owner type?
Asked
Active
Viewed 1,364 times
2 Answers
2
There is a similar question and its answer might help. Personally I've always thought of it like a namespace in case there are duplicate commands floating about. But I might have just been trying to attach meaning to it for no reason. I always just make it the type that declares the command.
1
I don't think it really matters. Typically it will be the type in which the command is declared and created

Thomas Levesque
- 286,951
- 70
- 623
- 758
-
I hope it should have some meaning if it is there. – viky Apr 06 '10 at 09:35
-
1Well, it has a meaning : it indicates which type owns the command... Anyway, that's the way it's done for all predefined RoutedCommands (ApplicationCommands, ComponentCommands, MediaCommands, NavigationCOmmands) – Thomas Levesque Apr 06 '10 at 09:58