WPF自定义网格不显示内容

时间:2012-10-31 15:17:00

标签: c# wpf grid

我有一个控件,我继承自Grid

<Grid x:Class="User_Controls.CustomGrid"
         xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
         xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
         xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
         xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
         mc:Ignorable="d" x:Name="LayoutRoot" 
         >

<TextBlock>Test</TextBlock>
</Grid>

目前背后的代码是空白

 public partial class CustomGrid : Grid
{
public CustomGrid(){}    
}

我在页面上的另一个网格中有一个CustomGrid实例。

<Grid Grid.Column="4" Grid.Row="2" Style="{StaticResource MenuItemStyle}">
            <src:LiveTile  x:Name="liveTile1" />    
        </Grid>

运行项目时,不显示文本字段中的值。我已经尝试将控件从父网格中取出,弄乱了字体和垂直/水平对齐。

任何想法为什么我看不到价值?

0 个答案:

没有答案
相关问题