Skip to content

Commit

Permalink
fix: ListItem click ability
Browse files Browse the repository at this point in the history
  • Loading branch information
tangge233 committed Nov 13, 2024
1 parent 85d4df1 commit 5a1a670
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion Plain Craft Launcher 2/Controls/MyListItem.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
<!--<Border x:Name="RectBack" CornerRadius="3" RenderTransformOrigin="0.5,0.5" SnapsToDevicePixels="True" IsHitTestVisible="False" Opacity="0" Grid.ColumnSpan="4" Background="{DynamicResource ColorBrush7}" BorderBrush="{DynamicResource ColorBrush6}" BorderThickness="1" />-->
<!--<StackPanel VerticalAlignment="Center">-->
<TextBlock Grid.Row="1" SnapsToDevicePixels="False" UseLayoutRounding="False" HorizontalAlignment="Left" x:Name="LabTitle" IsHitTestVisible="False" Grid.Column="3" Text="{Binding Title, ElementName=PanBack}" TextTrimming="CharacterEllipsis" FontSize="{Binding FontSize, ElementName=PanBack}" Foreground="{Binding Foreground, ElementName=PanBack}" Margin="4,0,0,0" />
<StackPanel Orientation="Horizontal" x:Name="PanInfo" Grid.Row="2" Grid.Column="3" Visibility="Collapsed">
<StackPanel Orientation="Horizontal" x:Name="PanInfo" Grid.Row="2" Grid.Column="3" Visibility="Collapsed" IsHitTestVisible="False">
<StackPanel x:Name="PanTags" Orientation="Horizontal" VerticalAlignment="Bottom" Margin="0,0,-3,0">
<!--<Border Background="{DynamicResource ColorBrush6}" Padding="3,1" CornerRadius="3" Margin="0,0,4,0" SnapsToDevicePixels="True" UseLayoutRounding="False">
<TextBlock Text="科技" Foreground="{DynamicResource ColorBrush2}" FontSize="11" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,9 @@
'结果 UI 化
Private Sub Load_OnFinish()
Try
RemoveHandler PanSearchBox.TextChanged, AddressOf SearchRun
AllowSearch = False
PanSearchBox.Text = String.Empty
AddHandler PanSearchBox.TextChanged, AddressOf SearchRun
AllowSearch = True
CompItemList.Clear()
HintGetFail.Visibility = If(Loader.Input.Count = Loader.Output.Count, Visibility.Collapsed, Visibility.Visible)
For Each item In Loader.Output
Expand Down Expand Up @@ -243,8 +243,10 @@
End Get
End Property

Private AllowSearch As Boolean = True
Private SearchResult As New List(Of MyListItem)
Public Sub SearchRun()
Public Sub SearchRun() Handles PanSearchBox.TextChanged
If Not AllowSearch Then Exit Sub
If IsSearching Then
'构造请求
Dim QueryList As New List(Of SearchEntry(Of MyListItem))
Expand Down

0 comments on commit 5a1a670

Please sign in to comment.