liv2hak liv2hak - 29 days ago 15
C# Question

Porting UI from Windows XAML to Xamarin.Forms XAML

I have a XAML file that I have developed for Windows Universal app.

<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"/>


When I port this into
Xamarin.Forms
(I am using Xamarin plugin on VS2015)
I get the following error.

Error CS0246 The type or namespace name 'ItemsControl' could not be found

Is there something that corresponds to
ItemsControl
in the same way as
Label
corresponds to
TextBlock

Answer

ListView is probably the closest control to ItemsControl.