0

我需要一个进度条,它会在一些固定的时间间隔后显示点和图标。我正在研究相机模块,当拍摄快照时,我需要在进度条中显示点,这表明已拍摄快照。然后这个快照被传递给算法并返回布尔值,然后我需要显示图标。

如果持续时间为 1 分钟且间隔为 30 秒,那么在进度条控件中,我需要在进度条中显示两个点和两个图标。

请给我一些解决方案,下面是 XAMl

XAML 用于进度条

<Window.Resources>

    <Style x:Key="ProgressBarStyle" TargetType="ProgressBar">

        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="ProgressBar">
                    <Border BorderBrush="#BBC6C4" BorderThickness="1" CornerRadius="5" Padding="1">
                        <Grid x:Name="PART_Track" >
                            <Rectangle x:Name="PART_Indicator" HorizontalAlignment="Left" RadiusX="5" RadiusY="5">
                                <Rectangle.Fill>
                                    <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                                        <GradientStop Color="#FF1D5666" Offset="1"/>
                                        <GradientStop Color="#FF09B6FF"/>
                                    </LinearGradientBrush>
                                </Rectangle.Fill>
                            </Rectangle>

                            <Ellipse x:Name="progressdot" HorizontalAlignment="Left" Margin="73,7,0,0" Stroke="#FFA8A49B" Width="8" Height="8" 
                                     VerticalAlignment="Top" Grid.Row="1" />
                            <Image x:Name="imgAcetowhiteness" Margin="89,7,0,0" Source="..\acetowhiteness.png" 
                                   Stretch="Fill" Width="15" Height="15" Grid.Row="1" HorizontalAlignment="Left" VerticalAlignment="Top" />
                            <Ellipse x:Name="progressdot1" HorizontalAlignment="Left" Margin="180,7,0,0" Stroke="#FFA8A49B" Width="8" Height="8" 
                                     VerticalAlignment="Top" Grid.Row="1" />
                            <Image x:Name="imgAcetowhiteness1" Margin="195,7,0,0" Source="..\acetowhiteness.png" 
                                   Stretch="Fill" Width="15" Height="15" Grid.Row="1" HorizontalAlignment="Left" VerticalAlignment="Top" />

                        </Grid>
                    </Border>
                </ControlTemplate>
            </Setter.Value>
        </Setter>

    </Style>

</Window.Resources> 

<Grid>
    <StackPanel Orientation="Vertical">
        <ProgressBar x:Name="PBarone" Margin="48,10,10,10" Style="{StaticResource ProgressBarStyle}"/>
        <ProgressBar x:Name="PBartwo" Margin="48,20,10,10" Style="{StaticResource ProgressBarStyle}"/>
        <ProgressBar x:Name="PBarthree" Margin="48,30,10,10" Style="{StaticResource ProgressBarStyle}"/>
    </StackPanel>


</Grid>
4

0 回答 0