101 lines
5.5 KiB
XML
101 lines
5.5 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"
|
|
xmlns:infrastructure="clr-namespace:PettingZoo.Infrastructure"
|
|
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}">
|
|
<StackPanel Orientation="Horizontal">
|
|
<Image Source="/Images/Connect.png" Width="16" Height="16" Style="{StaticResource ToolbarIcon}"/>
|
|
<TextBlock Margin="3,0,0,0">Connect</TextBlock>
|
|
</StackPanel>
|
|
</Button>
|
|
<Button Command="{Binding DisconnectCommand}">
|
|
<StackPanel Orientation="Horizontal">
|
|
<Image Source="/Images/Disconnect.png" Width="16" Height="16" Style="{StaticResource ToolbarIcon}"/>
|
|
<TextBlock Margin="3,0,0,0">Disconnect</TextBlock>
|
|
</StackPanel>
|
|
</Button>
|
|
<Separator Style="{StaticResource {x:Static ToolBar.SeparatorStyleKey}}" />
|
|
<Button Command="{Binding ClearCommand}">
|
|
<StackPanel Orientation="Horizontal">
|
|
<Image Source="/Images/Disconnect.png" Width="16" Height="16" Style="{StaticResource ToolbarIcon}"/>
|
|
<TextBlock Margin="3,0,0,0">Clear messages</TextBlock>
|
|
</StackPanel>
|
|
</Button>
|
|
</ToolBar>
|
|
<StatusBar DockPanel.Dock="Bottom">
|
|
<StatusBarItem>
|
|
<TextBlock />
|
|
</StatusBarItem>
|
|
</StatusBar>
|
|
<Grid Margin="4">
|
|
<Grid.ColumnDefinitions>
|
|
<ColumnDefinition Width="*" />
|
|
<ColumnDefinition Width="Auto" />
|
|
<ColumnDefinition Width="*" />
|
|
</Grid.ColumnDefinitions>
|
|
<ListBox Grid.Column="0" Grid.Row="0"
|
|
HorizontalAlignment="Stretch"
|
|
ItemsSource="{Binding Messages}"
|
|
SelectedItem="{Binding Path=SelectedMessage, Mode=TwoWay}"
|
|
infrastructure:ListBox.AutoScroll="True">
|
|
<ListBox.ItemTemplate>
|
|
<DataTemplate>
|
|
<Grid>
|
|
<Grid.ColumnDefinitions>
|
|
<ColumnDefinition Width="Auto" MinWidth="150"/>
|
|
<ColumnDefinition Width="*"/>
|
|
</Grid.ColumnDefinitions>
|
|
<TextBlock Grid.Column="0" Grid.Row="0" Text="{Binding Timestamp, StringFormat=g}" Style="{StaticResource Timestamp}"></TextBlock>
|
|
<TextBlock Grid.Column="1" Grid.Row="0" Text="{Binding RoutingKey}" Style="{StaticResource 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>
|