ghost1372 / HandyControls

Contains some simple and commonly used WPF controls based on HandyControl
https://ghost1372.github.io/
MIT License
1.07k stars 102 forks source link

Pagination Index goes wrong after cutomizing the PaginationButtonStyle #218

Closed PieceOfFall closed 6 months ago

PieceOfFall commented 8 months ago

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

ghost1372 commented 6 months ago

report it in original repo

PieceOfFall commented 6 months ago

Thus,could you please close your entrance to report bug here ?

ghost1372 commented 6 months ago

This is only for reports about the custom version, we have already informed here https://github.com/ghost1372/HandyControls/issues/48