title: Adding Icon property to xaml
body: <p>I'm trying to add an icon to a wpf window, but I'm getting an xaml parsing exception whenever I add the following line to my code:</p>
  
  <pre><code>Icon="myIcon.ico"
  </code></pre>
  
  <p>My window tag looks like this (and runs fine) without the Icon property:
  </p>
  
  <pre><code>&lt;Window x:Class="MyProject.MainWindow"
  xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
  xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
  xmlns:local="clr-namespace:MyProject"
  mc:Ignorable="d"
  Title="My Project" Height="562.356" Width="1058.204"&gt;
  </code></pre>
  
  <p>If I add <code>Icon="myIcon.ico"</code> before the <code>&gt;</code>, I get an error on the <code>W</code> in <code>Width="1058.204"</code></p>
  
  <blockquote>
    <p>Exception thrown: 'System.Windows.Markup.XamlParseException' in
    PresentationFramework.dll</p>
    
    <p>Additional information: 'Provide value on
    'System.Windows.Baml2006.TypeConverterMarkupExtension' threw an
    exception.' Line number '8' and line position '58'.</p>
  </blockquote>
  
  <p>So, the code erroring out looks like this:
  </p>
  
  <pre><code>&lt;Window x:Class="MyProject.MainWindow"
  xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
  xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
  xmlns:local="clr-namespace:MyProject"
  mc:Ignorable="d"
  Title="My Project" Height="562.356" Width="1058.204"
  Icon="myIcon.ico"&gt;
  </code></pre>
  
  <p>I feel like I must be missing something very simple here. Based off of other posts here (<a href="https://stackoverflow.com/questions/5101895/how-to-change-title-bar-image-in-wpf-window">How to change title bar image in WPF Window?</a>) I feel like I'm doing it right.</p>
  
  <p>Can anyone help? Thanks!</p>