//public static BitmapSource ConvertBitmapTo96DPI(BitmapImage bitmapImage) //{ // double dpi = 96; // int width = bitmapImage.PixelWidth; // int height = bitmapImage.PixelHeight; // int stride = width * bitmapImage.Format.BitsPerPixel; // byte[] pixelData = new byte[stride * height]; // bitmapImage.CopyPixels(pixelData, stride, 0); // return BitmapSource.Create(width, height, dpi, dpi, bitmapImage.Format, null, pixelData, stride); //} #endregion private void ClaimList_DropDownClosed(object sender, EventArgs e) { //called when claimlist dropdown is closed after selection of claim to attach the file to by user in ui // validates user input and calls next step for user if (ClaimList.SelectedIndex > -1) { AvailableDocuments.IsEnabled = true; AvailableDocuments.Focus(); } else { System.Windows.Forms.MessageBox.Show("Select a claim to import file(s) into.", "Select a claim.", System.Windows.Forms.MessageBoxButtons.OK, System.Windows.Forms.MessageBoxIcon.Question); } }
public void PopulateDropDownLists( IEnumerable <Document> documents, IEnumerable <Classification> classifications, IEnumerable <Keyword> keywords) { AvailableDocuments.AddRange(documents .OrderBy(d => d.Id) .Select(d => new SelectListItem { Value = d.Id.ToString(), Text = d.CatalogCode + " - " + d.Title, Selected = d.Id == Image.DocumentId })); AvailableKeywords.AddRange(keywords .OrderBy(k => k.Id) .ToList() .Select(k => new TranslatedViewModel <Keyword, KeywordTranslation>(k)) .Select(k => new SelectListItem { Value = k.Entity.Id.ToString(), Text = k.Translation.Value, Selected = KeywordIds.Contains(k.Entity.Id) })); AvailableClassifications.AddRange(classifications .OrderBy(c => c.Id) .ToList() .Select(c => new TranslatedViewModel <Classification, ClassificationTranslation>(c)) .Select(c => new SelectListItem { Value = c.Entity.Id.ToString(), Text = c.Translation.Value, Selected = Image.ClassificationId == c.Entity.Id })); }