I have a lot of ToggleButtons (about 260). Part of my code with ToggleButtons:
<ToggleButton Style="{DynamicResource Seat}" Content="10" Click="OnSeatButtonClick"/>
<ToggleButton Style="{DynamicResource Seat}" Content="18" Click="OnSeatButtonClick"/>
<ToggleButton Style="{DynamicResource Seat}" Content="10" Click="OnSeatButtonClick" IsEnabled="False"/>
I want to add action that after clicking on button "Confirm changes", ToggleButtons that are at the moment checked will go into disabled state. And what is more I want those changes to be saved to database.
So I figured that I would need to add some unique id to those ToggleButtons. And then somehow bind them to a List with elements of type Saet.
Code of class Seat:
public class Seat
{
string Column;
string Number;
bool IsTaken;
}
So my question is: how to bind those ToggleButtons with List, so that I will be able to operate on them?
Any help here much appreciated!