I am having a problem with accessing Application Resources from a UserControl in my Silverlight application. Here is my UserControl:
<UserControl x:Class="MyApp.MainControl"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:basics="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls" >
<basics:TabControl TabStripPlacement="Left">
<basics:TabItem Name="tabHome" Header="Home"></basics:TabItem>
<basics:TabItem Name="tabPatients" Header="{StaticResource My_Patients}"></basics:TabItem>
<basics:TabItem Name="tabOrganization" Header="My Organization"></basics:TabItem>
</basics:TabControl>
</UserControl>
I am getting an error on the line where I set the Header property of the tabPatients tab to the static resource My_Patients.
Here is my Application file:
<Application xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:System="clr-namespace:System;assembly=mscorlib"
x:Class="MyApp.App">
<Application.Resources>
<System:String x:Key="My_Patients">All My Patients</System:String>
</Application.Resources>
</Application>
Can anyone tell me what is wrong?