I'd like to make a UserControl that I can reuse for the various buttons in my application. Is there a way to pass parameters to UserControls through XAML? Most of the buttons in my app will consist of two rectangles (one within the other) with some user specified colors. It will also possibly have an image. I'd like it to behave something like this this:
<Controls:MyCustomButton MyVarColor1="<hard coded color here>" MyVarIconUrl="<null if no icon or otherwise some URI>" MyVarIconX="<x coordinate of icon within button>" etc etc>
Then inside the button I would like to be able to use these values inside the XAML (assign the IconUrl to the source of the Icon, etc, etc.
Am I just thinking about this the wrong way or is there a way to do this? My purpose is to have less XAML code for all my buttons.
Thanks!