79 lines
4.1 KiB
XML
79 lines
4.1 KiB
XML
<Window x:Class="PettingZoo.View.MainWindow"
|
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
|
xmlns:res="clr-namespace:PettingZoo.Properties"
|
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
|
xmlns:viewModel="clr-namespace:PettingZoo.ViewModel"
|
|
mc:Ignorable="d"
|
|
d:DataContext="{d:DesignInstance viewModel:MainViewModel}"
|
|
Width="800"
|
|
Height="600"
|
|
ResizeMode="CanResizeWithGrip"
|
|
Style="{StaticResource WindowStyle}"
|
|
Title="{x:Static res:Resources.MainWindowTitle}">
|
|
<DockPanel>
|
|
<ToolBar DockPanel.Dock="Top" ToolBarTray.IsLocked="True">
|
|
<Button Command="{Binding ConnectCommand}" Content="Connect"></Button>
|
|
<Button Command="{Binding DisconnectCommand}" Content="Disconnect"></Button>
|
|
<Separator Style="{StaticResource {x:Static ToolBar.SeparatorStyleKey}}" />
|
|
<Button Command="{Binding ClearCommand}" Content="Clear messages"></Button>
|
|
</ToolBar>
|
|
<StatusBar DockPanel.Dock="Bottom">
|
|
<StatusBarItem>
|
|
<TextBlock />
|
|
</StatusBarItem>
|
|
</StatusBar>
|
|
<Grid Margin="4">
|
|
<Grid.ColumnDefinitions>
|
|
<ColumnDefinition Width="*" />
|
|
<ColumnDefinition Width="Auto" />
|
|
<ColumnDefinition Width="300" />
|
|
</Grid.ColumnDefinitions>
|
|
<ListBox Grid.Column="0" Grid.Row="0"
|
|
HorizontalAlignment="Stretch"
|
|
ItemsSource="{Binding Messages}"
|
|
SelectedItem="{Binding Path=SelectedMessage, Mode=TwoWay}">
|
|
<ListBox.ItemTemplate>
|
|
<DataTemplate>
|
|
<Grid>
|
|
<TextBlock Text="{Binding RoutingKey}"></TextBlock>
|
|
</Grid>
|
|
</DataTemplate>
|
|
</ListBox.ItemTemplate>
|
|
</ListBox>
|
|
<GridSplitter Width="5" Grid.Column="1" Grid.Row="0" HorizontalAlignment="Stretch"/>
|
|
<Grid Grid.Column="2" Grid.Row="0">
|
|
<Grid.RowDefinitions>
|
|
<RowDefinition Height="*"/>
|
|
<RowDefinition Height="Auto"/>
|
|
<RowDefinition Height="200"/>
|
|
</Grid.RowDefinitions>
|
|
<Border Grid.Column="0" Grid.Row="0" Style="{StaticResource SidePanel}">
|
|
<DockPanel>
|
|
<Label DockPanel.Dock="Top" Style="{StaticResource HeaderLabel}" Content="{x:Static res:Resources.PanelTitleBody}"/>
|
|
<TextBox
|
|
Text="{Binding SelectedMessageBody, Mode=OneWay}"
|
|
BorderThickness="0"
|
|
IsReadOnly="True"
|
|
HorizontalScrollBarVisibility="Auto"
|
|
VerticalScrollBarVisibility="Auto"/>
|
|
</DockPanel>
|
|
</Border>
|
|
<GridSplitter HorizontalAlignment="Stretch" Grid.Column="0" Grid.Row="1" Height="5" ResizeDirection="Rows"/>
|
|
<Border Grid.Column="0" Grid.Row="2" Style="{StaticResource SidePanel}">
|
|
<DockPanel>
|
|
<Label DockPanel.Dock="Top" Style="{StaticResource HeaderLabel}" Content="{x:Static res:Resources.PanelTitleProperties}"/>
|
|
<DataGrid ItemsSource="{Binding SelectedMessageProperties}" AutoGenerateColumns="False" IsReadOnly="True" Style="{StaticResource Properties}">
|
|
<DataGrid.Columns>
|
|
<DataGridTextColumn Binding="{Binding Key}" Header="{x:Static res:Resources.PropertyName}" Width="100"/>
|
|
<DataGridTextColumn Binding="{Binding Value}" Header="{x:Static res:Resources.PropertyValue}" Width="*"/>
|
|
</DataGrid.Columns>
|
|
</DataGrid>
|
|
</DockPanel>
|
|
</Border>
|
|
</Grid>
|
|
</Grid>
|
|
</DockPanel>
|
|
</Window>
|