wpf 定制 个性圆角信息面板

先上图:

代码实现:

cs 复制代码
    <Canvas Grid.Column="1">
        <Border Background="#5665F4" BorderBrush="#5665F4" 
                BorderThickness="0.5" CornerRadius="10,10,10,30"
                Width="180" Height="165" TextBlock.Foreground="White"
                Canvas.Left="16" Canvas.Top="90">
            <Border.Effect>
                <DropShadowEffect BlurRadius="40" ShadowDepth="20" 
                                  Direction="270" Color="#5665F4" Opacity="0.2"/>
            </Border.Effect>
            <Grid Margin="0,0,0,20">
                <Grid.RowDefinitions>
                    <RowDefinition/>
                    <RowDefinition/>
                    <RowDefinition/>
                    <RowDefinition/>
                </Grid.RowDefinitions>
                <Border Height="0.4" Background="#DDD" VerticalAlignment="Bottom"/>
                
                <StackPanel Orientation="Horizontal" VerticalAlignment="Center"
                            TextBlock.FontSize="14" TextBlock.FontWeight="Bold">
                    <TextBlock Text="&#xe61d;" FontFamily="{StaticResource Iconfont}"
                               FontSize="18" Margin="15,0"/>
                    <TextBlock Text="生产情况" VerticalAlignment="Center"/>
                </StackPanel>

                <TextBlock Text="累计生产量" Grid.Row="1" VerticalAlignment="Bottom" Margin="15,0"
                           FontSize="11" Opacity="0.6"/>
                <TextBlock VerticalAlignment="Bottom" HorizontalAlignment="Right"
                           Grid.Row="1" Margin="15,0">
                    <Run Text="263846" FontSize="18"/>
                    <Run Text="T" FontSize="15"/>
                </TextBlock>


                <TextBlock Text="累计生产量" Grid.Row="2" VerticalAlignment="Bottom" Margin="15,0"
                           FontSize="11" Opacity="0.6"/>
                <TextBlock VerticalAlignment="Bottom" HorizontalAlignment="Right"
                           Grid.Row="2" Margin="15,0">
                    <Run Text="83" FontSize="18"/>
                    <Run Text="%" FontSize="15"/>
                </TextBlock>


                <TextBlock Text="累计生产量" Grid.Row="3" VerticalAlignment="Bottom" Margin="15,0"
                           FontSize="11" Opacity="0.6"/>
                <TextBlock VerticalAlignment="Bottom" HorizontalAlignment="Right"
                           Grid.Row="3" Margin="15,0">
                    <Run Text="2" FontSize="18"/>
                    <Run Text="个" FontSize="15"/>
                </TextBlock>
            </Grid>
        </Border>


        <Border Background="#F5F7FB" BorderBrush="#C7C9DB" 
                BorderThickness="0.5" CornerRadius="10,10,10,30"
                Width="170" Height="110" TextBlock.Foreground="#5665F4"
                Canvas.Left="210">
            <Border.Effect>
                <DropShadowEffect BlurRadius="40" ShadowDepth="20" Direction="270" Color="#5665F4" Opacity="0.2"/>
            </Border.Effect>
            <Grid Margin="0,0,0,20">
                <Grid.RowDefinitions>
                    <RowDefinition/>
                    <RowDefinition/>
                    <RowDefinition/>
                </Grid.RowDefinitions>
                <Border Height="0.4" Background="#C7C9DB" VerticalAlignment="Bottom"/>
                <StackPanel Orientation="Horizontal" VerticalAlignment="Center"
                            TextBlock.FontSize="14" TextBlock.FontWeight="Bold">
                    <TextBlock Text="&#xe62d;" FontFamily="{StaticResource Iconfont}"
                               FontSize="18" Margin="15,0"/>
                    <TextBlock Text="人员情况" VerticalAlignment="Center"/>
                </StackPanel>

                <TextBlock Text="生产人员" Grid.Row="1" VerticalAlignment="Bottom" Margin="15,0"
                           FontSize="11" Opacity="0.6"/>
                <TextBlock VerticalAlignment="Bottom" HorizontalAlignment="Right"
                           Grid.Row="1" Margin="15,0">
                    <Run Text="245" FontSize="20"/>
                    <Run Text="人" FontSize="15"/>
                </TextBlock>


                <TextBlock Text="出勤率" Grid.Row="2" VerticalAlignment="Bottom" Margin="15,0"
                           FontSize="11" Opacity="0.6"/>
                <TextBlock VerticalAlignment="Bottom" HorizontalAlignment="Right"
                           Grid.Row="2" Margin="15,0">
                    <Run Text="92" FontSize="20"/>
                    <Run Text="%" FontSize="15"/>
                </TextBlock>
            </Grid>
        </Border>


        <Border Background="#225665F4" BorderBrush="#5665F4" 
                BorderThickness="0.5" CornerRadius="10,10,10,25"
                Width="160" Height="80" TextBlock.Foreground="#FFF"
                Canvas.Left="250" Canvas.Top="200">
            <Border.Effect>
                <DropShadowEffect BlurRadius="40" ShadowDepth="20" Direction="270" Color="#5665F4" Opacity="0.2"/>
            </Border.Effect>
            <Grid Margin="0,0,0,20">
                <Grid.RowDefinitions>
                    <RowDefinition/>
                    <RowDefinition/>
                </Grid.RowDefinitions>
                <Border Height="0.4" Background="#5665F4" VerticalAlignment="Bottom"/>
                <StackPanel Orientation="Horizontal" VerticalAlignment="Center"
                            TextBlock.FontSize="14" TextBlock.FontWeight="Bold">
                    <TextBlock Text="&#xe604;" FontFamily="{StaticResource Iconfont}"
                               FontSize="18" Margin="15,0"/>
                    <TextBlock Text="质量情况" VerticalAlignment="Center"/>
                </StackPanel>

                <TextBlock Text="通过质检比例" Grid.Row="1" VerticalAlignment="Bottom" Margin="15,0"
                           FontSize="11" Opacity="0.6"/>
                <TextBlock VerticalAlignment="Bottom" HorizontalAlignment="Right"
                           Grid.Row="1" Margin="15,0">
                    <Run Text="94" FontSize="20"/>
                    <Run Text="%" FontSize="15"/>
                </TextBlock>
            </Grid>
        </Border>
    </Canvas>
