title: Default value for comboBox
body: <p>Hi I try set default value for comboBox.</p>
  
  <p>XAML:</p>
  
  <pre><code>        &lt;ComboBox Name="StatusCombo"
                    Style="{StaticResource statusComboStyle}"
                    SelectedValuePath="StatusMsg" 
                    SelectedValue="{Binding Path=SelectedStatus}"/&gt;
  </code></pre>
  
  <p>I use caliburn.Micro. I bind <code>List&lt;string, StatusItem&gt;</code> to ComboBox, it works good.</p>
  
  <p>Status item is simple class, here is it:</p>
  
  <pre><code>public class StatusItem
  {
      public string StatusMsg { get; set; }
      public BitmapImage StatusImg { get; set; }
  }
  </code></pre>
  
  <p><strong>App.xaml</strong>    </p>
  
  <p>I define empty string in app.xaml   </p>
  
  <pre><code>&lt;System:String x:Key="empty"&gt;&lt;/System:String&gt;
  </code></pre>
  
  <p>statusComboStyle is here:</p>
  
  <pre><code>   &lt;Style x:Key="statusComboStyle" TargetType="{x:Type ComboBox}"&gt;
              &lt;Style.Triggers&gt;
                  &lt;DataTrigger Binding="{Binding Path= SelectedStatus}" Value="{StaticResource empty}"&gt;
                     &lt;Setter Property="SelectedIndex" Value="0"/&gt;
                  &lt;/DataTrigger&gt;
              &lt;/Style.Triggers&gt;
          &lt;/Style&gt;
  </code></pre>
  
  <p>But something must be wrong, because I get this compile error:</p>
  
  <p><code>{"No matching constructor found on type 'System.String'. You can use the Arguments or FactoryMethod directives to construct this type."}</code></p>
  
  <pre><code>at System.Windows.Markup.XamlReader.RewrapException(Exception e, IXamlLineInfo lineInfo, Uri baseUri)
  at System.Windows.Markup.WpfXamlLoader.Load(XamlReader xamlReader, IXamlObjectWriterFactory writerFactory, Boolean skipJournaledProperties, Object rootObject, XamlObjectWriterSettings settings, Uri baseUri)
  at System.Windows.Markup.WpfXamlLoader.LoadBaml(XamlReader xamlReader, Boolean skipJournaledProperties, Object rootObject, XamlAccessLevel accessLevel, Uri baseUri)
  at System.Windows.Markup.XamlReader.LoadBaml(Stream stream, ParserContext parserContext, Object parent, Boolean closeStream)
  at System.Windows.Application.LoadComponent(Object component, Uri resourceLocator)
  at Spirit.Views.LogOnView.InitializeComponent() in c:\Users\Jan\Documents\Visual Studio 2010\Projects\C#\Pokec_Messenger\ver.beta\Pokec__Messenger\Spirit_Caliburn_Micro_v1.0\Views\LogOnView.xaml:line 1
  at Spirit.Views.LogOnView..ctor() in C:\Users\Jan\Documents\Visual Studio 2010\Projects\C#\Pokec_Messenger\ver.beta\Pokec__Messenger\Spirit_Caliburn_Micro_v1.0\Views\LogOnView.xaml.cs:line 24
  </code></pre>
  
  <p>I check in data trigger if SelectedStatus is empty string, if value is empty string I set frist item in comboBox.</p>