Xamarin.Mac - Show icon/image before Window Title

Viewed 73

I am trying to show an image/icon before the title of window, just like in finder. I have used Window.SetTitleWithRepresentedFilename but it just shows a generic icon not that png file I want to show.enter image description here

2 Answers
public override void WindowDidLoad()
{
    base.WindowDidLoad();

    Window.RepresentedUrl = new NSUrl(Path.GetFullPath("check.png"));
    var btn = Window.StandardWindowButton(NSWindowButton.DocumentIconButton);
    btn.Image = NSImage.ImageNamed("check");
}

You cannot show a PNG with this. It shows the finder icon for the type of the file you are pointing to (not the tumbnail). If you put the users home folder in it will show the little 'house' icon

Related