Wpf/Scrollable/ScrollableView.xaml

(开头部分) 4KB

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

<UserControl x:Class="Geared.Wpf.Scrollable.ScrollableView"
        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:controls="http://metro.mahapps.com/winfx/xaml/controls"
        xmlns:lvc="clr-namespace:LiveCharts.Wpf;assembly=LiveCharts.Wpf"
        xmlns:geared="clr-namespace:LiveCharts.Geared;assembly=LiveCharts.Geared"
        xmlns:scrollable="clr-namespace:Geared.Wpf.Scrollable"
        mc:Ignorable="d">
    <UserControl.DataContext>
        <scrollable:ScrollableViewModel></scrollable:ScrollableViewModel>
    </UserControl.DataContext>
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"></RowDefinition>
            <RowDefinition Height="*"></RowDefinition>
            <RowDefinition Height="100"></RowDefinition>
        </Grid.RowDefinitions>
        <TextBlock Grid.Row="0"></TextBlock>
        <lvc:CartesianChart Grid.Row="1"
                            Zoom="X" 
                            DisableAnimations="True"
                            Hoverable="False">
            <lvc:CartesianChart.Resources>
                <Style TargetType="lvc:Separator">
                    <Setter Property="StrokeThickness" Value="2.5"></Setter>
                    <Setter Property="Stroke" Value="#E7E7E7"></Setter>
                    <Style.Triggers>
                        <Trigger Property="AxisOrientation" Value="X">
                            <Setter Property="IsEnabled" Value="False"></Setter>
                        </Trigger>
                    </Style.Triggers>
                </Style>
            </lvc:CartesianChart.Resources>
            <lvc:CartesianChart.Series>
                <geared:GLineSeries StrokeThickness="0" 
                                    Values="{Binding Values}"
                                    Fill="#2194F1"
                                    AreaLimit="0"
                                    PointGeometry="{x:Null}"/>
            </lvc:CartesianChart.Series>
            <lvc:CartesianChart.AxisX>
                <lvc:Axis LabelFormatter="{Binding Formatter}" RangeChanged="Axis_OnRangeChanged" 
                          MinValue="{Binding From, Mode=TwoWay}" MaxValue="{Binding To, Mode=TwoWay}"
                          Separator="{x:Static lvc:DefaultAxes.CleanSeparator}"/>
            </lvc:CartesianChart.AxisX>
        </lvc:CartesianChart>
        <lvc:CartesianChart Grid.Row="2" DisableAnimations="True" 
                            ScrollMode="X" 
                            ScrollHorizontalFrom="{Binding From, Mode=TwoWay}"
                            ScrollHorizontalTo="{Binding To, Mode=TwoWay}"
                            ScrollBarFill="#25303030"
                            DataTooltip="{x:Null}"
                            Hoverable="False"
                            Margin="20 10">
            <lvc:CartesianChart.Resources>
                <Style TargetType="lvc:Separator">
                    <Setter Property="IsEnabled" Value="False"></Setter>
                </Style>
后面还有 24 行代码,解锁后查看完整代码

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

AI 解读

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

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