Skip to content

RateControl zh CN

末城via edited this page Jun 26, 2023 · 3 revisions

RateControl 评分

返回目录

适用于:   v1.1.8 或更新的版本

概述

此文档待补充。


示例

示例1

<pu:RateControl FontSize="30"
                Rate="2.5"
                CanSelectHalf="True"
                RateChanged="RateControl_RateChanged" />

示例2

xmlns:pu="https://opensource.panuon.com/wpf-ui"
xmlns:purs="clr-namespace:Panuon.WPF.UI.Resources;assembly=Panuon.WPF.UI"
...

<pu:RateControl FontSize="30"
                Rate="2.5"
                CanSelectHalf="True"
                IsReadOnly="True"
                Foreground="HotPink"
                RateChanged="RateControl_RateChanged">
    <pu:RateControl.GlyphTemplate>
        <DataTemplate>
            <TextBlock x:Name="TxtGlyph"
                       Cursor="Hand"
                       Text="&#xe96f;"
                       FontFamily="/Panuon.WPF.UI;component/Resources/#PanuonIcon" />
            <DataTemplate.Triggers>
                <DataTrigger Binding="{Binding Rate}"
                             Value="0.5">
                    <Setter TargetName="TxtGlyph"
                            Property="Text"
                            Value="&#xe970;" />
                </DataTrigger>
                <DataTrigger Binding="{Binding Rate}"
                             Value="1">
                    <Setter TargetName="TxtGlyph"
                            Property="Text"
                            Value="&#xe971;" />
                </DataTrigger>
            </DataTemplate.Triggers>
        </DataTemplate>
    </pu:RateControl.GlyphTemplate>
</pu:RateControl>

Language

WPF 简体中文

Clone this wiki locally