我一直在試圖做同樣的表像的例子,但在Windows Phone時: http://www.scottlogic.com/blog/2010/11/15/using-a-grid-as-the-panel-for-an-itemscontrol.html「無法識別或無法訪問」錯誤,創建一個表
我已經下載了該項目,我已複製每一個類: -GridItemsControl -GridUtils -PhantomPanel 這之後我已經改變了這一類的命名空間的「project.Tables」
比我在XAML頁面 的xmlns宣佈:表=」 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行得到這個概率。 – loop