I created a new silverlight 4 project in VS2010.
My App.xaml file looks like this:
<Application
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
x:Class="ZCall.App">
<Application.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="Resources/Styles.xaml"/>
<ResourceDictionary Source="Resources/ObjectResourceDictionary.xaml"/>
</ResourceDictionary.MergedDictionaries>
</ResourceDictionary>
</Application.Resources>
</Application>
xaml sample that generates an error:
<UserControl x:Class="ZCall.View.Control.CDetailsControl"
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:toolkit="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Toolkit"
mc:Ignorable="d">
<Grid x:Name="LayoutRoot" Background="White">
<toolkit:BusyIndicator x:Name="biCDetails" BusyContent="Busy...">
<Grid>
<Grid.RowDefinitions>
<RowDefinition/>
<RowDefinition Height="10"/>
<RowDefinition/>
<RowDefinition Height="10"/>
<RowDefinition/>
<RowDefinition Height="10"/>
<RowDefinition/>
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="150"/>
<ColumnDefinition Width="10"/>
<ColumnDefinition Width="150"/>
<ColumnDefinition Width="10"/>
<ColumnDefinition Width="170"/>
</Grid.ColumnDefinitions>
<StackPanel Grid.Row="0" Grid.Column="0" Grid.ColumnSpan="5" Orientation="Horizontal">
<TextBlock Text="Name:" Style="{StaticResource PatientLabel}"/>
<TextBlock x:Name="txtName" Style="{StaticResource PatientData}"/>
</StackPanel>
</Grid>
</toolkit:BusyIndicator>
</Grid>
</UserControl>
I get errors for both PatientLabel resources and PatientData.
The style.xaml file is located in the Resources folder in the project root directory.
My problem is that during development, none of my styles defined in styles.xaml is recognized, and I get an error "Resource cannot be resolved" for each style used, and at runtime, all styles are allowed and displayed as it should be.
Any suggestions?
Thanks in advance, kruvi
source
share