mirror of
https://github.com/Tyrrrz/DiscordChatExporter.git
synced 2026-03-21 17:54:37 -05:00
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:
parent
fc611f0424
commit
f42ddef3e7
|
|
@ -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"
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user