feat: 使用 MyRadioButton

This commit is contained in:
tangge233
2024-08-05 23:34:49 +08:00
parent f9c4e5a752
commit eca89febf6
2 changed files with 12 additions and 12 deletions
@@ -25,16 +25,16 @@
</Grid>
</local:MyCard>
<local:MyCard x:Name="PanListBack" VerticalAlignment="Top" Opacity="0" Margin="0,0,0,15" Title=" " MinHeight="40">
<StackPanel Margin="0,11,10,0" Orientation="Horizontal" VerticalAlignment="Top" HorizontalAlignment="Right" Height="20">
<local:MyTextButton VerticalContentAlignment="Center" Height="20" Margin="3,0" Tag="All" Text="全部" x:Name="BtnTypeAll"/>
<StackPanel Margin="0,9,10,0" Orientation="Horizontal" VerticalAlignment="Top" HorizontalAlignment="Right" Height="24">
<local:MyRadioButton VerticalAlignment="Center" Height="24" Margin="2,0" Tag="All" Text="全部" x:Name="BtnTypeAll" ColorType="Highlight" Checked="True"/>
<TextBlock Text="|" Foreground="{StaticResource ColorBrushGray1}" VerticalAlignment="Center"/>
<local:MyTextButton VerticalContentAlignment="Center" Height="20" Margin="3,0" Tag="Enabled" Text="已启用" x:Name="BtnTypeEnabled"/>
<local:MyRadioButton VerticalAlignment="Center" Height="24" Margin="2,0" Tag="Enabled" Text="已启用" x:Name="BtnTypeEnabled" ColorType="Highlight"/>
<TextBlock Text="|" Foreground="{StaticResource ColorBrushGray1}" VerticalAlignment="Center"/>
<local:MyTextButton VerticalContentAlignment="Center" Height="20" Margin="3,0" Tag="Disabled" Text="已禁用" x:Name="BtnTypeDisabled"/>
<local:MyRadioButton VerticalAlignment="Center" Height="24" Margin="2,0" Tag="Disabled" Text="已禁用" x:Name="BtnTypeDisabled" ColorType="Highlight"/>
<TextBlock Text="|" Foreground="{StaticResource ColorBrushGray1}" VerticalAlignment="Center"/>
<local:MyTextButton VerticalContentAlignment="Center" Height="20" Margin="3,0" Tag="CanUpdate" Text="可更新" x:Name="BtnTypeCanUpdate"/>
<local:MyRadioButton VerticalAlignment="Center" Height="24" Margin="2,0" Tag="CanUpdate" Text="可更新" x:Name="BtnTypeCanUpdate" ColorType="Highlight"/>
<TextBlock Text="|" Foreground="{StaticResource ColorBrushGray1}" VerticalAlignment="Center"/>
<local:MyTextButton VerticalContentAlignment="Center" Height="20" Margin="3,0" Tag="Error" Text="错误" x:Name="BtnTypeError"/>
<local:MyRadioButton VerticalAlignment="Center" Height="24" Margin="2,0" Tag="Error" Text="错误" x:Name="BtnTypeError" ColorType="Highlight"/>
</StackPanel>
<StackPanel Margin="20,38,18,18" Name="PanList" VerticalAlignment="Top" />
</local:MyCard>
@@ -169,11 +169,11 @@
ModError += 1
End If
Next
BtnTypeAll.Text = $"全部 ({ModEnabled + ModDisabled + ModError})"
BtnTypeCanUpdate.Text = $"可更新 ({ModCanUpdate})"
BtnTypeEnabled.Text = $"已启用 ({ModEnabled})"
BtnTypeDisabled.Text = $"已禁用 ({ModDisabled})"
BtnTypeError.Text = $"错误 ({ModError})"
BtnTypeAll.Text = $"全部 ({ModEnabled + ModDisabled + ModError}) "
BtnTypeCanUpdate.Text = $"可更新 ({ModCanUpdate}) "
BtnTypeEnabled.Text = $"已启用 ({ModEnabled}) "
BtnTypeDisabled.Text = $"已禁用 ({ModDisabled}) "
BtnTypeError.Text = $"错误 ({ModError}) "
RefreshTitle()
End Sub
''' <summary>
@@ -385,7 +385,7 @@
Private ViewModType As String = "All"
Private Sub ChangeViewType(sender As MyTextButton, e As EventArgs) Handles BtnTypeAll.Click, BtnTypeCanUpdate.Click, BtnTypeDisabled.Click, BtnTypeEnabled.Click, BtnTypeError.Click
Private Sub ChangeViewType(sender As MyRadioButton, raiseByMouse As Boolean) Handles BtnTypeAll.Check, BtnTypeCanUpdate.Check, BtnTypeDisabled.Check, BtnTypeEnabled.Check, BtnTypeError.Check
ViewModType = sender.Tag
If IsSearching Then
SearchRun()