|
5 | 5 | using Files.Shared.Helpers; |
6 | 6 | using System.Windows.Input; |
7 | 7 | using TagLib; |
| 8 | +using Vanara.PInvoke; |
8 | 9 |
|
9 | 10 | namespace Files.App.Data.Models |
10 | 11 | { |
@@ -526,7 +527,6 @@ public bool IsItemSelected |
526 | 527 |
|
527 | 528 | public SelectedItemsPropertiesViewModel() |
528 | 529 | { |
529 | | - |
530 | 530 | } |
531 | 531 |
|
532 | 532 | private bool isSelectedItemImage = false; |
@@ -782,6 +782,42 @@ public bool RunAsAdminEnabled |
782 | 782 | set => SetProperty(ref runAsAdminEnabled, value); |
783 | 783 | } |
784 | 784 |
|
| 785 | + private static readonly IReadOnlyDictionary<ShowWindowCommand, string> showWindowCommandTypes = new Dictionary<ShowWindowCommand, string>() |
| 786 | + { |
| 787 | + { ShowWindowCommand.SW_NORMAL, Strings.NormalWindow.GetLocalizedResource() }, |
| 788 | + { ShowWindowCommand.SW_SHOWMINNOACTIVE, Strings.Minimized.GetLocalizedResource() }, |
| 789 | + { ShowWindowCommand.SW_MAXIMIZE, Strings.Maximized.GetLocalizedResource() } |
| 790 | + }.AsReadOnly(); |
| 791 | + public IReadOnlyDictionary<ShowWindowCommand, string> ShowWindowCommandTypes { get => showWindowCommandTypes; } |
| 792 | + |
| 793 | + public string SelectedShowWindowCommand |
| 794 | + { |
| 795 | + get => ShowWindowCommandTypes.GetValueOrDefault(ShowWindowCommandEditedValue)!; |
| 796 | + set => ShowWindowCommandEditedValue = ShowWindowCommandTypes.First(e => e.Value == value).Key; |
| 797 | + } |
| 798 | + |
| 799 | + private ShowWindowCommand showWindowCommand; |
| 800 | + public ShowWindowCommand ShowWindowCommand |
| 801 | + { |
| 802 | + get => showWindowCommand; |
| 803 | + set |
| 804 | + { |
| 805 | + if (SetProperty(ref showWindowCommand, value)) |
| 806 | + ShowWindowCommandEditedValue = value; |
| 807 | + } |
| 808 | + } |
| 809 | + |
| 810 | + private ShowWindowCommand showWindowCommandEditedValue; |
| 811 | + public ShowWindowCommand ShowWindowCommandEditedValue |
| 812 | + { |
| 813 | + get => showWindowCommandEditedValue; |
| 814 | + set |
| 815 | + { |
| 816 | + if (SetProperty(ref showWindowCommandEditedValue, value)) |
| 817 | + OnPropertyChanged(nameof(SelectedShowWindowCommand)); |
| 818 | + } |
| 819 | + } |
| 820 | + |
785 | 821 | private bool isPropertiesLoaded; |
786 | 822 | public bool IsPropertiesLoaded |
787 | 823 | { |
|
0 commit comments