MainWindow.xaml 1.1 KB

12345678910111213141516171819202122232425
  1. <Window x:Class="ProgressObserver.MainWindow"
  2. xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  3. xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  4. xmlns:converter="clr-namespace:ProgressObserver.Converters"
  5. Title="MainWindow" Height="350" Width="525"
  6. DataContext="{Binding Source={StaticResource Locator}, Path=Main}">
  7. <Window.Resources>
  8. <ResourceDictionary>
  9. <converter:LocalTimeConverter x:Key="localTime" />
  10. </ResourceDictionary>
  11. </Window.Resources>
  12. <Grid>
  13. <ItemsControl ItemsSource="{Binding Messages}">
  14. <ItemsControl.ItemTemplate>
  15. <DataTemplate>
  16. <StackPanel Orientation="Horizontal">
  17. <TextBlock Text="{Binding Recieved, Converter={StaticResource localTime}}" />
  18. <TextBlock Text=":" />
  19. <TextBlock Text="{Binding Message}" />
  20. </StackPanel>
  21. </DataTemplate>
  22. </ItemsControl.ItemTemplate>
  23. </ItemsControl>
  24. </Grid>
  25. </Window>