Wednesday, February 07, 2018

Universal Windows Platform: ListView and SelectionChanged event - Part1

In my previous post you learnt about ListView and ListBox controls used in XAML.

In this post you will learn to:

Part 1
  • Progressively build a ListView Control 
  • Place ListViewItems inside a ListView's ItemTemplate
  • You will place three named ListView items

Part 2
  • You will write code to change the properties of items you placed.
At first, you launch Visual Studio 2017 Community and create a blank Universal Windows Platform project using C# and provide the name to the project (Project JListView).


Here you choose the target and min versions of Windows 10


Add a ListView as shown between the 'Grid' as shown using intellisense.


An empty ListView control is added to the XAML with some default border over the Desktop as shown.


Now we place an ItemTemplate of the ListView by choosing from a drop-down list.


Visual Studio is not happy as this template cannot be empty. We will add a DataTemplate inside the ItemTemplate, again using intellisense.


Choose to place a DataTemplate.


DataTemplate is placed and there is no red wiggly line for ItemTemplate like before. 


Now we place a Grid, layout element, again using intellisense.


No comments: Protection Status