markus / Demo / MainWindow.xaml.cs @ 787a4489
이력 | 보기 | 이력해설 | 다운로드 (1.74 KB)
1 | 787a4489 | KangIngu | using System; |
---|---|---|---|
2 | using System.Collections.Generic; |
||
3 | using System.Collections.ObjectModel; |
||
4 | using System.ComponentModel; |
||
5 | using System.Linq; |
||
6 | using System.Text; |
||
7 | using System.Windows; |
||
8 | using System.Windows.Controls; |
||
9 | using System.Windows.Data; |
||
10 | using System.Windows.Documents; |
||
11 | using System.Windows.Input; |
||
12 | using System.Windows.Media; |
||
13 | using System.Windows.Media.Imaging; |
||
14 | using System.Windows.Navigation; |
||
15 | using System.Windows.Shapes; |
||
16 | |||
17 | namespace Demo |
||
18 | { |
||
19 | /// <summary> |
||
20 | /// Interaction logic for MainWindow.xaml |
||
21 | /// </summary> |
||
22 | public partial class MainWindow : Window, INotifyPropertyChanged |
||
23 | { |
||
24 | public event PropertyChangedEventHandler PropertyChanged; |
||
25 | protected void OnPropertyChanged(string name) { PropertyChangedEventHandler handler = PropertyChanged; if (handler != null) { handler(this, new PropertyChangedEventArgs(name)); } } |
||
26 | |||
27 | private ObservableCollection<TestFile> _items { get; set; } |
||
28 | public ObservableCollection<TestFile> item |
||
29 | { |
||
30 | get |
||
31 | { |
||
32 | return _items; |
||
33 | } |
||
34 | set |
||
35 | { |
||
36 | _items = value; |
||
37 | OnPropertyChanged("item"); |
||
38 | } |
||
39 | } |
||
40 | public MainWindow() |
||
41 | { |
||
42 | InitializeComponent(); |
||
43 | this.Loaded += MainWindow_Loaded; |
||
44 | } |
||
45 | |||
46 | private void MainWindow_Loaded(object sender, RoutedEventArgs e) |
||
47 | { |
||
48 | item = new ObservableCollection<TestFile>(); |
||
49 | for (int i = 1 ; i <= 50; i++) |
||
50 | { |
||
51 | item.Add(new TestFile |
||
52 | { |
||
53 | PageNo = i, |
||
54 | ImageUrl = @"http://www.elonka.com/kryptos/sanborn/KGBCyrillic.jpg" |
||
55 | }); |
||
56 | } |
||
57 | |||
58 | this.DataContext = this; |
||
59 | } |
||
60 | } |
||
61 | } |