Advertisement
Guest User

Untitled

a guest
Jul 27th, 2016
51
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.72 KB | None | 0 0
  1. <ScrollViewer >
  2. <StackPanel>
  3. <DockPanel LastChildFill="False">
  4. <TextBox DockPanel.Dock="Left"/>
  5. <Button DockPanel.Dock="Right"
  6. Content="+"/>
  7. </DockPanel>
  8. </StackPanel>
  9. </ScrollViewer>
  10.  
  11. // INotifyPropertyChanged if you need, as well as full-properties with notification
  12. public class Item
  13. {
  14. public string Text {get; set;}
  15. }
  16.  
  17. public ObservableCollection<Item> Items { get; } = new ObservableCollection<Item>();
  18.  
  19. void OnCommandAdd() => Items.Add(new Item());
  20.  
  21. <ListBox ItemsSource="{Binding Items}">
  22. <ListBox.ItemTemplate>
  23. <DataTemplate>
  24. <TextBox Text="{Binding Text}" />
  25. </DataTemplate>
  26. </ListBox.ItemTemplate>
  27. </ListBox>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement