<DockPanel Height="280"> <Border CornerRadius="6" BorderBrush="Gray" removed="LightGray" BorderThickness="2" > <ScrollViewer VerticalScrollBarVisibility="Auto"> <ItemsControl Height="400" Name="icTodoList" ItemsSource="{Binding Items}"> <ItemsControl.ItemTemplate> <DataTemplate> <Grid Name="ToDoList"> <Grid.RowDefinitions> <RowDefinition Height="*"/> <RowDefinition Height="*"/> <RowDefinition Height="*"/> <RowDefinition Height="*"/> </Grid.RowDefinitions> <TextBlock Text="{Binding StartTime, FallbackValue=' '}" Grid.Row="0"/> <TextBlock Text="{Binding ConnectedTime, FallbackValue=' '}" Grid.Row="1"/> <TextBlock Text="{Binding DisconnectedTime, FallbackValue=' '}" Grid.Row="2"/> <TextBlock Text="{Binding DialingResult, FallbackValue=' '}" Grid.Row="3"/> </Grid> </DataTemplate> </ItemsControl.ItemTemplate> </ItemsControl> </ScrollViewer> </Border> </DockPanel>
public ObservableCollection<Calls> items = new ObservableCollection<Calls>(); public ObservableCollection<Calls> Items { get { return items; } set { items = value; RaisePropertyChanged(); } }
MainViewModel _dataContext; Calls c = new Calls(); // blah blah Dispatcher.BeginInvoke((Action)delegate() { if (c != null) _dataContext.Items.Add(c); });
_dataContext.Items.Clear();
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)