Linux input provider - Style fixes

Nodes - Added display value node
Nodes - Updated help link
This commit is contained in:
Robert committed 2022-08-20 21:48:46 +02:00
1 parent f9b3bc9377
commit 7a7d0ab387
16 files changed
+780 -73

No files matched your search

@@ -31,6 +31,20 @@ namespace Artemis.UI.Shared.Services
/// <param name="exception">The exception to display</param>
void ShowExceptionDialog(string title, Exception exception);
/// <summary>
/// Creates a view model instance of type <typeparamref name="TViewModel" /> and shows its corresponding View as a
/// dialog
/// </summary>
/// <typeparam name="TViewModel">The type of view model to create</typeparam>
/// <returns>The created view model</returns>
Task<TViewModel> ShowDialogAsync<TViewModel>(params (string name, object value)[] parameters);
/// <summary>
/// Given a ViewModel, show its corresponding View as a dialog
/// </summary>
/// <param name="viewModel">ViewModel to show the View for</param>
Task ShowDialogAsync(object viewModel);
/// <summary>
/// Given an existing ViewModel, show its corresponding View as a Dialog
/// </summary>
@@ -53,6 +53,32 @@ namespace Artemis.UI.Shared.Services
return window;
}
public async Task<T> ShowDialogAsync<T>(params (string name, object value)[] parameters)
{
IParameter[] paramsArray = parameters.Select(kv => new ConstructorArgument(kv.name, kv.value)).Cast<IParameter>().ToArray();
T viewModel = _kernel.Get<T>(paramsArray)!;
await ShowDialogAsync(viewModel);
return viewModel;
}
public async Task ShowDialogAsync(object viewModel)
{
Window? parent = GetCurrentWindow();
string name = viewModel.GetType().FullName!.Split('`')[0].Replace("ViewModel", "View");
Type? type = viewModel.GetType().Assembly.GetType(name);
if (type == null)
throw new ArtemisSharedUIException($"Failed to find a window named {name}.");
if (!type.IsAssignableTo(typeof(Window)))
throw new ArtemisSharedUIException($"Type {name} is not a window.");
Window window = (Window) Activator.CreateInstance(type)!;
window.DataContext = viewModel;
await window.ShowDialog(parent);
}
public async Task<TResult> ShowDialogAsync<TViewModel, TResult>(params (string name, object? value)[] parameters) where TViewModel : DialogViewModelBase<TResult>
{
IParameter[] paramsArray = parameters.Select(kv => new ConstructorArgument(kv.name, kv.value)).Cast<IParameter>().ToArray();
@@ -119,7 +145,7 @@ namespace Artemis.UI.Shared.Services
throw new ArtemisSharedUIException("Can't show a content dialog without any windows being shown.");
return new ContentDialogBuilder(_kernel, currentWindow);
}
public OpenFolderDialogBuilder CreateOpenFolderDialog()
{
Window? currentWindow = GetCurrentWindow();
+106 -11
View File
@@ -17,6 +17,18 @@
"System.ValueTuple": "4.5.0"
}
},
"Avalonia.Diagnostics": {
"type": "Direct",
"requested": "[0.10.18, )",
"resolved": "0.10.18",
"contentHash": "3PjA6r0mmRUeS+R34VtYAyzmlPeqflsQ9B8E2TrZKGke0Wo6t3JsvPWA8ynA/ii0icPnnn7nmQaEZQs07ZthxQ==",
"dependencies": {
"Avalonia": "0.10.18",
"Avalonia.Controls.DataGrid": "0.10.18",
"Microsoft.CodeAnalysis.CSharp.Scripting": "3.4.0",
"System.Reactive": "5.0.0"
}
},
"Avalonia.ReactiveUI": {
"type": "Direct",
"requested": "[0.10.18, )",
@@ -113,11 +125,11 @@
},
"Avalonia.Controls.DataGrid": {
"type": "Transitive",
"resolved": "0.10.15",
"contentHash": "a0A0RcZU1FSCUxKHkYP49df9HjlvU9gdS+DqF6VR7zc3TYbaFwLHF0pg5fsjkW/FMgzUfO70NX/WwpDeu6celg==",
"resolved": "0.10.18",
"contentHash": "LDNZxnzk++GgBeUKsqmeWJDQgF83C4Quk4Wn0z5P6vIm1f5YSSFJL6JbibbIAvjqlGjqWWFTBZpHMUNjdyw4Aw==",
"dependencies": {
"Avalonia": "0.10.15",
"Avalonia.Remote.Protocol": "0.10.15",
"Avalonia": "0.10.18",
"Avalonia.Remote.Protocol": "0.10.18",
"JetBrains.Annotations": "10.3.0",
"System.Reactive": "5.0.0"
}
@@ -316,6 +328,75 @@
"resolved": "0.10.4",
"contentHash": "enc2U+/1UnF3rtocxb5ofcg7cJSmJI4adbYPr8DZa5bQzvhqA/VbjlcalxoqjI3CR2RvM5WWpjKT0p3BriFJjw=="
},
"Microsoft.CodeAnalysis.Analyzers": {
"type": "Transitive",
"resolved": "2.9.6",
"contentHash": "Kmms3TxGQMNb95Cu/3K+0bIcMnV4qf/phZBLAB0HUi65rBPxP4JO3aM2LoAcb+DFS600RQJMZ7ZLyYDTbLwJOQ=="
},
"Microsoft.CodeAnalysis.Common": {
"type": "Transitive",
"resolved": "3.4.0",
"contentHash": "3ncA7cV+iXGA1VYwe2UEZXcvWyZSlbexWjM9AvocP7sik5UD93qt9Hq0fMRGk0jFRmvmE4T2g+bGfXiBVZEhLw==",
"dependencies": {
"Microsoft.CodeAnalysis.Analyzers": "2.9.6",
"System.Collections.Immutable": "1.5.0",
"System.Memory": "4.5.3",
"System.Reflection.Metadata": "1.6.0",
"System.Runtime.CompilerServices.Unsafe": "4.5.2",
"System.Text.Encoding.CodePages": "4.5.1",
"System.Threading.Tasks.Extensions": "4.5.3"
}
},
"Microsoft.CodeAnalysis.CSharp": {
"type": "Transitive",
"resolved": "3.4.0",
"contentHash": "/LsTtgcMN6Tu1oo7/WYbRAHL4/ubXC/miEakwTpcZKJKtFo7D0AK95Hw0dbGxul6C8WJu60v6NP2435TDYZM+Q==",
"dependencies": {
"Microsoft.CodeAnalysis.Common": "[3.4.0]"
}
},
"Microsoft.CodeAnalysis.CSharp.Scripting": {
"type": "Transitive",
"resolved": "3.4.0",
"contentHash": "tLgqc76qXHmONUhWhxo7z3TcL/LmGFWIUJm1exbQmVJohuQvJnejUMxmVkdxDfMuMZU1fIyJXPZ6Fkp4FEneAg==",
"dependencies": {
"Microsoft.CSharp": "4.3.0",
"Microsoft.CodeAnalysis.CSharp": "[3.4.0]",
"Microsoft.CodeAnalysis.Common": "[3.4.0]",
"Microsoft.CodeAnalysis.Scripting.Common": "[3.4.0]"
}
},
"Microsoft.CodeAnalysis.Scripting.Common": {
"type": "Transitive",
"resolved": "3.4.0",
"contentHash": "+b6I3DZL2zvck+B/E/aiOveakj5U2G2BcYODQxcGh2IDbatNU3XXxGT1HumkWB5uIZI2Leu0opBgBpjScmjGMA==",
"dependencies": {
"Microsoft.CodeAnalysis.Common": "[3.4.0]"
}
},
"Microsoft.CSharp": {
"type": "Transitive",
"resolved": "4.3.0",
"contentHash": "P+MBhIM0YX+JqROuf7i306ZLJEjQYA9uUyRDE+OqwUI5sh41e2ZbPQV3LfAPh+29cmceE1pUffXsGfR4eMY3KA==",
"dependencies": {
"System.Collections": "4.3.0",
"System.Diagnostics.Debug": "4.3.0",
"System.Dynamic.Runtime": "4.3.0",
"System.Globalization": "4.3.0",
"System.Linq": "4.3.0",
"System.Linq.Expressions": "4.3.0",
"System.ObjectModel": "4.3.0",
"System.Reflection": "4.3.0",
"System.Reflection.Extensions": "4.3.0",
"System.Reflection.Primitives": "4.3.0",
"System.Reflection.TypeExtensions": "4.3.0",
"System.Resources.ResourceManager": "4.3.0",
"System.Runtime": "4.3.0",
"System.Runtime.Extensions": "4.3.0",
"System.Runtime.InteropServices": "4.3.0",
"System.Threading": "4.3.0"
}
},
"Microsoft.DotNet.PlatformAbstractions": {
"type": "Transitive",
"resolved": "3.1.6",
@@ -664,6 +745,11 @@
"System.Threading.Tasks": "4.3.0"
}
},
"System.Collections.Immutable": {
"type": "Transitive",
"resolved": "1.5.0",
"contentHash": "EXKiDFsChZW0RjrZ4FYHu9aW6+P4MCgEDCklsVseRfhoO0F+dXeMSsMRAlVXIo06kGJ/zv+2w1a2uc2+kxxSaQ=="
},
"System.Collections.NonGeneric": {
"type": "Transitive",
"resolved": "4.3.0",
@@ -1121,6 +1207,11 @@
"System.Runtime": "4.3.0"
}
},
"System.Reflection.Metadata": {
"type": "Transitive",
"resolved": "1.6.0",
"contentHash": "COC1aiAJjCoA5GBF+QKL2uLqEBew4JsCkQmoHKbN3TlOZKa2fKLz5CpiRQKDz0RsAOEGsVKqOD5bomsXq/4STQ=="
},
"System.Reflection.Primitives": {
"type": "Transitive",
"resolved": "4.3.0",
@@ -1392,6 +1483,15 @@
"System.Runtime": "4.3.0"
}
},
"System.Text.Encoding.CodePages": {
"type": "Transitive",
"resolved": "4.5.1",
"contentHash": "4J2JQXbftjPMppIHJ7IC+VXQ9XfEagN92vZZNoG12i+zReYlim5dMoXFC1Zzg7tsnKDM7JPo5bYfFK4Jheq44w==",
"dependencies": {
"Microsoft.NETCore.Platforms": "2.1.2",
"System.Runtime.CompilerServices.Unsafe": "4.5.2"
}
},
"System.Text.Encoding.Extensions": {
"type": "Transitive",
"resolved": "4.3.0",
@@ -1432,13 +1532,8 @@
},
"System.Threading.Tasks.Extensions": {
"type": "Transitive",
"resolved": "4.3.0",
"contentHash": "npvJkVKl5rKXrtl1Kkm6OhOUaYGEiF9wFbppFRWSMoApKzt2PiPHT2Bb8a5sAWxprvdOAtvaARS9QYMznEUtug==",
"dependencies": {
"System.Collections": "4.3.0",
"System.Runtime": "4.3.0",
"System.Threading.Tasks": "4.3.0"
}
"resolved": "4.5.3",
"contentHash": "+MvhNtcvIbqmhANyKu91jQnvIRVSTiaOiFNfKWwXGHG48YAb4I/TyH8spsySiPYla7gKal5ZnF3teJqZAximyQ=="
},
"System.Threading.Timer": {
"type": "Transitive",