wenxiangchao
2026-11-02 9d1660270272180cd71147d6ddd53d1382643d2e
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
<hb:NotifyControl x:Class="WPFProject.ResourceUI"
             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:WPFProject.UI"
             mc:Ignorable="d"
             xmlns:hb="clr-namespace:HMI.Base;assembly=HMI.Base"
             xmlns:dp="clr-namespace:HMI.UI.DpUtil;assembly=HMI.UI"
             xmlns:pu="https://opensource.panuon.com/wpf-ui"
             d:DesignHeight="450" d:DesignWidth="800">
    <hb:NotifyControl.Resources>
        <ResourceDictionary>
            <ResourceDictionary.MergedDictionaries>
                <pu:StyleDictionary Includes="Label" />
            </ResourceDictionary.MergedDictionaries>
            <Style x:Key="def" TargetType="Label" BasedOn="{StaticResource {x:Static pu:StyleKeys.LabelStyle}}">
                <Setter Property="pu:LabelHelper.CornerRadius" Value="3"/>
                <Setter Property="Padding" Value="5,0"/>
                <Setter Property="Margin" Value="0"/>
                <Setter Property="VerticalContentAlignment" Value="Center"/>
                <Setter Property="Foreground" Value="#FFF"/>
            </Style>
        </ResourceDictionary>
    </hb:NotifyControl.Resources>
    
    <Grid dp:GridHelper.Space="10" dp:GridHelper.SpaceIgnore="ALL">
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="Auto"/>
            <ColumnDefinition Width="Auto"/>
            <ColumnDefinition Width="Auto"/>
            <ColumnDefinition Width="Auto"/>
        </Grid.ColumnDefinitions>
 
        <Label Grid.Column="0" Style="{StaticResource def}" x:Name="l1">
            <TextBlock>
    <Run Text="{DynamicResource App.CPUUsage}"/>
    <Run Text="{Binding CpuRate}"/>
            </TextBlock>
        </Label>
 
        <Label Grid.Column="1" Style="{StaticResource def}" x:Name="l2">
            <TextBlock>
    <Run Text="{DynamicResource App.RemUsage}"/>
    <Run Text="{Binding RemRate}"/>
            </TextBlock>
        </Label>
 
        <Label Grid.Column="2" Style="{StaticResource def}" x:Name="l3">
            <TextBlock Grid.Column="2">
    <Run Text="{DynamicResource App.TotalCPUUsage}"/>
    <Run Text="{Binding TotalCpuRate}"/>
            </TextBlock>
        </Label>
 
        <Label Grid.Column="3" Style="{StaticResource def}" x:Name="l4">
            <TextBlock Grid.Column="3">
    <Run Text="{DynamicResource App.TotalRemUsage}"/>
    <Run Text="{Binding TotalRemRate}"/>
            </TextBlock>
        </Label>
    </Grid>
</hb:NotifyControl>