Created
October 30, 2012 08:45
-
-
Save kw0006667/3979058 to your computer and use it in GitHub Desktop.
定義 資料結構,並加到 myListViewItem 的 DataSrouce 中
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Generic; | |
using System.IO; | |
using System.Linq; | |
using Windows.Foundation; | |
using Windows.Foundation.Collections; | |
using Windows.UI.Xaml; | |
using Windows.UI.Xaml.Controls; | |
using Windows.UI.Xaml.Controls.Primitives; | |
using Windows.UI.Xaml.Data; | |
using Windows.UI.Xaml.Input; | |
using Windows.UI.Xaml.Media; | |
using Windows.UI.Xaml.Navigation; | |
// 空白頁項目範本已記錄在 http://go.microsoft.com/fwlink/?LinkId=234238 | |
namespace DataSource | |
{ | |
/// <summary> | |
/// 可以在本身使用或巡覽至框架內的空白頁面。 | |
/// </summary> | |
public sealed partial class MainPage : Page | |
{ | |
private List<Data> myDatas; | |
public MainPage() | |
{ | |
this.InitializeComponent(); | |
this.myDatas = new List<Data>() { new Data("Tim", "NTUE-Game", "Assets/Icon.png"), new Data("Huadi", "Toy", "Assets/Icon.png") }; | |
this.MyListViewitems.ItemsSource = this.myDatas; | |
} | |
} | |
public class Data | |
{ | |
public Data(string title, string subtitle, string imgPath) | |
{ | |
this.Title = title; | |
this.Subtitle = subtitle; | |
this.Image = imgPath; | |
} | |
public string Title { get; set; } | |
public string Subtitle { get; set; } | |
public string Image { get; set; } | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment