TerminalDialog.xaml 3.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. <Window x:Class="Aitex.Core.UI.Dialog.TerminalDialog"
  2. xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  3. xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  4. xmlns:style="clr-namespace:MECF.Framework.UI.Core.Style"
  5. BorderThickness="0"
  6. Title="Terminal Message" Height="370" Width="500" ShowInTaskbar="True" Topmost="True"
  7. WindowStartupLocation="CenterOwner" WindowStyle="SingleBorderWindow" ResizeMode="NoResize" FontFamily="Arial,SimSun"
  8. Background="{StaticResource viewBackgroundColor}">
  9. <Window.Resources>
  10. <Style TargetType="{x:Type ListViewItem}">
  11. <Style.Triggers>
  12. <DataTrigger Binding="{Binding MessageSource}" Value="E">
  13. <Setter Property="Foreground" Value="Blue" />
  14. <Setter Property="FontSize" Value="Blue" />
  15. </DataTrigger>
  16. <DataTrigger Binding="{Binding HasErrors}" Value="False">
  17. <Setter Property="Background" Value="Green" />
  18. </DataTrigger>
  19. </Style.Triggers>
  20. </Style>
  21. </Window.Resources>
  22. <Grid>
  23. <Grid.RowDefinitions>
  24. <RowDefinition Height="250" />
  25. <RowDefinition Height="70" />
  26. <RowDefinition />
  27. </Grid.RowDefinitions>
  28. <StackPanel Grid.Row="0" Orientation="Horizontal">
  29. <ItemsControl Width="380" Margin="10" Background="#FFDCF7F6" ItemsSource="{Binding TerminalMessageList}" Name="itemsControl">
  30. <ItemsControl.Template>
  31. <ControlTemplate TargetType="{x:Type ItemsControl}">
  32. <Border CornerRadius="5">
  33. <ScrollViewer VerticalScrollBarVisibility="Auto" >
  34. <ItemsPresenter />
  35. </ScrollViewer>
  36. </Border>
  37. </ControlTemplate>
  38. </ItemsControl.Template>
  39. <ItemsControl.ItemsPanel>
  40. <ItemsPanelTemplate>
  41. <StackPanel Orientation="Vertical" Name="wp" Margin="0" Background="#FFDCF7F6"/>
  42. </ItemsPanelTemplate>
  43. </ItemsControl.ItemsPanel>
  44. <ItemsControl.ItemTemplate>
  45. <DataTemplate>
  46. <StackPanel >
  47. <TextBox Text="{Binding Title, Mode=OneWay }" Margin="0" IsReadOnly="True" IsEnabled="False" TextWrapping="Wrap" FontSize="12"/>
  48. <TextBox Text="{Binding Content, Mode=OneWay }" Margin="0" IsReadOnly="True" IsEnabled="False" TextWrapping="Wrap" FontSize="12"/>
  49. </StackPanel>
  50. </DataTemplate>
  51. </ItemsControl.ItemTemplate>
  52. </ItemsControl>
  53. <Button Width="80" Height="50" Margin="0" Content="Clear" VerticalAlignment="Top" HorizontalAlignment="Left" Command="{Binding TerminalClearCommand}"></Button>
  54. </StackPanel>
  55. <StackPanel Grid.Row="1" Orientation="Horizontal">
  56. <TextBox Text="{Binding TerminalMessageSetPoint}" Width="380" Height="60" Margin="10,0,10,0" AcceptsReturn="True"></TextBox>
  57. <Button Width="80" Height="50" Margin="0" Content="Send" VerticalAlignment="Center" HorizontalAlignment="Left" Command="{Binding TerminalSendCommand}"></Button>
  58. </StackPanel>
  59. </Grid>
  60. </Window>