EightyOne Unite
EightyOne Unite

Reputation: 11805

WPF - Which built in controls implement ICommandSource?

That's a pretty straightforward question isn't it?

I'm just after a flat list of those controls that implement ICommandSource,..thought it would be useful and no doubt someone has that kind of info.

Thanks in advance

Upvotes: 0

Views: 757

Answers (3)

Kent Boogaart
Kent Boogaart

Reputation: 178770

According to reflector: ButtonBase, MenuItem, Hyperlink and InputBinding (which is not a control).

Upvotes: 3

J Stewart
J Stewart

Reputation: 231

Here is a good suggestion if you want to expand that all-too-short list.

Upvotes: 0

Jakob Christensen
Jakob Christensen

Reputation: 14956

Try this code snippet:

        Assembly assem = Assembly.LoadFrom(@"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\v3.0\PresentationFramework.dll");
        foreach (Type t in assem.GetTypes())
        {
            Type interfaceType = t.GetInterface("ICommandSource");
            if (interfaceType != null)
                Console.WriteLine(t.ToString());
        }

Upvotes: 3

Related Questions