Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <ScrollViewer >
- <StackPanel>
- <DockPanel LastChildFill="False">
- <TextBox DockPanel.Dock="Left"/>
- <Button DockPanel.Dock="Right"
- Content="+"/>
- </DockPanel>
- </StackPanel>
- </ScrollViewer>
- // INotifyPropertyChanged if you need, as well as full-properties with notification
- public class Item
- {
- public string Text {get; set;}
- }
- public ObservableCollection<Item> Items { get; } = new ObservableCollection<Item>();
- void OnCommandAdd() => Items.Add(new Item());
- <ListBox ItemsSource="{Binding Items}">
- <ListBox.ItemTemplate>
- <DataTemplate>
- <TextBox Text="{Binding Text}" />
- </DataTemplate>
- </ListBox.ItemTemplate>
- </ListBox>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement