Quantcast
Channel: Windows Presentation Foundation (WPF) forum
Viewing all articles
Browse latest Browse all 18858

Image Metadata List (camera maker) struggling to achieve this in mvvm pattern

$
0
0
public class CameraMakersViewModel : ObservableObject //2nd VIEWMODEL - Create Collection For Camera Manufacturers
    {
        private ObservableCollection<string> _FoundManufacturers; //The COLLECTION/LIST OF CAMERA MANUFACTURERs
        public ObservableCollection<string> FoundManufacturers
            {
            get
            {
                return this._FoundManufacturers;
            }
            set
            {
                if (this._FoundManufacturers != value)
                {
                    this._FoundManufacturers = value;
                    OnPropertyChanged(() => this._FoundManufacturers);
                }
            }


        }


        public CameraMakersViewModel(FileInfo f) //Model Get MetaData And Add To Collection
        {
            FileStream fs = new FileStream(f.FullName, FileMode.Open, FileAccess.Read, FileShare.Read);
            BitmapSource img = BitmapFrame.Create(fs);
            BitmapMetadata md = (BitmapMetadata)img.Metadata;
            this.FoundManufacturers = new ObservableCollection<string> { md.CameraManufacturer.ToString()};
        }

        public CameraMakersViewModel() //Get Current Selected Drive
        {
            
        }

    }
This will probably look like a mess to some, I'm new to mvvm, to explain I have 2 List Boxes, 1 combobox, the combobox lists available hardrives, when one is chosen the listbox is filled with thumbnails, that works fine, the other listbox I want to list the various camera maker metadata from the listed pictures, i.e a list that says "sony, cannon, Nikon" whatever brands it can pick up from the photos, I'm struggling to achieve this so much help would be appreciated


Viewing all articles
Browse latest Browse all 18858

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>