Currently I can add resources to a control with something similar to the following:
Button b = new Button();
b.Resources.Add("item", currentItem);
I’d like to do this with XAML. I’ve tried something like
<Button Content="Timers Overview" Name="btnTimerOverview">
<Button.Resources>
<ResourceDictionary>
<!-- not sure what to add here, or if this is even correct -->
<!-- I'd like to add something like a <string, string> mapping -->
<!-- like name="items" value="I am the current item." -->
</ResourceDictionary>
</Button.Resources>
</Button>
but I haven’t gotten any further than this. Is there a way to do this in XAML?
Try this: