Windows Phone ListBox in two columns

Source: Internet
Author: User

To get a ListBox with multiple columns, each unit is an item of ListBox, as shown below:

 

Corresponding XAML:

                     <  Grid  X: Name  = "Loginnosubspanel"  Visibility  = "Visible"  >                          <  ListBox  X: Name  = "Hotkeywordslistbox"  Itemssource  =" {Binding recommendedtopicsleft}  "  >                              <  ListBox. itemspanel  >                                  <  Itemspaneltemplate  >                                      <  Toolkit: wrappanel  Itemheight  = "176"  Itemwidth  = "176"  />                                 </  Itemspaneltemplate  >                              </  ListBox. itemspanel  >                              <  ListBox. itemtemplate  >                                  <  Datatemplate  >                                      <  Grid  Margin  = "20, 0, 0, 20" >                                          <  Grid. rowdefinitions  >                                              <  Rowdefinition  Height  = "Auto"  />                                              <  Rowdefinition  Height  = "*"  />                                          </  Grid. rowdefinitions  >                                         <  Image  Grid. Row  = "0"  Source  ="  {Binding imagesource}  "  Height  = "140"  Width  = "176"  Margin  = "0"  Stretch = "Uniform"  />                                          <  Button  Grid. Row  = "0"  Horizontalalignment  = "Center"  Verticalalignment  = "Center"  Margin  = "0"  Padding  = "0"  Borderthickness = "0"  >                                              <  Button. Content  >                                                  <  Image  Source  = "/Assets/btnicons/unchoose_2.png"  Width  = "36"  Height  = "36"  />                                              </  Button. Content >                                          </  Button  >                                          <  Textblock  Grid. Row  = "1"  Text  ="  {Binding keywords}  "  Fontsize  ="  {Staticresource phonefontsizenormal}  " />                                          <  Rectangle  Grid. rowspan  = "2"  Stroke  = "Gray"  />                                      </  Grid  >                                  </  Datatemplate  >                              </  ListBox. itemtemplate  >                         </  ListBox  >                      </  Grid  > 

Set itemspanel and use Toolkit: wrappanel.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.