【发布时间】:2013-07-18 12:14:23
【问题描述】:
我一直在尝试做与示例中相同的表格,但在 windows phone 中: http://www.scottlogic.com/blog/2010/11/15/using-a-grid-as-the-panel-for-an-itemscontrol.html
我已经下载了项目并且我已经复制了每个类: -GridItemsControl -GridUtils -幻影面板 在此之后,我已将此类的命名空间更改为“project.Tables”
比我在 xaml 页面中声明的要多 xmlns:table="clr-namespace:project.Tables"
完成此操作后一切都很好,除了带有线条的部分:
错误是:“无法识别或无法访问”你知道这个问题的解决方法吗?
这是来自 xaml 页面的示例代码:
<ScrollViewer VerticalScrollBarVisibility="Auto">
<ItemsControl table:GridUtils.ItemsSource="{Binding}"
VerticalAlignment="Top">
<ItemsControl.ItemsPanel>
<ItemsPanelTemplate>
<Grid table:GridUtils.ItemsPerRow="3">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="2*"/>
<ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions>
</Grid>
</ItemsPanelTemplate>
</ItemsControl.ItemsPanel>
<ItemsControl.ItemTemplate>
<DataTemplate>
<table:PhantomPanel>
<TextBlock Text="{Binding Path=Item}"/>
<TextBlock Text="{Binding Path=Quantity}" Grid.Column="1"/>
<Line Stroke="LightGray" StrokeThickness="1"
VerticalAlignment="Bottom"
X1="0" X2="1" Y1="0" Y2="0"
Stretch="Fill"
Grid.ColumnSpan="2"/>
</table:PhantomPanel>
</DataTemplate>
</ItemsControl.ItemTemplate>
</ItemsControl>
</ScrollViewer>
【问题讨论】:
-
您在哪个 xaml 行遇到此问题..
-
标签: silverlight windows-phone-7 xaml namespaces