private void SetImgContent() { CobImgGroup.Items.Clear(); FileSecurity fileSecurity = new FileSecurity(); List <FileInfo> fileinfoList = fileSecurity.GetAllFilesInDirectory(Globals.appStartupPath + "//" + "water_SKIN"); foreach (var item in fileinfoList) { if (GetImageFormat(item.Extension.ToLower())) { BitmapImage bitmapImage = new BitmapImage(); bitmapImage.BeginInit(); bitmapImage.UriSource = new Uri(item.FullName, UriKind.RelativeOrAbsolute); bitmapImage.EndInit(); Image imageCon = new Image(); imageCon.Source = bitmapImage; CobImgGroup.Items.Add(imageCon); } } //if(CobImgGroup.Items.Count>0) //{ // (CobImgGroup.Items[0] as ComboBoxItem).IsSelected = true; //} }