【问题标题】:Porting UI from Windows XAML to Xamarin.Forms XAML将 UI 从 Windows XAML 移植到 Xamarin.Forms XAML
【发布时间】:2016-11-09 23:39:46
【问题描述】:

我有一个为 Windows 通用应用程序开发的 XAML 文件。

  <ItemsControl x:Name="parentItemsControl" ItemsSource="{Binding Parents}"
            ItemTemplate="{DynamicResource ParentsDataTemplate}" ItemsPanel="{DynamicResource ItemsPanelTemplate1}" DockPanel.Dock="Top" VerticalAlignment="Center"/>
        <Label x:Name="textBlock2" TextWrapping="Wrap" Text="{Binding Text}" IsEnabled="False" FontWeight="Bold" FontSize="18" DockPanel.Dock="Top" Height="30" Foreground="#FFFFFFFF"/>

当我将它移植到 Xamarin.Forms 时(我在 VS2015 上使用 Xamarin 插件) 我收到以下错误。

错误 CS0246 找不到类型或命名空间名称“ItemsControl”

有没有对应ItemsControl的东西,就像Label对应TextBlock一样

【问题讨论】:

    标签: c# windows xaml xamarin.forms


    【解决方案1】:

    ListView 可能是最接近 ItemsControl 的控件。

    【讨论】:

    • ItemsViewItemsControl 一样吗?
    猜你喜欢
    • 2014-03-14
    • 1970-01-01
    • 1970-01-01
    • 2014-11-12
    • 1970-01-01
    • 1970-01-01
    • 2017-01-11
    • 1970-01-01
    • 2017-11-08
    相关资源
    最近更新 更多