MainWindow.xaml 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. <Window x:Class="VRTC.WpfClient.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:VRTC.WpfClient"
  7. xmlns:extensions="clr-namespace:VRTC.WpfClient.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. <Grid.ColumnDefinitions>
  16. <ColumnDefinition Width="*"></ColumnDefinition>
  17. <ColumnDefinition Width="Auto"/>
  18. </Grid.ColumnDefinitions>
  19. <GroupBox Header="Log Info" Margin="7">
  20. <Grid>
  21. <Grid.RowDefinitions>
  22. <RowDefinition Height="Auto"/>
  23. <RowDefinition/>
  24. </Grid.RowDefinitions>
  25. <Button HorizontalAlignment="Right" Margin="0,7" Content="清理日志" Command="{Binding ClearLogCommand}" Style="{StaticResource CommonButtonStyle}"/>
  26. <ListBox Grid.Row="1" Margin="7" x:Name="logList" ItemsSource="{Binding LogItems}" ScrollViewer.HorizontalScrollBarVisibility="Disabled">
  27. <ListBox.ItemTemplate>
  28. <DataTemplate>
  29. <TextBlock Text="{Binding Content}" TextWrapping="Wrap" Foreground="{Binding LogLevel, Converter={extensions:LogLevelToColorConvertExtension}}" />
  30. </DataTemplate>
  31. </ListBox.ItemTemplate>
  32. </ListBox>
  33. </Grid>
  34. </GroupBox>
  35. <Grid Grid.Row="1" Grid.RowSpan="2">
  36. <Grid.RowDefinitions>
  37. <RowDefinition Height="Auto"></RowDefinition>
  38. <RowDefinition Height="Auto"></RowDefinition>
  39. <RowDefinition Height="*"></RowDefinition>
  40. </Grid.RowDefinitions>
  41. <StackPanel Orientation="Horizontal">
  42. <Label VerticalAlignment="Center">Host:</Label>
  43. <TextBox Text="{Binding HostUrl}"></TextBox>
  44. <Label VerticalAlignment="Center">Room ID:</Label>
  45. <TextBox Text="{Binding RoomId}"></TextBox>
  46. <Label VerticalAlignment="Center">Client ID:</Label>
  47. <TextBox Text="{Binding UserId}"></TextBox>
  48. <Label VerticalAlignment="Center">Device:</Label>
  49. <ComboBox Width="200" VerticalAlignment="Center" ItemsSource="{Binding VideoDevices}" SelectedItem="{Binding DefaultVideoDevice}"></ComboBox>
  50. <CheckBox Margin="7,0" VerticalAlignment="Center" IsChecked="{Binding AudioEnabled}">Audio Enabled</CheckBox>
  51. <Button Command="{Binding ConnectCommand}">Connect</Button>
  52. <Button Command="{Binding ExitCommand}">Close</Button>
  53. </StackPanel>
  54. <StackPanel Grid.Row="1" Orientation="Horizontal">
  55. </StackPanel>
  56. </Grid>
  57. <StackPanel Grid.Column="1" Grid.RowSpan="2">
  58. <local:VideoView DataContext="{Binding LocalVideo}"/>
  59. <ItemsControl ItemsSource="{Binding RemoteVideos}">
  60. <ItemsControl.ItemsPanel>
  61. <ItemsPanelTemplate>
  62. <StackPanel/>
  63. </ItemsPanelTemplate>
  64. </ItemsControl.ItemsPanel>
  65. <ItemsControl.ItemTemplate>
  66. <DataTemplate>
  67. <local:VideoView/>
  68. </DataTemplate>
  69. </ItemsControl.ItemTemplate>
  70. </ItemsControl>
  71. </StackPanel>
  72. </Grid>
  73. </Window>