Silverlight XAML文件错误:无法识别或无法访问成员“Margin”

时间:2014-02-10 22:14:03

标签: c# silverlight xaml silverlight-5.0

我在项目中引用了silverlight xaml文件。当我尝试构建此项目时,它会抛出以下错误

The member "Margin" is not recognized or is not accessible.

这是我的代码:

<UserControl x:Class="DBServer.Selenium.Silvernium.ReferenceApplication.SilverlightFixture"
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:navigation="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Navigation" 
mc:Ignorable="d" d:DesignWidth="640" d:DesignHeight="480">
<navigation:Frame x:Name="frameContent" Source="/MainPage.xaml" Margin="0,0,0,0"/>
</UserControl>

1 个答案:

答案 0 :(得分:0)

您是否尝试将框架放入网格中?

<Grid>
<navigation:Frame x:Name="frameContent" Source="/MainPage.xaml" Margin="0,0,0,0"/>
</Grid>

因为你说Margin =“0,0,0,0”但是在XAML中你没有任何其他内容作为对Margin中定义的距离的引用,所以尝试或删除边距或放置在网格内