[ad_1]
I need to show a popover when selecting an item in a NSListView; whis works just fine, but I cannot get my image to show.
This is the controller for the popover:
public ImagePopoverController (NSImageView imageview) : base ("ImagePopover", NSBundle.MainBundle)
{
Initialize ();
ArticleViewer = imageview;
}
This is my override for the table delegate:
public override void SelectionDidChange(NSNotification notification)
{
var Table = notification.Object as NSTableView;
TableProduct SelectedProduct = DataSource.Products[(int)Table.SelectedRow];
if (File.Exists(String.Format("cache/{0}.png", SelectedProduct.SKU)))
{
imageView.Image = new NSImage(String.Format("cache/{0}.png", SelectedProduct.SKU));
}
ImagePopover.Show(new RectangleF(0, 0, 0, 0), View.View, NSRectEdge.MinYEdge);
}
The popover shows fine, but I cannot get the image to load.
[ad_2]