22
Jeff Klawiter Principal Software Engineer @jeffklawiter @the_nerdery Windows 8 C#/XAML Tips and Tricks: GridView, ListView SemanticZoom

Windows 8 Design with Gridview

Embed Size (px)

DESCRIPTION

Presented at Twin Cities Code Camp 13, Twin Cities Windows 8 User Group and Chippewa Valley Code camp. Covers all the templates and styles related to the new gridview and listview controls

Citation preview

Page 1: Windows 8 Design with Gridview

Jeff KlawiterPrincipal Software Engineer

@jeffklawiter @the_nerdery

Windows 8 C#/XAML Tips and Tricks:GridView, ListView

SemanticZoom

Page 2: Windows 8 Design with Gridview

Hiring 100 Nerds in 100 Days

Hiring 100 Nerds in 100 Days

http://100nerds.com/143-Jeff-Klawiter

Page 3: Windows 8 Design with Gridview

Windows 8 WorkshopsWindows 8 WorkshopsThe Windows 8 Developer Workshops are designed to help you develop apps and games for Windows 8.

•Windows 8 UX Design•Windows 8 Game Development

Microsoft Store at Mall of America every Monday Night 5pm-8pm

www.msdnevents.com/workshops

Page 4: Windows 8 Design with Gridview

The New ControlsThe New Controls•GridView• Default display items horizontally• Groups

•ListView• Default display items Vertically

•SemanticZoom• Display alternate level of information for gridviews

Page 5: Windows 8 Design with Gridview
Page 6: Windows 8 Design with Gridview
Page 7: Windows 8 Design with Gridview
Page 8: Windows 8 Design with Gridview

Gridview TemplatesGridview Templates

Page 9: Windows 8 Design with Gridview

ItemsPanel

ItemTemplate

ItemContainerStyle

HeaderTemplate

GroupStyle.ContainerStyle

GroupStyle.Header

GroupStyle.Panel

Page 10: Windows 8 Design with Gridview

ItemTemplateItemTemplate• Template for your actual content.• Usually a DataTemplate• Where most {Binding} happens

Page 11: Windows 8 Design with Gridview

ItemContainerStyleItemContainerStyle• Surrounds ItemTemplate• Visual States

• Selected• Focused

Page 12: Windows 8 Design with Gridview

ItemsPanelItemsPanel•Governs how items are laid out • VirtualizingStackPanel• WrapGrid• VariableSizedWrapGrid

Page 13: Windows 8 Design with Gridview

ItemsPanelItemsPanelSurrounds GroupStyle.ContainerStyle

Page 14: Windows 8 Design with Gridview

HeaderTemplateHeaderTemplate•HeaderTemplate• Used for the main header

above the gridview

Page 15: Windows 8 Design with Gridview

GroupStyle.ContainerStyle

GroupStyle.ContainerStyle

• Defines Group Panel and Header layout

Page 16: Windows 8 Design with Gridview

GroupStyle.HeaderTemplate

GroupStyle.HeaderTemplate

Displayed once per GroupStyle.ContainerStyle

Page 17: Windows 8 Design with Gridview

GroupStyle.PanelGroupStyle.Panel• Governs layout of items in group• Non-Virtualizing Panel

• VirtualizingStackPanel• WrapGrid• VariableSizedWrapGrid

Page 18: Windows 8 Design with Gridview

ListViewListView

See GridView

Biggest Difference: Default Control Template

Page 19: Windows 8 Design with Gridview

Semantic ZoomSemantic ZoomZoomedInView• Displays most detailed content

ZoomedOutView• Displays high level information

Each View contains separate content!!

Page 20: Windows 8 Design with Gridview

Semantic Zoom: Scroll Jump

Semantic Zoom: Scroll Jump

•Relies on CollectionViewSource CollectionGroups(this.semanticZoom.ZoomedOutView as ListViewBase).ItemsSource = groupedItemsViewSource.View.CollectionGroups;

•Workaround private void SemanticZoom_ViewChangeCompleted_1(object sender, SemanticZoomViewChangedEventArgs e){

if (!e.IsSourceZoomedInView){

itemGridView.ScrollIntoView(e.SourceItem.Item);}

}

Page 21: Windows 8 Design with Gridview

RecapRecap•GridView• Horizontal Display

•ListView• Vertical Display

•SemanticZoom• Show information at 2 levels

Page 22: Windows 8 Design with Gridview

QUESTIONS?QUESTIONS?MORE ANSWERS ONLINE AT

HTTP://NERDERY.COM