Prism 4/Silverlight 4/MEF-未找到区域
我只是在学习PRISM,所以这可能是一个非常简单的错误:我试图用“样式”定义区域,但它们没有找到:(:( 在主“Shell”窗口上,我有“ContentControl”,其中包括“Frame”对象。“ContentControl”在附加的ResourceDictionary中设置样式,并在其中定义了所有区域(使用其他颜色、画笔、按钮、网格等),但每当程序运行时(均正确显示在屏幕上),IRegionManager都会显示。区域是空集合 对于使用“Style”中的区域,我能做些什么吗 代码如下: Shell.xamlPrism 4/Silverlight 4/MEF-未找到区域,silverlight,prism,Silverlight,Prism,我只是在学习PRISM,所以这可能是一个非常简单的错误:我试图用“样式”定义区域,但它们没有找到:(:( 在主“Shell”窗口上,我有“ContentControl”,其中包括“Frame”对象。“ContentControl”在附加的ResourceDictionary中设置样式,并在其中定义了所有区域(使用其他颜色、画笔、按钮、网格等),但每当程序运行时(均正确显示在屏幕上),IRegionManager都会显示。区域是空集合 对于使用“Style”中的区域,我能做些什么吗 代码如下: S
<UserControl x:Class="CardManagment.Shell"
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:sdk="http://schemas.microsoft.com/winfx/2006/xaml/presentation/sdk"
d:DesignHeight="300"
d:DesignWidth="400"
mc:Ignorable="d">
<ContentControl HorizontalAlignment="Stretch"
VerticalAlignment="Stretch"
Style="{StaticResource MainWindowStyle}">
<sdk:Frame x:Name="MainFrame"
HorizontalAlignment="Stretch"
VerticalAlignment="Stretch"
BorderBrush="#FFFB0000"
Style="{StaticResource GlobalNavigationFrameStyle}"
UriMapper="{StaticResource GlobalUriMapper}" />
</ContentControl>
</UserControl>
和资源字典:
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:prism="clr-namespace:Microsoft.Practices.Prism.Regions;assembly=Microsoft.Practices.Prism"
xmlns:sdk="http://schemas.microsoft.com/winfx/2006/xaml/presentation/sdk" xmlns:toolkit="http://schemas.microsoft.com/winfx/2006/xaml/presentation/toolkit">
<Style x:Key="MainWindowStyle" TargetType="ContentControl">
<Setter Property="Foreground" Value="#FF000000"/>
<Setter Property="HorizontalContentAlignment" Value="Left"/>
<Setter Property="VerticalContentAlignment" Value="Top"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="ContentControl">
...
...
...
<Border Grid.Row="1" BorderThickness="2" CornerRadius="2" BorderBrush="#FFDC1EBA">
<ContentControl x:Name="GlobalLogoRegion" prism:RegionManager.RegionName="GlobalLogoRegion" />
</Border>
...
...
...
...
...
...
...
好-现在我在这页上找到了答案:
实际上,根据本文,这是PRISM中的一个已知错误