开发者

What should be owner type of a routed command?

开发者 https://www.devze.com 2022-12-26 08:12 出处:网络
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 seei

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?


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.


I don't think it really matters. Typically it will be the type in which the command is declared and created

0

精彩评论

暂无评论...
验证码 换一张
取 消