mirror of
https://github.com/Tyrrrz/DiscordChatExporter.git
synced 2026-03-31 17:43:04 -06: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">
|
BorderThickness="0,0,1,0">
|
||||||
<ListBox
|
<ListBox
|
||||||
x:Name="AvailableGuildsListBox"
|
x:Name="AvailableGuildsListBox"
|
||||||
DoubleTapped="AvailableGuildsListBox_OnDoubleTapped"
|
|
||||||
ItemsSource="{Binding AvailableGuilds}"
|
ItemsSource="{Binding AvailableGuilds}"
|
||||||
ScrollViewer.VerticalScrollBarVisibility="Hidden"
|
ScrollViewer.VerticalScrollBarVisibility="Hidden"
|
||||||
SelectedItem="{Binding SelectedGuild}"
|
SelectedItem="{Binding SelectedGuild}"
|
||||||
|
|
@ -143,6 +142,7 @@
|
||||||
<Border Grid.Column="1">
|
<Border Grid.Column="1">
|
||||||
<TreeView
|
<TreeView
|
||||||
x:Name="AvailableChannelsTreeView"
|
x:Name="AvailableChannelsTreeView"
|
||||||
|
DoubleTapped="AvailableChannelsTreeView_OnDoubleTapped"
|
||||||
ItemsSource="{Binding AvailableChannels}"
|
ItemsSource="{Binding AvailableChannels}"
|
||||||
SelectedItems="{Binding SelectedChannels}"
|
SelectedItems="{Binding SelectedChannels}"
|
||||||
SelectionChanged="AvailableChannelsTreeView_OnSelectionChanged"
|
SelectionChanged="AvailableChannelsTreeView_OnSelectionChanged"
|
||||||
|
|
|
||||||
|
|
@ -23,18 +23,15 @@ public partial class DashboardView : UserControl<DashboardViewModel>
|
||||||
SelectionChangedEventArgs args
|
SelectionChangedEventArgs args
|
||||||
) => DataContext.PullChannelsCommand.Execute(null);
|
) => 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
|
// Ensure the tap was on an actual channel item, not empty space in the tree
|
||||||
if (args.Source is not Control { DataContext: Guild })
|
if (args.Source is not Control { DataContext: ChannelConnection channelConnection })
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (
|
if (channelConnection.Channel.IsCategory)
|
||||||
DataContext.SelectedChannels is not { Count: 1 }
|
|
||||||
|| DataContext.SelectedChannels[0].Channel.IsCategory
|
|
||||||
)
|
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue