0
我正在尝试为我的测试Silverlight应用程序创建一个Syles.xaml文件。以下是我在App.xaml文件:Silverlight中的XAML样式不被识别
<Application xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:navigation="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Navigation"
xmlns:uriMapper="clr-namespace:System.Windows.Navigation;assembly=System.Windows.Controls.Navigation"
x:Class="MVCSilverlight.App"
>
<Application.Resources>
<Style x:Key="NavigationContainerStyle" TargetType="StackPanel">
<Setter Property="Background" Value="Black" />
<Setter Property="Orientation" Value="Horizontal" />
<Setter Property="Height" Value="50" />
<Setter Property="Width" Value="500" />
</Style>
</Application.Resources>
</Application>
的问题是,当我包括在这个应用程序,VS2010不承认它,当我运行应用程序,它不会显示,因为有尝试查找资源名称/值时出错。下面是如何被使用它的一个例子:
<StackPanel Style="{StaticResource NavigationContainerStyle}">
</StackPanel>
我也试图把样式文件,包括它在App.xaml中,但没有工作要么。
有人可以给我一些想法,为什么发生这种情况?
上面的代码示例“应该”按原样正常工作。你看到什么错误? – Scrappydog 2010-08-13 14:49:59