- 积分
- 6317
- 明经币
- 个
- 注册时间
- 2016-10-12
- 在线时间
- 小时
- 威望
-
- 金钱
- 个
- 贡献
-
- 激情
-
|
CAD自带的进度条不够酷炫,这个可以给你灵感 - 前端:
- <Window x:Class="HTJ.Views.ProgressView"
- 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:local="clr-namespace:HTJ.Views"
- mc:Ignorable="d"
- Title="处理进度"
- Height="200"
- Width="500"
- WindowStyle="None"
- AllowsTransparency="True"
- Background="Transparent"
- WindowStartupLocation="CenterScreen"
- Topmost="True" >
- <Window.Resources>
- <!-- 渐变画笔 -->
- <LinearGradientBrush x:Key="PrimaryGradient" StartPoint="0,0" EndPoint="1,1">
- <GradientStop Color="#667eea" Offset="0"/>
- <GradientStop Color="#764ba2" Offset="1"/>
- </LinearGradientBrush>
-
- <LinearGradientBrush x:Key="ProgressGradient" StartPoint="0,0" EndPoint="1,0">
- <GradientStop Color="#f093fb" Offset="0"/>
- <GradientStop Color="#f5576c" Offset="1"/>
- </LinearGradientBrush>
- <!-- 阴影效果 -->
- <DropShadowEffect x:Key="ShadowEffect"
- ShadowDepth="0"
- BlurRadius="20"
- Color="#40000000"
- Opacity="0.6"/>
-
- <!-- 动画 -->
- <Storyboard x:Key="PulseAnimation" RepeatBehavior="Forever">
- <DoubleAnimation Storyboard.TargetProperty="Opacity"
- From="0.7" To="1.0" Duration="0:0:1"
- AutoReverse="True"/>
- </Storyboard>
-
- <Storyboard x:Key="SlideInAnimation">
- <ThicknessAnimation Storyboard.TargetProperty="Margin"
- From="0,-50,0,0" To="0,0,0,0"
- Duration="0:0:0.5"
- DecelerationRatio="0.7"/>
- <DoubleAnimation Storyboard.TargetProperty="Opacity"
- From="0" To="1" Duration="0:0:0.3"/>
- </Storyboard>
- <!-- 进度条光泽效果 -->
- <LinearGradientBrush x:Key="ProgressGlowBrush" StartPoint="0,0" EndPoint="0,1">
- <GradientStop Color="#80FFFFFF" Offset="0.0"/>
- <GradientStop Color="#00FFFFFF" Offset="0.3"/>
- <GradientStop Color="#00FFFFFF" Offset="0.7"/>
- <GradientStop Color="#40FFFFFF" Offset="1.0"/>
- </LinearGradientBrush>
- </Window.Resources>
-
- <!-- 窗口级别的事件触发器 -->
- <Window.Triggers>
- <EventTrigger RoutedEvent="Window.Loaded">
- <BeginStoryboard Storyboard="{StaticResource SlideInAnimation}"/>
- </EventTrigger>
- </Window.Triggers>
-
- <!-- 主容器 -->
- <Border Background="{StaticResource PrimaryGradient}"
- CornerRadius="15"
- Margin="10"
- Effect="{StaticResource ShadowEffect}">
-
- <Grid Margin="20">
- <Grid.RowDefinitions>
- <RowDefinition Height="Auto"/>
- <RowDefinition Height="*"/>
- <RowDefinition Height="Auto"/>
- <RowDefinition Height="Auto"/>
- </Grid.RowDefinitions>
-
- <!-- 标题栏 -->
- <Grid Grid.Row="0">
- <Grid.ColumnDefinitions>
- <ColumnDefinition Width="*"/>
- <ColumnDefinition Width="Auto"/>
- </Grid.ColumnDefinitions>
-
- <TextBlock Text="图层处理进度"
- FontSize="16"
- FontWeight="Bold"
- Foreground="White"
- VerticalAlignment="Center"/>
-
- <!-- 关闭按钮 -->
- <Button x:Name="BtnClose"
- Grid.Column="1"
- Content="✕"
- Width="25"
- Height="25"
- Background="Transparent"
- BorderBrush="Transparent"
- Foreground="White"
- FontSize="12"
- FontWeight="Bold"
- Click="btnClose_Click"
- Cursor="Hand">
- <Button.Style>
- <Style TargetType="Button">
- <Setter Property="Opacity" Value="0.7"/>
- <Style.Triggers>
- <Trigger Property="IsMouseOver" Value="True">
- <Setter Property="Opacity" Value="1"/>
- <Setter Property="Background" Value="#20FFFFFF"/>
- </Trigger>
- </Style.Triggers>
- </Style>
- </Button.Style>
- </Button>
- </Grid>
-
- <!-- 当前任务 -->
- <TextBlock x:Name="TxtCurrentTask"
- Grid.Row="1"
- Text="正在初始化..."
- FontSize="12"
- Foreground="#E0FFFFFF"
- Margin="0,10,0,5"
- TextWrapping="Wrap"/>
-
- <!-- 进度条区域 -->
- <Border Grid.Row="2"
- Background="#20FFFFFF"
- CornerRadius="10"
- Height="20"
- Margin="0,5,0,0">
-
- <!-- 进度条背景 -->
- <Grid>
- <!-- 进度条填充 -->
- <Border x:Name="ProgressBar"
- HorizontalAlignment="Left"
- Background="{StaticResource ProgressGradient}"
- CornerRadius="8"
- Width="0"
- Height="16"
- Margin="2">
-
- <!-- 进度条光泽效果 -->
- <Border Background="{StaticResource ProgressGlowBrush}"
- CornerRadius="8"/>
- </Border>
- </Grid>
- </Border>
-
- <!-- 进度文本和时间 -->
- <Grid Grid.Row="3" Margin="0,10,0,0">
- <Grid.ColumnDefinitions>
- <ColumnDefinition Width="*"/>
- <ColumnDefinition Width="Auto"/>
- </Grid.ColumnDefinitions>
-
- <TextBlock x:Name="TxtProgress"
- Text="0%"
- FontSize="11"
- Foreground="White"
- FontWeight="SemiBold"/>
-
- <TextBlock x:Name="TxtTimeRemaining"
- Grid.Column="1"
- Text="预计剩余: --"
- FontSize="10"
- Foreground="#C0FFFFFF"/>
- </Grid>
- </Grid>
- </Border>
- </Window>
|
本帖子中包含更多资源
您需要 登录 才可以下载或查看,没有账号?注册
x
评分
-
查看全部评分
|