mirror of
https://github.com/Tyrrrz/DiscordChatExporter.git
synced 2026-03-31 17:43:04 -06:00
GUI: move DoubleTapped handler to channel Grid inside TreeDataTemplate
Co-authored-by: Tyrrrz <1935960+Tyrrrz@users.noreply.github.com>
This commit is contained in:
parent
f42ddef3e7
commit
d6a70484c1
|
|
@ -142,7 +142,6 @@
|
||||||
<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"
|
||||||
|
|
@ -161,7 +160,8 @@
|
||||||
<Grid
|
<Grid
|
||||||
Background="Transparent"
|
Background="Transparent"
|
||||||
Classes.category="{Binding Channel.IsCategory}"
|
Classes.category="{Binding Channel.IsCategory}"
|
||||||
ColumnDefinitions="Auto,*,Auto">
|
ColumnDefinitions="Auto,*,Auto"
|
||||||
|
DoubleTapped="ChannelGrid_OnDoubleTapped">
|
||||||
<Grid.Styles>
|
<Grid.Styles>
|
||||||
<Style Selector="Grid">
|
<Style Selector="Grid">
|
||||||
<Style Selector="^:not(.category)">
|
<Style Selector="^:not(.category)">
|
||||||
|
|
|
||||||
|
|
@ -23,10 +23,9 @@ public partial class DashboardView : UserControl<DashboardViewModel>
|
||||||
SelectionChangedEventArgs args
|
SelectionChangedEventArgs args
|
||||||
) => DataContext.PullChannelsCommand.Execute(null);
|
) => DataContext.PullChannelsCommand.Execute(null);
|
||||||
|
|
||||||
private void AvailableChannelsTreeView_OnDoubleTapped(object? sender, TappedEventArgs args)
|
private void ChannelGrid_OnDoubleTapped(object? sender, TappedEventArgs args)
|
||||||
{
|
{
|
||||||
// Ensure the tap was on an actual channel item, not empty space in the tree
|
if (sender is not Control { DataContext: ChannelConnection channelConnection })
|
||||||
if (args.Source is not Control { DataContext: ChannelConnection channelConnection })
|
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue