Guest User

Untitled

a guest
Nov 18th, 2017
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.79 KB | None | 0 0
  1. // This will hold the urls
  2. private ObservableCollection<string> urls = new ObservableCollection<string>();
  3.  
  4. private void Grid_Loaded(object sender, RoutedEventArgs e)
  5. {
  6. // Bind to our collection
  7. dataGrid.ItemsSource = urls;
  8. }
  9.  
  10. private void button_Click(object sender, RoutedEventArgs e)
  11. {
  12. // Parse the url from our text and add it to our collection
  13. urls.Add(GetUrlFromText(textBox.Text));
  14. }
  15.  
  16. <DataGrid x:Name="dataGrid" HorizontalAlignment="Left" Margin="64,69,0,0"
  17. VerticalAlignment="Top" Height="152" Width="257"
  18. ItemsSource="{Binding}" AutoGenerateColumns="False">
  19. <DataGrid.Columns>
  20. <DataGridTextColumn x:Name="Urls" Header="Urls" Binding="{Binding Path=.}" />
  21. </DataGrid.Columns>
  22. </DataGrid>
Add Comment
Please, Sign In to add comment