views:

102

answers:

2

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
I hope it should have some meaning if it is there.
viky
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
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