/// <summary>
 /// ctor that accepts with model
 /// </summary>
 /// <param name="mdl"></param>
 public PictureViewModel(IPictureModel mdl)
 {
     ID          = mdl.ID;
     FileName    = mdl.FileName;
     IPTC        = new IPTCViewModel(mdl.IPTC);
     EXIF        = new EXIFViewModel(mdl.EXIF);
     Camera      = new CameraViewModel(mdl.Camera);
     DisplayName = $"{IPTC.Headline}|{FileName} (by {Photographer}|{IPTC.ByLine})";
 }
示例#2
0
        public PictureViewModel(IPictureModel model)
        {
            if (model is PictureModel)
            {
                IPTC         = new IPTCViewModel(model.IPTC);
                EXIF         = new EXIFViewModel(model.EXIF);
                Photographer = new PhotographerViewModel(((PictureModel)model).Photographer);
                Camera       = new CameraViewModel(model.Camera);
                EXIF.Camera  = Camera;
            }

            if (model != null)
            {
                ID          = model.ID;
                FileName    = model.FileName;
                FilePath    = GlobalInformation.Path + "\\" + FileName;
                DisplayName = FileName.Split('.')[0];
                string name = model.FileName;
                string by   = model.IPTC.ByLine;
                DisplayName = name + " (by " + Photographer.FirstName + " " + Photographer.LastName + ")";
            }
        }