Wpf/SpeedTest/SpeedTestView.xaml

(开头部分) 3KB

这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。

<UserControl x:Class="Geared.Wpf.SpeedTest.SpeedTestView"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
             xmlns:lvc="clr-namespace:LiveCharts.Wpf;assembly=LiveCharts.Wpf"
             xmlns:speedTest="clr-namespace:Geared.Wpf.SpeedTest"
             mc:Ignorable="d" 
             d:DesignHeight="300" d:DesignWidth="300">
    <UserControl.DataContext>
        <speedTest:SpeedTestVm></speedTest:SpeedTestVm>
    </UserControl.DataContext>
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"></RowDefinition>
            <RowDefinition Height="Auto"></RowDefinition>
            <RowDefinition Height="*"></RowDefinition>
        </Grid.RowDefinitions>
        <TextBlock TextWrapping="Wrap">Here we are adding a value every millisecond from 2 different tasks</TextBlock>
        <StackPanel Grid.Row="1" Orientation="Horizontal" Margin="15">
            <Button Command="{Binding ReadCommand}">Start Lecture</Button>
            <Button Command="{Binding StopCommand}">Stop</Button>
            <Button Command="{Binding CleaCommand}">Clear</Button>
            <TextBlock VerticalAlignment="Center" Margin="15 0" Text="{Binding Count, StringFormat=Buffer: {0}}"></TextBlock>
        </StackPanel>
        <lvc:CartesianChart Grid.Row="2" DisableAnimations="True" DataTooltip="{x:Null}" Hoverable="False">
            <lvc:CartesianChart.Resources>
                <Style TargetType="lvc:LineSeries">
                    <Setter Property="StrokeThickness" Value="0"></Setter>
                    <Setter Property="Fill" Value="#CC2196F3"></Setter>
                    <Setter Property="LineSmoothness" Value=".3"></Setter>
                    <Setter Property="AreaLimit" Value="0"></Setter>
                    <Style.Triggers>
                        <DataTrigger Binding="{Binding IsHot}" Value="true">
                            <Setter Property="Fill" Value="#CCFF5722"></Setter>
                        </DataTrigger>
                    </Style.Triggers>
                </Style>
                <Style TargetType="lvc:Separator">
                    <Setter Property="Stroke" Value="#DADADA"></Setter>
                    <Setter Property="StrokeThickness" Value="2"></Setter>
                    <Style.Triggers>
                        <Trigger Property="AxisOrientation" Value="X">
                            <Setter Property="IsEnabled" Value="False"></Setter>
                        </Trigger>
                    </Style.Triggers>
                </Style>
            </lvc:CartesianChart.Resources>
            <lvc:CartesianChart.Series>
                <lvc:LineSeries Values="{Binding Values}" PointGeometry="{x:Null}"></lvc:LineSeries>
            </lvc:CartesianChart.Series>
            <lvc:CartesianChart.AxisX>
                <lvc:Axis MaxValue="20500" ShowLabels="False"></lvc:Axis>
            </lvc:CartesianChart.AxisX>
            <lvc:CartesianChart.AxisY>
                <lvc:Axis>
                    <lvc:Axis.Sections>
                        <lvc:AxisSection Value="0" StrokeThickness="3" Stroke="#303030"></lvc:AxisSection>
                    </lvc:Axis.Sections>
                </lvc:Axis>
后面还有 14 行代码,解锁后查看完整代码

24 小时内免费解锁 3 个项目,之后 1 积分/个。 规则说明

AI 解读

登录后可用,每次 10 积分,解读结果公开显示在下面。

还没有人解读过这个文件。