public IContent GetContent(IMetadataProvider parent) { Content content = new Content(parent); MediaBehaviour mb = content.AddBehaviour <MediaBehaviour>(); mb.Reference = this._reference; return(content); }
public void Convert(MediaBehaviour behaviour) { var bitmap = string.IsNullOrWhiteSpace(behaviour.Parent.GetValueForKey("RootFolder"))? new BitmapImage(new Uri(behaviour.Reference, UriKind.Relative)) : new BitmapImage(new Uri($"{behaviour.Parent.GetValueForKey("RootFolder")}\\{behaviour.Reference}")); //var bitmap = new BitmapImage(new Uri(behaviour.Reference, UriKind.Relative)); var control = new System.Windows.Controls.Image() { Source = bitmap, Height = bitmap.Height }; this.Control = control; }
public void Visit(MediaBehaviour behaviour) { this.Manager.Convert(behaviour); }