MainWindow.xaml 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. <Window x:Class="Flyinsono.Client.Test.MainWindow"
  2. xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  3. xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  4. xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
  5. xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
  6. xmlns:local="clr-namespace:Flyinsono.Client.Test"
  7. xmlns:extensions="clr-namespace:Flyinsono.Client.Test.Extensions"
  8. mc:Ignorable="d"
  9. Title="MainWindow" Height="450" Width="800">
  10. <Grid>
  11. <Grid.RowDefinitions>
  12. <RowDefinition Height="0.9*"/>
  13. <RowDefinition Height="0.1*"/>
  14. </Grid.RowDefinitions>
  15. <GroupBox Header="Log Info" Margin="7">
  16. <Grid>
  17. <Grid.RowDefinitions>
  18. <RowDefinition Height="Auto"/>
  19. <RowDefinition/>
  20. </Grid.RowDefinitions>
  21. <Button HorizontalAlignment="Right" Margin="0,7" Content="清理日志" Command="{Binding ClearLogCommand}" Style="{StaticResource CommonButtonStyle}"/>
  22. <ListBox Grid.Row="1" Margin="7" x:Name="logList" ItemsSource="{Binding LogItems}" ScrollViewer.HorizontalScrollBarVisibility="Disabled">
  23. <ListBox.ItemTemplate>
  24. <DataTemplate>
  25. <TextBlock Text="{Binding Content}" TextWrapping="Wrap" Foreground="{Binding LogLevel, Converter={extensions:LogLevelToColorConvertExtension}}" />
  26. </DataTemplate>
  27. </ListBox.ItemTemplate>
  28. </ListBox>
  29. </Grid>
  30. </GroupBox>
  31. <Grid Grid.Row="1">
  32. <Grid.RowDefinitions>
  33. <RowDefinition Height="Auto"></RowDefinition>
  34. <RowDefinition Height="Auto"></RowDefinition>
  35. </Grid.RowDefinitions>
  36. <StackPanel Orientation="Horizontal">
  37. <Label VerticalAlignment="Center">Host:</Label>
  38. <TextBox Text="{Binding HostUrl}"></TextBox>
  39. <Label VerticalAlignment="Center">User Count:</Label>
  40. <TextBox Text="{Binding UserCount}"></TextBox>
  41. </StackPanel>
  42. <StackPanel Grid.Row="1" Orientation="Horizontal">
  43. <Label VerticalAlignment="Center">Message:</Label>
  44. <TextBox Text="{Binding Message}" MinWidth="340"></TextBox>
  45. <Button Command="{Binding ConnectCommand}">Run</Button>
  46. <Button Command="{Binding ExitCommand}">Close</Button>
  47. </StackPanel>
  48. </Grid>
  49. </Grid>
  50. </Window>