效果图:

WPF实现特殊统计图

 

ActiveFunItem.xaml代码:

<UserControl x:Class="SunCreate.Vipf.Client.UI.ActiveFunItem"
             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" 
             mc:Ignorable="d" 
             d:DesignHeight="74" d:DesignWidth="50">
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="{Binding ItemWidth}"></RowDefinition>
            <RowDefinition Height="24"></RowDefinition>
        </Grid.RowDefinitions>
        <Border Width="{Binding ItemWidth}" Height="{Binding ItemWidth}" Background="{Binding FillColor}" BorderBrush="{Binding BorderColor}" BorderThickness="2" CornerRadius="{Binding ItemWidthHalf}" >
            <Border.ToolTip>
                <ToolTip>
                    <ToolTip.Template>
                        <ControlTemplate>
                            <Border Background="#88333333" CornerRadius="4">
                                <TextBlock Margin="5" Foreground="#f2f2f2" Text="{Binding FunName}"></TextBlock>
                            </Border>
                        </ControlTemplate>
                    </ToolTip.Template>
                </ToolTip>
            </Border.ToolTip>
            <Image Width="{Binding IconWidth}" Height="{Binding IconWidth}" Stretch="Fill" Source="{Binding Image}" VerticalAlignment="Center" HorizontalAlignment="Center"></Image>
        </Border>
        <StackPanel Grid.Row="1" Orientation="Horizontal" HorizontalAlignment="Center">
            <TextBlock Text="{Binding Count}" Foreground="#008bf1" FontSize="20" VerticalAlignment="Center"></TextBlock>
            <TextBlock Text="次" Foreground="#008bf1" FontSize="20" VerticalAlignment="Center"></TextBlock>
        </StackPanel>
    </Grid>
</UserControl>
View Code

相关文章:

  • 2022-12-23
  • 2022-02-03
  • 2021-07-21
  • 2022-12-23
  • 2021-06-01
  • 2021-09-28
  • 2021-07-14
  • 2022-12-23
猜你喜欢
  • 2022-02-10
  • 2022-12-23
  • 2021-12-25
  • 2022-12-23
  • 2022-12-23
  • 2021-10-10
相关资源
相似解决方案