Changeset 7059 for 2015/koodauskerho
- Timestamp:
- 2015-10-14 22:37:42 (7 years ago)
- Location:
- 2015/koodauskerho/otjojunt/WpfHarjoitus1/WpfHarjoitus1
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
2015/koodauskerho/otjojunt/WpfHarjoitus1/WpfHarjoitus1/MainWindow.xaml
r7058 r7059 9 9 Title="Leikepöytä" Height="350" Width="525"> 10 10 <Grid> 11 <ListBox x:Name="listBox" Margin="5" SelectionChanged="listBox_SelectionChanged" >11 <ListBox x:Name="listBox" Margin="5" SelectionChanged="listBox_SelectionChanged" ItemsSource="{Binding listBoxItems}" > 12 12 </ListBox> 13 13 -
2015/koodauskerho/otjojunt/WpfHarjoitus1/WpfHarjoitus1/MainWindow.xaml.cs
r7058 r7059 1 1 using System; 2 2 using System.Collections.Generic; 3 using System.Collections.ObjectModel; 3 4 using System.Linq; 4 5 using System.Text; … … 22 23 public partial class MainWindow : Window 23 24 { 25 public ObservableCollection<string> listBoxItems { get; private set; } 26 24 27 public MainWindow() 25 28 { 26 29 InitializeComponent(); 30 listBoxItems = new ObservableCollection<string>(); 31 DataContext = this; 27 32 ClipboardListener.ClipboardUpdate += LisaaListaan; 28 33 } … … 30 35 private void LisaaListaan(string contents) 31 36 { 32 listBox .Items.Add(contents);37 listBoxItems.Add(contents); 33 38 } 34 39
Note: See TracChangeset
for help on using the changeset viewer.