void boton_Click(object sender, RoutedEventArgs e)
{
Button boton=(Button)sender;
string id = (string)boton.Content;
switch (id)
{
case "xxxxxxx":
//codigo para id xxxxxxx
break;
case "yyyyyyy":
//codigo para id yyyyyyy
break;
default:
break;
}
}
void home_ListChanged()
{
int index = 0;
while (index < home.List.Count)
{
Image image
= new Image
(); string id = ((Furniture)home.List.ElementAt(index)).Id;
image
.Source = new BitmapImage
(new Uri
(@"/Frontend;component/Images/" + id
+ ".png", UriKind
.Relative)); image.Width = home.List.ElementAt(index).Width;
image.Height = home.List.ElementAt(index).Height;
canvas.Children.Add(image);
b.Content = id;
mappingIda.Add(((Furniture)home.List.ElementAt(index)), image);
stackPanel.Children.Add(l);
b.Click=boton_Click;
index++;
}
}