LogView.xaml 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. <UserControl x:Class="PLCTool.Views.MonitorManageView.LogView"
  2. xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  3. xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  4. xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
  5. xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
  6. xmlns:local="clr-namespace:PLCTool.Views.MonitorManageView"
  7. xmlns:nlog ="clr-namespace:NlogViewer;assembly=NlogViewer"
  8. xmlns:b="http://schemas.microsoft.com/xaml/behaviors"
  9. mc:Ignorable="d"
  10. d:DesignHeight="450" d:DesignWidth="800">
  11. <!--<UserControl.Resources>
  12. <Style TargetType="nlog:NlogViewer">
  13. </Style>
  14. </UserControl.Resources>-->
  15. <Grid>
  16. <b:Interaction.Triggers>
  17. <b:EventTrigger EventName="Loaded">
  18. <b:InvokeCommandAction Command="{Binding OnLoadCommand}"/>
  19. </b:EventTrigger>
  20. </b:Interaction.Triggers>
  21. <Grid.RowDefinitions>
  22. <RowDefinition Height="50"/>
  23. <RowDefinition Height="40"/>
  24. <RowDefinition/>
  25. </Grid.RowDefinitions>
  26. <StackPanel Grid.Row="0" Orientation="Horizontal">
  27. <Button Content="开始监控" Margin="5,0" Command="{Binding StartCommand}" Style="{StaticResource NormalButtonStyle}" IsChecked="True"/>
  28. <Button Content="停止监控" Margin="5,0" Command="{Binding StopCommand}" Style="{StaticResource NormalButtonStyle}" />
  29. <Button Content="清理Log" Margin="5,0" Command="{Binding CleanCommand}" Style="{StaticResource NormalButtonStyle}" />
  30. </StackPanel>
  31. <TextBlock Grid.Row="1" Text="实时运行日志 :" Style="{StaticResource NormalTextBlockStyle}" FontSize="15" Margin="5,0"/>
  32. <Grid Grid.Row="2">
  33. <ListBox ItemsSource="{Binding LogMessages}">
  34. <ListBox.ItemTemplate>
  35. <DataTemplate>
  36. <StackPanel>
  37. <TextBlock Text="{Binding}" />
  38. </StackPanel>
  39. </DataTemplate>
  40. </ListBox.ItemTemplate>
  41. </ListBox>
  42. </Grid>
  43. </Grid>
  44. </UserControl>