Skip to content

Pagination Index goes wrong after cutomizing the PaginationButtonStyle #218

Closed
@PieceOfFall

Description

@PieceOfFall

Describe the bug

Selection status of Pagination goes wrong after I customize the PaginationButtonStyle

Environment:

.net8
HandyControls 3.5.0

Steps to reproduce the bug

I use Pagination in my project

                <!-- 分页组件 -->
                <StackPanel Grid.Row="2" Orientation="Horizontal" HorizontalAlignment="Center">
                    <hc:Pagination MaxPageCount="{Binding MaxPageCount}" PageIndex="{Binding PageIndex,Mode=TwoWay}" AutoHiding="True"
                                   Margin="20" PaginationButtonStyle="{StaticResource PaginationButtonStyle}">
                        <i:Interaction.Triggers>
                            <i:EventTrigger EventName="PageUpdated">
                                <i:InvokeCommandAction 
                                    CommandParameter="页码更新"
                                    Command="{Binding ExecuteCommand}"/>
                            </i:EventTrigger>
                        </i:Interaction.Triggers>
                    </hc:Pagination>
                </StackPanel>

, and set PaginationButtonStyle:

        <Style x:Key="PaginationButtonStyle" TargetType="RadioButton" BasedOn="{StaticResource MaterialDesignChoiceChipPrimaryOutlineRadioButton}">
            <Setter Property="Margin" Value="3"/>
            <Setter Property="FontSize" Value="20" />
            <Setter Property="Height" Value="30" />
        </Style>
    </UserControl.Resources>

But when I try to use the pageIndex(press index 2),

I find the first Index also being selected:

image

In this case, If I press the Index 1, selected Index 2 won't be canceled..and the last Index perform in the same way

Expected behavior

No response

Screenshots

image
image

NuGet package version

HandyControl 3.4.0

IDE

Visual Studio 2022

Framework type

.Net 7.0

Windows version

Windows 11 (22000)

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions