GUI: move DoubleTapped handler from guild list to channel tree view

Co-authored-by: Tyrrrz <1935960+Tyrrrz@users.noreply.github.com>
This commit is contained in:
copilot-swe-agent[bot] 2026-02-27 16:57:41 +00:00
parent fc611f0424
commit f42ddef3e7
2 changed files with 5 additions and 8 deletions

View File

@ -100,7 +100,6 @@
BorderThickness="0,0,1,0">
<ListBox
x:Name="AvailableGuildsListBox"
DoubleTapped="AvailableGuildsListBox_OnDoubleTapped"
ItemsSource="{Binding AvailableGuilds}"
ScrollViewer.VerticalScrollBarVisibility="Hidden"
SelectedItem="{Binding SelectedGuild}"
@ -143,6 +142,7 @@
<Border Grid.Column="1">
<TreeView
x:Name="AvailableChannelsTreeView"
DoubleTapped="AvailableChannelsTreeView_OnDoubleTapped"
ItemsSource="{Binding AvailableChannels}"
SelectedItems="{Binding SelectedChannels}"
SelectionChanged="AvailableChannelsTreeView_OnSelectionChanged"

View File

@ -23,18 +23,15 @@ public partial class DashboardView : UserControl<DashboardViewModel>
SelectionChangedEventArgs args
) => DataContext.PullChannelsCommand.Execute(null);
private void AvailableGuildsListBox_OnDoubleTapped(object? sender, TappedEventArgs args)
private void AvailableChannelsTreeView_OnDoubleTapped(object? sender, TappedEventArgs args)
{
// Ensure the tap was on an actual guild item, not empty space in the list
if (args.Source is not Control { DataContext: Guild })
// Ensure the tap was on an actual channel item, not empty space in the tree
if (args.Source is not Control { DataContext: ChannelConnection channelConnection })
{
return;
}
if (
DataContext.SelectedChannels is not { Count: 1 }
|| DataContext.SelectedChannels[0].Channel.IsCategory
)
if (channelConnection.Channel.IsCategory)
{
return;
}