0
我有自定義控件名爲框架(公共類框架:ContentControl,IDisposable)。構造函數中的Frame定義了DefaultStyleKey = typeof(Frame);框架模板在Generic.xaml資源中。現在,在其他一些項目中,我使用的框架是在Silverlight.Controls,如果我把我的主網頁的根元素是幀這樣根控制模板
<ShellFrame:Frame x:Class="Modules.Adresar.MainPage"
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:s="clr-namespace:Modules.Adresar.ViewModel"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:ShellFrame="clr-namespace:Silverlight.Controls;assembly=Silverlight.Controls" mc:Ignorable="d"
DataContext="{Binding Source={StaticResource VMLocator}, Converter={StaticResource VMIndexerConverter}, ConverterParameter=AdresarVM}"
d:DataContext="{d:DesignInstance IsDesignTimeCreatable=True, Type=s:AdresarViewModel}" x:Name="MainFrame">
<Grid x:Name="LayoutMain">
</Grid>
我不能編輯框的模板。混合顯示禁用編輯模板菜單項。但是如果我把佈局根網格內框在普通用戶控制那麼一切都確定..這樣
<UserControl
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:ShellFrame="clr-namespace:Silverlight.Controls;assembly=Silverlight.Controls"
mc:Ignorable="d"
x:Class="Adresar.Test"
d:DesignWidth="640" d:DesignHeight="480">
<Grid x:Name="LayoutRoot">
<ShellFrame:Frame Content="Frame" HorizontalAlignment="Left" Margin="72,136,0,0" VerticalAlignment="Top"/>
</Grid>
是否enybody知道爲什麼發生這種情況?謝謝!
更改後我無法構建..錯誤它無法創建框架.. – 2010-07-22 13:32:05