public void addPosButton(POSITION posIN) { Button but = new Button(); but.Width = 15; but.Opacity = 0.5; but.Width = 25; but.Height = 45; but.Margin = new Thickness(1, 8, 1, 8); textblock.Inlines.Add(but); }
public void addPosButton(POSITION posIN) { BitmapImage bi3 = new BitmapImage(new Uri("C:/Users/Justyna/source/repos/Snackautomaten Verwaltungsapp/cheetosSnack.png", UriKind.Absolute)); //img.Stretch = Stretch.UniformToFill; Image img = new Image { Source = bi3 }; img.Width = 25; img.Height = 45; img.Margin = new Thickness(1, 1, 1, 5); textblock.Inlines.Add(img); /* photo von datenbank * Image img = new Image(); * img.Width = 25; * img.Height = 45; * BitmapImage bi3 = new BitmapImage(); * bi3.BeginInit(); * bi3.UriSource = new Uri(posIN.PRODUKT.P_URI_PHOTO); * bi3.EndInit(); * //img.Stretch = Stretch.UniformToFill; * img.Source = bi3; * img.Margin = new Thickness(1, 1, 1, 1); * textblock.Inlines.Add(img); */ /* einfache buttons * * Button but = new Button(); * but.Width = 15; * but.Opacity = 0.5; * but.Width = 25; * but.Height = 45; * but.Tag = posIN.POS_ID; * but.Margin = new Thickness(1, 1, 1, 1); * textblock.Inlines.Add(but); */ }