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?
A:
I don't think it really matters. Typically it will be the type in which the command is declared and created
Thomas Levesque
2010-04-06 09:29:15
I hope it should have some meaning if it is there.
viky
2010-04-06 09:35:36
Well, 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
2010-04-06 09:58:37
A:
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.
Mike Two
2010-04-06 10:14:29