Answered by:
Custom GridView-like control - Templated control or User control?

Question
-
Hi,
I am new in creating templated controls / user controls in XAML. I would like to create a control that looks like the picture below. I am confused if whether this is a user control or a templated control.
Basically, the control has an image and a text. The tile with "MORE" and an arrow is a button. I need your advise on how to create this and if this is possible. The images and texts will come from a single datasource. Thanks!
Sunday, September 15, 2013 7:19 AM
Answers
-
its a variablesizegridview. see: http://stackoverflow.com/questions/9790657/how-to-make-variablesized-gridview-item
Microsoft Certified Solutions Developer - Windows Store Apps Using C#
- Proposed as answer by Jamles HezModerator Monday, September 16, 2013 9:36 AM
- Marked as answer by Paulo R. Flores Tuesday, September 17, 2013 10:12 PM
Sunday, September 15, 2013 6:11 PM -
Using a button as the last item is unrelated to the layout. To do this you can use a DataTemplateSelector to swich your item to the button template instead of the image template. The All-In-One Code Framework sample How to disable specified items selection in Listview/Gridview demonstrates the basics of how to use a DataTemplateSelector (you'll have to update the logic to switch the last item added to the group).
--Rob
- Marked as answer by Paulo R. Flores Tuesday, September 17, 2013 10:12 PM
Tuesday, September 17, 2013 9:40 PMModerator
All replies
-
its a variablesizegridview. see: http://stackoverflow.com/questions/9790657/how-to-make-variablesized-gridview-item
Microsoft Certified Solutions Developer - Windows Store Apps Using C#
- Proposed as answer by Jamles HezModerator Monday, September 16, 2013 9:36 AM
- Marked as answer by Paulo R. Flores Tuesday, September 17, 2013 10:12 PM
Sunday, September 15, 2013 6:11 PM -
Thank you! However, if I use that, will I still be able to add button as always the last item in the GridView?Tuesday, September 17, 2013 9:29 PM
-
Using a button as the last item is unrelated to the layout. To do this you can use a DataTemplateSelector to swich your item to the button template instead of the image template. The All-In-One Code Framework sample How to disable specified items selection in Listview/Gridview demonstrates the basics of how to use a DataTemplateSelector (you'll have to update the logic to switch the last item added to the group).
--Rob
- Marked as answer by Paulo R. Flores Tuesday, September 17, 2013 10:12 PM
Tuesday, September 17, 2013 9:40 PMModerator -
Thank you Rob! :)Tuesday, September 17, 2013 10:13 PM