This commit is contained in:
2022-02-23 22:47:43 +01:00
parent 4952c68ce9
commit cef8e5de18
20 changed files with 1790 additions and 41 deletions

View File

@@ -3,6 +3,7 @@ using Avalonia.Controls;
using Avalonia.Input;
using Avalonia.Interactivity;
using Avalonia.Markup.Xaml;
using FileTime.App.Core.Models;
using FileTime.Avalonia.Misc;
using FileTime.Avalonia.Models;
using FileTime.Avalonia.ViewModels;
@@ -93,31 +94,19 @@ namespace FileTime.Avalonia.Views
}
}
private void OnPlacePointerPressed(object sender, PointerPressedEventArgs e)
private void OnHasContainerPointerPressed(object sender, PointerPressedEventArgs e)
{
if (!e.Handled
&& ViewModel != null
&& e.GetCurrentPoint(this).Properties.IsLeftButtonPressed
&& sender is StyledElement control
&& control.DataContext is PlaceInfo placeInfo)
&& control.DataContext is IHaveContainer hasContainer)
{
ViewModel.CommandHandlerService.OpenContainer(placeInfo.Container);
ViewModel.CommandHandlerService.OpenContainer(hasContainer.Container);
e.Handled = true;
}
}
private void OnRootDrivePointerPressed(object sender, PointerPressedEventArgs e)
{
if (!e.Handled
&& ViewModel != null
&& e.GetCurrentPoint(this).Properties.IsLeftButtonPressed
&& sender is StyledElement control
&& control.DataContext is RootDriveInfo rootDriveInfo)
{
ViewModel.CommandHandlerService.OpenContainer(rootDriveInfo.Container);
e.Handled = true;
}
}
private void OnWindowClosed(object sender, EventArgs e)
{
try