I've got a series of buttons labelled for the 24 hour clock. For example;
<StackPanel Orientation="Horizontal">
<ToggleButton Content="00:00" Name="thetime0000"/>
<ToggleButton Content="01:00" Name="thetime0100" />
<ToggleButton Content="02:00" Name="thetime0200" />
<ToggleButton Content="03:00" Name="thetime0300" />
etc.
Now I store the values of each element in a database as a BIT, and I'm trying to associate them so they are selected or not. I had an idea of trying to enumerate all the toggle buttons but can't get that far;
System.Windows.Controls.Primitives.ToggleButton [24] fudge =
new System.Windows.Controls.Primitives.ToggleButton [24];
fudge[0] = thetime0000;
fudge[1] = thetime0100;
Could I call the element directly by element name or number? Any ideas?