private void AddLibraryContainerItems() { foreach (string file in Directory.GetFiles(@".\Images", "*.png")) { Image img = new Image(); BitmapImage BMP = new BitmapImage(); BMP.BeginInit(); BMP.UriSource = new Uri(file, UriKind.RelativeOrAbsolute); BMP.EndInit(); LibraryBarItem LBI = new LibraryBarItem(); LBI.Width = 100; LBI.Height = 100; LBI.Background = new ImageBrush(BMP); } }
private void AddLibraryContainerItems() { foreach (string file in Directory.GetFiles(@".\Images", "*.png")) { Image img = new Image(); BitmapImage BMP = new BitmapImage(); BMP.BeginInit(); BMP.UriSource = new Uri(file, UriKind.RelativeOrAbsolute); BMP.EndInit(); LibraryBarItem LBI = new LibraryBarItem(); LBI.Width = 100; LBI.Height = 100; LBI.Background = new ImageBrush(BMP); } }