In Java you have an Action class to can assign to various things, e.g.
button.setAction(myAction);
menuitem.setAction(myAction);
The advantage being if I change a property of myAction, e.g. disabled,
caption, the change is reflected in the button and menuItem.
Is there an equivalent in C#
TIA
David McCallum
Nicholas Paldino [.NET/C# MVP] - 11 May 2007 14:16 GMT
David,
This is the Command pattern, and there isn't anything like that out of
the box in .NET 2.0. If you are using WPF (.NET 3.0), there is a command
infrastructure built into that, but there are a lot of concepts there which
need to be learned on top of that, as it's not just "straight-up" .NET
(dependency properties, routed events, xaml, etc, etc).

Signature
- Nicholas Paldino [.NET/C# MVP]
- mvp@spam.guard.caspershouse.com
> In Java you have an Action class to can assign to various things, e.g.
>
[quoted text clipped - 9 lines]
>
> David McCallum
Chakravarthy - 11 May 2007 18:57 GMT
Did you try the Delegate mechanism that is available in C#.
Post back for more in detail with the requirement.

Signature
Every thing is perfect, as long as you share!!!
Don''t forget to rate the post
> In Java you have an Action class to can assign to various things, e.g.
>
[quoted text clipped - 9 lines]
>
> David McCallum