mirror of
https://github.com/OpenLogics/MewtocolNet.git
synced 2025-12-06 03:01:24 +00:00
Fix multiple poller situational problems
This commit is contained in:
162
Examples.WPF/MainWindow.xaml
Normal file
162
Examples.WPF/MainWindow.xaml
Normal file
@@ -0,0 +1,162 @@
|
||||
<Window x:Class="Examples.WPF.MainWindow"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:local="clr-namespace:Examples.WPF"
|
||||
d:DataContext="{d:DesignInstance local:MainWindow, IsDesignTimeCreatable=True}"
|
||||
mc:Ignorable="d"
|
||||
MinWidth="500"
|
||||
MinHeight="400"
|
||||
Height="600"
|
||||
Width="800"
|
||||
Title="MewtocolNet WPF Demo">
|
||||
<Grid>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition/>
|
||||
<RowDefinition Height="auto"/>
|
||||
<RowDefinition MinHeight="30" Height="150"/>
|
||||
</Grid.RowDefinitions>
|
||||
<ContentControl x:Name="mainContent"/>
|
||||
<GridSplitter Grid.Row="1"
|
||||
HorizontalAlignment="Stretch"
|
||||
Background="Gray"
|
||||
ShowsPreview="true"
|
||||
Height="5">
|
||||
<GridSplitter.Template>
|
||||
<ControlTemplate>
|
||||
<Separator/>
|
||||
</ControlTemplate>
|
||||
</GridSplitter.Template>
|
||||
</GridSplitter>
|
||||
<Grid Grid.Row="2">
|
||||
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="auto"/>
|
||||
<RowDefinition/>
|
||||
<RowDefinition Height="20"/>
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<Border Background="LightGray"/>
|
||||
|
||||
<StackPanel HorizontalAlignment="Left"
|
||||
Orientation="Horizontal">
|
||||
|
||||
<TextBlock Text="Logger"
|
||||
Margin="5"/>
|
||||
|
||||
<Border Width="1"
|
||||
Margin="5"
|
||||
Background="Gray"/>
|
||||
|
||||
<StackPanel Orientation="Horizontal">
|
||||
|
||||
<TextBlock Text="Rx"
|
||||
Margin="5"/>
|
||||
|
||||
<Ellipse IsEnabled="{Binding AppViewModel.Plc.IsReceiving, Mode=OneWay}"
|
||||
Fill="Lime"
|
||||
Width="10"
|
||||
Height="10">
|
||||
<Ellipse.Style>
|
||||
<Style TargetType="Ellipse">
|
||||
<Style.Triggers>
|
||||
<Trigger Property="IsEnabled" Value="False">
|
||||
<Setter Property="Opacity" Value=".1"/>
|
||||
</Trigger>
|
||||
</Style.Triggers>
|
||||
</Style>
|
||||
</Ellipse.Style>
|
||||
</Ellipse>
|
||||
|
||||
<TextBlock Text="Tx"
|
||||
Margin="5"/>
|
||||
|
||||
<Ellipse Fill="Orange"
|
||||
IsEnabled="{Binding AppViewModel.Plc.IsSending, Mode=OneWay}"
|
||||
Width="10"
|
||||
Height="10">
|
||||
<Ellipse.Style>
|
||||
<Style TargetType="Ellipse">
|
||||
<Style.Triggers>
|
||||
<Trigger Property="IsEnabled" Value="False">
|
||||
<Setter Property="Opacity" Value=".1"/>
|
||||
</Trigger>
|
||||
</Style.Triggers>
|
||||
</Style>
|
||||
</Ellipse.Style>
|
||||
</Ellipse>
|
||||
|
||||
<Border Width="1"
|
||||
Margin="5"
|
||||
Background="Gray"/>
|
||||
|
||||
<TextBlock Text="{Binding AppViewModel.Plc.BytesPerSecondDownstream, Mode=OneWay}"
|
||||
VerticalAlignment="Center"/>
|
||||
|
||||
<Border Width="1"
|
||||
Margin="5"
|
||||
Background="Gray"/>
|
||||
|
||||
<TextBlock Text="{Binding AppViewModel.Plc.BytesPerSecondUpstream, Mode=OneWay}"
|
||||
VerticalAlignment="Center"/>
|
||||
|
||||
<StackPanel.Style>
|
||||
<Style TargetType="StackPanel">
|
||||
<Style.Triggers>
|
||||
<DataTrigger Binding="{Binding AppViewModel.PlcIsNull}" Value="True">
|
||||
<Setter Property="Visibility" Value="Collapsed"/>
|
||||
</DataTrigger>
|
||||
</Style.Triggers>
|
||||
</Style>
|
||||
</StackPanel.Style>
|
||||
|
||||
</StackPanel>
|
||||
|
||||
</StackPanel>
|
||||
|
||||
<StackPanel Orientation="Horizontal"
|
||||
HorizontalAlignment="Right">
|
||||
|
||||
<Button Content="Expand"
|
||||
Margin="2"/>
|
||||
|
||||
<ToggleButton Content="Autoscroll"
|
||||
IsChecked="True"
|
||||
Margin="2"
|
||||
x:Name="autoScrollBtn"/>
|
||||
|
||||
</StackPanel>
|
||||
|
||||
<ListBox Grid.Row="1"
|
||||
Background="Black"
|
||||
Foreground="White"
|
||||
BorderThickness="0"
|
||||
VirtualizingPanel.IsVirtualizing="true"
|
||||
VirtualizingPanel.VirtualizationMode="Recycling"
|
||||
ScrollViewer.HorizontalScrollBarVisibility="Disabled"
|
||||
ScrollViewer.VerticalScrollBarVisibility="Disabled"
|
||||
ItemsSource="{Binding LoggerItems, Mode=OneWay}"
|
||||
x:Name="loggerList">
|
||||
<ItemsControl.ItemsPanel>
|
||||
<ItemsPanelTemplate>
|
||||
<StackPanel Orientation="Vertical"/>
|
||||
</ItemsPanelTemplate>
|
||||
</ItemsControl.ItemsPanel>
|
||||
<ItemsControl.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<ContentPresenter Content="{Binding}"/>
|
||||
</DataTemplate>
|
||||
</ItemsControl.ItemTemplate>
|
||||
</ListBox>
|
||||
|
||||
<Border Background="Black"
|
||||
Grid.Row="2">
|
||||
<TextBlock Text=">"
|
||||
Foreground="White"
|
||||
Margin="5,0,0,0"/>
|
||||
</Border>
|
||||
|
||||
</Grid>
|
||||
</Grid>
|
||||
</Window>
|
||||
Reference in New Issue
Block a user