Skip to content

Commit

Permalink
Double clicking on Listbox when it's empty will open the Delete File …
Browse files Browse the repository at this point in the history
…Dialog as asked in #4
  • Loading branch information
mhmd-azeez committed Dec 23, 2016
1 parent 280762b commit df02a9c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
7 changes: 3 additions & 4 deletions RudeFox.FrontEnd/Views/MainWindow.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
<SolidColorBrush x:Key="foreground2" Color="#343434" />
<converters:TimespanToStringConverter x:Key="timeConverter"/>
<DataTemplate x:Key="operation" DataType="vm:OperationVM">
<Border >
<Border>
<Grid Margin="0, 5">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="80" />
Expand Down Expand Up @@ -125,11 +125,10 @@
<controls:SidebarButton ImageSource="/Images/icon_24.png" Text="ABOUT RUDE FOX" Command="{Binding ShowAboutCommand}" Grid.Row="5"/>
</Grid>

<ListBox gong:DragDrop.IsDropTarget="True" gong:DragDrop.DropHandler="{Binding}"
<ListBox x:Name="lstOperations" gong:DragDrop.IsDropTarget="True" gong:DragDrop.DropHandler="{Binding}"
ItemsSource="{Binding Source={x:Static frontEnd:App.Operations}}"
HorizontalContentAlignment="Stretch" ItemTemplate="{StaticResource operation}"
Style="{StaticResource listBox}" Background="{StaticResource background2}">

Style="{StaticResource listBox}" Background="{StaticResource background2}" MouseDoubleClick="ListBox_MouseDoubleClick">
</ListBox>

</DockPanel>
Expand Down
5 changes: 5 additions & 0 deletions RudeFox.FrontEnd/Views/MainWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,5 +25,10 @@ public MainWindow()
InitializeComponent();
}

private void ListBox_MouseDoubleClick(object sender, MouseButtonEventArgs e)
{
if (lstOperations.SelectedItem == null)
(DataContext as MainWindowVM).DeleteFilesCommand.Execute(null);
}
}
}

0 comments on commit df02a9c

Please sign in to comment.