Link to home
Start Free TrialLog in
Avatar of Tom Knowlton
Tom KnowltonFlag for United States of America

asked on

XAML - How to add new property to a Button?

In XAML / C# - is it possible to add a custom attribute or property to a <Button/> that is an enumeration?

 
     <Button x:Name="acButton"
                Content="/"
                Margin="5"
                Grid.Row="1"

[b]Kind="Division"[/b]


                Grid.Column="0"/>

Open in new window


"Kind" would give intellisense (code completion) options of "Addition, Subtraction, Multiplication, Division"

In the C# code behind, something like this:

  public enum SelectedOperator
    {
        Addition,
        Subtraction,
        Multiplication,
        Division
    }

Open in new window




How do you code it?  Do you inherit from Button?
ASKER CERTIFIED SOLUTION
Avatar of Misha
Misha
Flag of Russian Federation image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Tom Knowlton

ASKER

I read the article, but I don't get it.

Can you give me a simple example?