【问题标题】:“Is not recognized or is not accessible” error, when creating a Table创建表时出现“无法识别或无法访问”错误
【发布时间】: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


【解决方案1】:

Zimas 您所关注的链接主要用于 wpf 和 silverlight 应用程序,但您正在尝试将其用于 wp,这很好,但可能存在一个问题,即 Windows Phone 可能不支持此链接中使用的某些内容,因此请检查出那个。而且如果想在 windows phone 中做这样的事情,从头开始。不要直接复制代码..希望这对你有帮助..

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2016-03-07
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多