From a4fb00010ebe6f6f67d0e2314cc3eaceafd9167e Mon Sep 17 00:00:00 2001 From: Andreas Billmann Date: Mon, 7 Aug 2023 19:22:39 +0200 Subject: [PATCH] Make double click working --- K8sFileBrowser/Models/FileInformation.cs | 1 + K8sFileBrowser/Views/MainWindow.axaml | 62 +++++++++++++++++++----- 2 files changed, 51 insertions(+), 12 deletions(-) diff --git a/K8sFileBrowser/Models/FileInformation.cs b/K8sFileBrowser/Models/FileInformation.cs index ca9105a..8e34a1b 100644 --- a/K8sFileBrowser/Models/FileInformation.cs +++ b/K8sFileBrowser/Models/FileInformation.cs @@ -6,6 +6,7 @@ public class FileInformation { public string Parent { get; set; } = string.Empty; public FileType Type { get; set; } = FileType.File; + public string DisplayName => Parent.Length < 2 ? Name[Parent.Length..] : Name[( Parent.Length + 1)..]; public string Name { get; set; } = string.Empty; public string Size { get; set; } = string.Empty; public DateTimeOffset Date { get; set; } = DateTimeOffset.MinValue; diff --git a/K8sFileBrowser/Views/MainWindow.axaml b/K8sFileBrowser/Views/MainWindow.axaml index cba93aa..f993b96 100644 --- a/K8sFileBrowser/Views/MainWindow.axaml +++ b/K8sFileBrowser/Views/MainWindow.axaml @@ -8,12 +8,11 @@ x:Class="K8sFileBrowser.Views.MainWindow" x:DataType="vm:MainWindowViewModel" Icon="/Assets/app.ico" - Title="K8sFileBrowser" - DataContext="{DynamicResource ViewModel}"> - - - - + Title="K8sFileBrowser"> + + + + @@ -116,24 +115,63 @@ - - + + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - -