After getting a XamlParseException with message: 'Provide value on 'System.Windows.Baml2006.TypeConverterMarkupExtension' with the given solutions, setting the icon programmatically worked for me. This is how I did it:
Icon = new BitmapImage(new Uri("<icon_path>", UriKind.Relative));
Please inform me if you have any difficulties implementing this solution so I can help.