相关推荐
架构文摘JGWZ2 小时前
Java 23 的12 个新特性!!
java·开发语言·学习
拾光师3 小时前
spring获取当前request
java·后端·spring
aPurpleBerry3 小时前
neo4j安装启动教程+对应的jdk配置
java·neo4j
我是苏苏3 小时前
Web开发:ABP框架2——入门级别的增删改查Demo
java·开发语言
xujinwei_gingko3 小时前
Spring IOC容器Bean对象管理-Java Config方式
java·spring
2301_789985943 小时前
Java语言程序设计基础篇_编程练习题*18.29(某个目录下的文件数目)
java·开发语言·学习
IT学长编程3 小时前
计算机毕业设计 教师科研信息管理系统的设计与实现 Java实战项目 附源码+文档+视频讲解
java·毕业设计·springboot·毕业论文·计算机毕业设计选题·计算机毕业设计开题报告·教师科研管理系统
m0_571957583 小时前
Java | Leetcode Java题解之第406题根据身高重建队列
java·leetcode·题解
程序猿小D4 小时前
第二百三十五节 JPA教程 - JPA Lob列示例
java·数据库·windows·oracle·jdk·jpa
Lill_bin4 小时前
深入理解ElasticSearch集群:架构、高可用性与数据一致性
大数据·分布式·elasticsearch·搜索引擎·zookeeper·架构·全文检索