5
我正試圖在月光下開發一個應用程序。現在我試圖使用DataGrid來顯示一些數據。月光與silverlight :: datagrid不兼容?
在一箇舊的Silverlight項目我以這種方式使用一個DataGrid:
<UserControl x:Class="One.Page"
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"
mc:Ignorable="d"
d:DesignHeight="300" d:DesignWidth="400"
xmlns:my="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Data">
<Grid x:Name="LayoutRoot" Background="White">
<StackPanel Orientation="Vertical">
<TextBlock x:Name="lbl1">lblInfo1</TextBlock>
<TextBlock x:Name="lbl2">lblInfo2</TextBlock>
<TextBox x:Name="txt1">Write here</TextBox>
<Button x:Name="btn1" Content="Send" Click="btn1_Click" />
<my:DataGrid x:Name="grData"
Grid.Row="1"
Width="500" Height="250"
Margin="10"
AutoGenerateColumns="False">
<my:DataGrid.Columns>
<my:DataGridTextColumn Header="Código" />
<my:DataGridTextColumn Header="Lote" />
<my:DataGridTextColumn Header="Ciudad" />
<my:DataGridTextColumn Header="País" />
</my:DataGrid.Columns>
</my:DataGrid>
</StackPanel>
</Grid>
</UserControl>
,但如果我在新的月光項目中使用相同的代碼我得到一個空白頁。我一直在尋找一些例子,我發現了一個簡單的一個:
是這個例子中,筆者使用DartaGrid以同樣的方式比我。任何人都可以解釋我爲什麼在VS2010中,我可以使用此代碼和在monodevelop 2.4或monodevelop 2.8我不能?