From ce383468ea288d98cc9acefd2bd00d6ecc855255 Mon Sep 17 00:00:00 2001 From: Robert Beekman Date: Sat, 26 Oct 2019 21:54:25 +0200 Subject: [PATCH] Added dialog system Added surface delete --- .../Plugins/Models/PluginSetting.cs | 8 +- .../Plugins/Models/PluginSettings.cs | 3 +- .../Services/Storage/SurfaceService.cs | 3 +- src/Artemis.UI/Artemis.UI.csproj | 26 +++++- .../Converters/NullToImageConverter.cs | 22 +++++ src/Artemis.UI/Ninject/UiModule.cs | 25 +++++- src/Artemis.UI/Services/DialogService.cs | 70 ++++++++++++++++ .../Services/Interfaces/IDialogService.cs | 14 ++++ .../Stylet/FluentValidationAdapter.cs | 42 ++++++++++ .../Dialogs/ConfirmDialogViewModel.cs | 28 +++++++ .../ViewModels/Dialogs/DialogViewModelBase.cs | 29 +++++++ .../Dialogs/SurfaceCreateViewModel.cs | 29 +++++++ .../SurfaceCreateViewModelValidator.cs | 12 +++ .../Screens/SurfaceEditorViewModel.cs | 44 +++++----- .../Utilities/DialogViewModelHost.cs | 28 +++++++ .../{ => Utilities}/PanZoomViewModel.cs | 6 +- .../ProfileEditor/ProfileDeviceView.xaml | 12 ++- .../ProfileEditor/ProfileLedView.xaml | 10 ++- .../SurfaceEditor/SurfaceDeviceView.xaml | 3 +- .../SurfaceEditor/SurfaceLedView.xaml | 10 ++- .../Views/Dialogs/ConfirmDialogView.xaml | 22 +++++ .../Views/Dialogs/SurfaceCreateView.xaml | 37 +++++++++ .../Views/Screens/SurfaceEditorView.xaml | 81 +++++++------------ src/Artemis.UI/packages.config | 2 + 24 files changed, 470 insertions(+), 96 deletions(-) create mode 100644 src/Artemis.UI/Converters/NullToImageConverter.cs create mode 100644 src/Artemis.UI/Services/DialogService.cs create mode 100644 src/Artemis.UI/Services/Interfaces/IDialogService.cs create mode 100644 src/Artemis.UI/Stylet/FluentValidationAdapter.cs create mode 100644 src/Artemis.UI/ViewModels/Dialogs/ConfirmDialogViewModel.cs create mode 100644 src/Artemis.UI/ViewModels/Dialogs/DialogViewModelBase.cs create mode 100644 src/Artemis.UI/ViewModels/Dialogs/SurfaceCreateViewModel.cs create mode 100644 src/Artemis.UI/ViewModels/Dialogs/SurfaceCreateViewModelValidator.cs create mode 100644 src/Artemis.UI/ViewModels/Utilities/DialogViewModelHost.cs rename src/Artemis.UI/ViewModels/{ => Utilities}/PanZoomViewModel.cs (95%) create mode 100644 src/Artemis.UI/Views/Dialogs/ConfirmDialogView.xaml create mode 100644 src/Artemis.UI/Views/Dialogs/SurfaceCreateView.xaml diff --git a/src/Artemis.Core/Plugins/Models/PluginSetting.cs b/src/Artemis.Core/Plugins/Models/PluginSetting.cs index 7d8af0994..876a3d1e7 100644 --- a/src/Artemis.Core/Plugins/Models/PluginSetting.cs +++ b/src/Artemis.Core/Plugins/Models/PluginSetting.cs @@ -1,6 +1,5 @@ using System.Threading.Tasks; using Artemis.Storage.Entities; -using Artemis.Storage.Repositories; using Artemis.Storage.Repositories.Interfaces; using Newtonsoft.Json; @@ -8,6 +7,7 @@ namespace Artemis.Core.Plugins.Models { public class PluginSetting { + // ReSharper disable once NotAccessedField.Local private readonly PluginInfo _pluginInfo; private readonly PluginSettingEntity _pluginSettingEntity; private readonly IPluginSettingRepository _pluginSettingRepository; @@ -50,6 +50,9 @@ namespace Artemis.Core.Plugins.Models /// public void Save() { + if (!HasChanged) + return; + _pluginSettingEntity.Value = JsonConvert.SerializeObject(Value); _pluginSettingRepository.Save(); } @@ -60,6 +63,9 @@ namespace Artemis.Core.Plugins.Models /// public async Task SaveAsync() { + if (!HasChanged) + return; + _pluginSettingEntity.Value = JsonConvert.SerializeObject(Value); await _pluginSettingRepository.SaveAsync(); } diff --git a/src/Artemis.Core/Plugins/Models/PluginSettings.cs b/src/Artemis.Core/Plugins/Models/PluginSettings.cs index 351da09b9..f4c32d04d 100644 --- a/src/Artemis.Core/Plugins/Models/PluginSettings.cs +++ b/src/Artemis.Core/Plugins/Models/PluginSettings.cs @@ -1,7 +1,6 @@ using System.Collections.Generic; using System.Linq; using Artemis.Storage.Entities; -using Artemis.Storage.Repositories; using Artemis.Storage.Repositories.Interfaces; using Newtonsoft.Json; @@ -28,7 +27,7 @@ namespace Artemis.Core.Plugins.Models var settingEntity = new PluginSettingEntity {Name = name, PluginGuid = _pluginInfo.Guid, Value = JsonConvert.SerializeObject(defaultValue)}; _pluginSettingRepository.Add(settingEntity); _pluginSettingRepository.Save(); - + _settingEntities.Add(name, settingEntity); return new PluginSetting(_pluginInfo, _pluginSettingRepository, _settingEntities[name]); } diff --git a/src/Artemis.Core/Services/Storage/SurfaceService.cs b/src/Artemis.Core/Services/Storage/SurfaceService.cs index 900359b9c..42ca397df 100644 --- a/src/Artemis.Core/Services/Storage/SurfaceService.cs +++ b/src/Artemis.Core/Services/Storage/SurfaceService.cs @@ -122,10 +122,11 @@ namespace Artemis.Core.Services.Storage lock (_surfaceConfigurations) { + var entity = surfaceConfiguration.SurfaceEntity; surfaceConfiguration.Destroy(); _surfaceConfigurations.Remove(surfaceConfiguration); - _surfaceRepository.Remove(surfaceConfiguration.SurfaceEntity); + _surfaceRepository.Remove(entity); _surfaceRepository.Save(); } } diff --git a/src/Artemis.UI/Artemis.UI.csproj b/src/Artemis.UI/Artemis.UI.csproj index 6938f4f6d..dd4d2c624 100644 --- a/src/Artemis.UI/Artemis.UI.csproj +++ b/src/Artemis.UI/Artemis.UI.csproj @@ -69,6 +69,9 @@ ..\packages\ControlzEx.3.0.2.4\lib\net462\ControlzEx.dll + + ..\packages\FluentValidation.8.5.0\lib\net45\FluentValidation.dll + ..\packages\Humanizer.Core.2.6.2\lib\netstandard2.0\Humanizer.dll @@ -123,6 +126,10 @@ ..\packages\Stylet.1.3.0\lib\net45\Stylet.dll + + ..\packages\System.ComponentModel.Annotations.4.6.0\lib\net461\System.ComponentModel.Annotations.dll + + @@ -148,6 +155,7 @@ + @@ -157,14 +165,22 @@ True Resources.resx + + + - + + + + + + @@ -187,6 +203,14 @@ MSBuild:Compile Designer + + Designer + MSBuild:Compile + + + Designer + MSBuild:Compile + Designer MSBuild:Compile diff --git a/src/Artemis.UI/Converters/NullToImageConverter.cs b/src/Artemis.UI/Converters/NullToImageConverter.cs new file mode 100644 index 000000000..73e1bfbce --- /dev/null +++ b/src/Artemis.UI/Converters/NullToImageConverter.cs @@ -0,0 +1,22 @@ +using System; +using System.Globalization; +using System.Windows; +using System.Windows.Data; + +namespace Artemis.UI.Converters +{ + public class NullToImageConverter : IValueConverter + { + public object Convert(object value, Type targetType, object parameter, CultureInfo culture) + { + if (value == null) + return DependencyProperty.UnsetValue; + return value; + } + + public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) + { + return Binding.DoNothing; + } + } +} \ No newline at end of file diff --git a/src/Artemis.UI/Ninject/UiModule.cs b/src/Artemis.UI/Ninject/UiModule.cs index 9f7fe984a..a2c16e716 100644 --- a/src/Artemis.UI/Ninject/UiModule.cs +++ b/src/Artemis.UI/Ninject/UiModule.cs @@ -1,7 +1,11 @@ using Artemis.UI.Services.Interfaces; +using Artemis.UI.Stylet; +using Artemis.UI.ViewModels.Dialogs; using Artemis.UI.ViewModels.Interfaces; +using FluentValidation; using Ninject.Extensions.Conventions; using Ninject.Modules; +using Stylet; namespace Artemis.UI.Ninject { @@ -10,7 +14,7 @@ namespace Artemis.UI.Ninject { public override void Load() { - // Bind all built-in viewmodels + // Bind all built-in VMs Kernel.Bind(x => { x.FromThisAssembly() @@ -19,6 +23,15 @@ namespace Artemis.UI.Ninject .BindAllInterfaces(); }); + // Bind all dialog VMs + Kernel.Bind(x => + { + x.FromThisAssembly() + .SelectAllClasses() + .InheritedFrom() + .BindAllBaseClasses(); + }); + // Bind all UI services as singletons Kernel.Bind(x => { @@ -28,6 +41,16 @@ namespace Artemis.UI.Ninject .BindAllInterfaces() .Configure(c => c.InSingletonScope()); }); + + // Bind all validators + Bind(typeof(IModelValidator<>)).To(typeof(FluentValidationAdapter<>)); + Kernel.Bind(x => + { + x.FromThisAssembly() + .SelectAllClasses() + .InheritedFrom() + .BindAllInterfaces(); + }); } } } \ No newline at end of file diff --git a/src/Artemis.UI/Services/DialogService.cs b/src/Artemis.UI/Services/DialogService.cs new file mode 100644 index 000000000..98fcdd252 --- /dev/null +++ b/src/Artemis.UI/Services/DialogService.cs @@ -0,0 +1,70 @@ +using System.Threading.Tasks; +using Artemis.UI.Services.Interfaces; +using Artemis.UI.ViewModels.Dialogs; +using MaterialDesignThemes.Wpf; +using Ninject; +using Ninject.Parameters; +using Stylet; + +namespace Artemis.UI.Services +{ + public class DialogService : IDialogService + { + private readonly IKernel _kernel; + private readonly IViewManager _viewManager; + + public DialogService(IKernel kernel, IViewManager viewManager) + { + _kernel = kernel; + _viewManager = viewManager; + } + + public async Task ShowConfirmDialog(string header, string text, string confirmText = "Confirm", string cancelText = "Cancel") + { + var arguments = new IParameter[] + { + new ConstructorArgument("header", header), + new ConstructorArgument("text", text), + new ConstructorArgument("confirmText", confirmText), + new ConstructorArgument("cancelText", cancelText), + }; + var result = await ShowDialog(arguments); + return (bool)result; + } + + public async Task ShowConfirmDialogAt(string identifier, string header, string text, string confirmText = "Confirm", string cancelText = "Cancel") + { + var arguments = new IParameter[] + { + new ConstructorArgument("header", header), + new ConstructorArgument("text", text), + new ConstructorArgument("confirmText", confirmText), + new ConstructorArgument("cancelText", cancelText), + }; + var result = await ShowDialogAt(identifier, arguments); + return (bool) result; + } + + public async Task ShowDialog(IParameter[] parameters = null) where T : DialogViewModelBase + { + var viewModel = parameters != null ? _kernel.Get(parameters) : _kernel.Get(); + return await ShowDialog(null, viewModel); + } + + public async Task ShowDialogAt(string identifier, IParameter[] parameters = null) where T : DialogViewModelBase + { + var viewModel = parameters != null ? _kernel.Get(parameters) : _kernel.Get(); + return await ShowDialog(identifier, viewModel); + } + + private async Task ShowDialog(string identifier, DialogViewModelBase viewModel) + { + var view = _viewManager.CreateViewForModel(viewModel); + _viewManager.BindViewToModel(view, viewModel); + + if (identifier == null) + return await DialogHost.Show(view, viewModel.OnDialogClosed); + return await DialogHost.Show(view, identifier, viewModel.OnDialogOpened, viewModel.OnDialogClosed); + } + } +} \ No newline at end of file diff --git a/src/Artemis.UI/Services/Interfaces/IDialogService.cs b/src/Artemis.UI/Services/Interfaces/IDialogService.cs new file mode 100644 index 000000000..d8591ce36 --- /dev/null +++ b/src/Artemis.UI/Services/Interfaces/IDialogService.cs @@ -0,0 +1,14 @@ +using System.Threading.Tasks; +using Artemis.UI.ViewModels.Dialogs; +using Ninject.Parameters; + +namespace Artemis.UI.Services.Interfaces +{ + public interface IDialogService : IArtemisUIService + { + Task ShowConfirmDialog(string header, string text, string confirmText = "Confirm", string cancelText = "Cancel"); + Task ShowConfirmDialogAt(string identifier, string header, string text, string confirmText = "Confirm", string cancelText = "Cancel"); + Task ShowDialog(IParameter[] parameters = null) where T : DialogViewModelBase; + Task ShowDialogAt(string identifier, IParameter[] parameters = null) where T : DialogViewModelBase; + } +} \ No newline at end of file diff --git a/src/Artemis.UI/Stylet/FluentValidationAdapter.cs b/src/Artemis.UI/Stylet/FluentValidationAdapter.cs new file mode 100644 index 000000000..a9c118a49 --- /dev/null +++ b/src/Artemis.UI/Stylet/FluentValidationAdapter.cs @@ -0,0 +1,42 @@ +using System.Collections.Generic; +using System.Linq; +using System.Threading; +using System.Threading.Tasks; +using FluentValidation; +using Stylet; + +namespace Artemis.UI.Stylet +{ + public class FluentValidationAdapter : IModelValidator + { + private readonly IValidator _validator; + private T _subject; + + public FluentValidationAdapter(IValidator validator) + { + _validator = validator; + } + + public void Initialize(object subject) + { + _subject = (T) subject; + } + + public async Task> ValidatePropertyAsync(string propertyName) + { + // If someone's calling us synchronously, and ValidationAsync does not complete synchronously, + // we'll deadlock unless we continue on another thread. + return (await _validator.ValidateAsync(_subject, CancellationToken.None, propertyName).ConfigureAwait(false)) + .Errors.Select(x => x.ErrorMessage); + } + + public async Task>> ValidateAllPropertiesAsync() + { + // If someone's calling us synchronously, and ValidationAsync does not complete synchronously, + // we'll deadlock unless we continue on another thread. + return (await _validator.ValidateAsync(_subject).ConfigureAwait(false)) + .Errors.GroupBy(x => x.PropertyName) + .ToDictionary(x => x.Key, x => x.Select(failure => failure.ErrorMessage)); + } + } +} \ No newline at end of file diff --git a/src/Artemis.UI/ViewModels/Dialogs/ConfirmDialogViewModel.cs b/src/Artemis.UI/ViewModels/Dialogs/ConfirmDialogViewModel.cs new file mode 100644 index 000000000..20b7e2893 --- /dev/null +++ b/src/Artemis.UI/ViewModels/Dialogs/ConfirmDialogViewModel.cs @@ -0,0 +1,28 @@ +namespace Artemis.UI.ViewModels.Dialogs +{ + public class ConfirmDialogViewModel : DialogViewModelBase + { + public ConfirmDialogViewModel(string header, string text, string confirmText, string cancelText) + { + Header = header; + Text = text; + ConfirmText = confirmText; + CancelText = cancelText; + } + + public string Header { get; } + public string Text { get; } + public string ConfirmText { get; } + public string CancelText { get; } + + public void Confirm() + { + Session.Close(true); + } + + public void Cancel() + { + Session.Close(false); + } + } +} \ No newline at end of file diff --git a/src/Artemis.UI/ViewModels/Dialogs/DialogViewModelBase.cs b/src/Artemis.UI/ViewModels/Dialogs/DialogViewModelBase.cs new file mode 100644 index 000000000..98c45d7f8 --- /dev/null +++ b/src/Artemis.UI/ViewModels/Dialogs/DialogViewModelBase.cs @@ -0,0 +1,29 @@ +using Artemis.UI.ViewModels.Utilities; +using MaterialDesignThemes.Wpf; +using Stylet; + +namespace Artemis.UI.ViewModels.Dialogs +{ + public abstract class DialogViewModelBase : ValidatingModelBase + { + protected DialogViewModelBase(IModelValidator validator) : base(validator) + { + } + + protected DialogViewModelBase() + { + } + + public DialogViewModelHost DialogViewModelHost { get; set; } + public DialogSession Session { get; private set; } + + public void OnDialogOpened(object sender, DialogOpenedEventArgs e) + { + Session = e.Session; + } + + public virtual void OnDialogClosed(object sender, DialogClosingEventArgs e) + { + } + } +} \ No newline at end of file diff --git a/src/Artemis.UI/ViewModels/Dialogs/SurfaceCreateViewModel.cs b/src/Artemis.UI/ViewModels/Dialogs/SurfaceCreateViewModel.cs new file mode 100644 index 000000000..4f9322197 --- /dev/null +++ b/src/Artemis.UI/ViewModels/Dialogs/SurfaceCreateViewModel.cs @@ -0,0 +1,29 @@ +using System.Threading.Tasks; +using Stylet; + +namespace Artemis.UI.ViewModels.Dialogs +{ + public class SurfaceCreateViewModel : DialogViewModelBase + { + public SurfaceCreateViewModel(IModelValidator validator) : base(validator) + { + } + + public string SurfaceName { get; set; } + + public async Task Accept() + { + await ValidateAsync(); + + if (HasErrors) + return; + + Session.Close(SurfaceName); + } + + public void Cancel() + { + Session.Close(); + } + } +} \ No newline at end of file diff --git a/src/Artemis.UI/ViewModels/Dialogs/SurfaceCreateViewModelValidator.cs b/src/Artemis.UI/ViewModels/Dialogs/SurfaceCreateViewModelValidator.cs new file mode 100644 index 000000000..111824640 --- /dev/null +++ b/src/Artemis.UI/ViewModels/Dialogs/SurfaceCreateViewModelValidator.cs @@ -0,0 +1,12 @@ +using FluentValidation; + +namespace Artemis.UI.ViewModels.Dialogs +{ + public class SurfaceCreateViewModelValidator : AbstractValidator + { + public SurfaceCreateViewModelValidator() + { + RuleFor(m => m.SurfaceName).NotEmpty().WithMessage("Layout name may not be empty"); + } + } +} \ No newline at end of file diff --git a/src/Artemis.UI/ViewModels/Screens/SurfaceEditorViewModel.cs b/src/Artemis.UI/ViewModels/Screens/SurfaceEditorViewModel.cs index c6d0a3576..e8722601a 100644 --- a/src/Artemis.UI/ViewModels/Screens/SurfaceEditorViewModel.cs +++ b/src/Artemis.UI/ViewModels/Screens/SurfaceEditorViewModel.cs @@ -1,40 +1,40 @@ using System; -using System.Collections.Generic; using System.Collections.ObjectModel; using System.Linq; using System.Threading.Tasks; using System.Windows; -using System.Windows.Controls; using System.Windows.Input; using System.Windows.Media; -using Artemis.Core.Events; using Artemis.Core.Models.Surface; -using Artemis.Core.Services.Interfaces; using Artemis.Core.Services.Storage; +using Artemis.UI.Services.Interfaces; using Artemis.UI.ViewModels.Controls.SurfaceEditor; +using Artemis.UI.ViewModels.Dialogs; using Artemis.UI.ViewModels.Interfaces; +using Artemis.UI.ViewModels.Utilities; using Stylet; namespace Artemis.UI.ViewModels.Screens { public class SurfaceEditorViewModel : Screen, ISurfaceEditorViewModel { - private readonly IRgbService _rgbService; + private readonly IDialogService _dialogService; private readonly ISurfaceService _surfaceService; - public SurfaceEditorViewModel(IRgbService rgbService, ISurfaceService surfaceService) + public SurfaceEditorViewModel(ISurfaceService surfaceService, IDialogService dialogService) { Devices = new ObservableCollection(); SurfaceConfigurations = new ObservableCollection(); SelectionRectangle = new RectangleGeometry(); PanZoomViewModel = new PanZoomViewModel(); - _rgbService = rgbService; _surfaceService = surfaceService; + _dialogService = dialogService; } public RectangleGeometry SelectionRectangle { get; set; } public ObservableCollection Devices { get; set; } + public ObservableCollection SurfaceConfigurations { get; set; } public SurfaceConfiguration SelectedSurfaceConfiguration { @@ -46,14 +46,10 @@ namespace Artemis.UI.ViewModels.Screens } } - public ObservableCollection SurfaceConfigurations { get; set; } - public string NewConfigurationName { get; set; } - public PanZoomViewModel PanZoomViewModel { get; set; } - public string Title => "Surface Editor"; - public SurfaceConfiguration AddSurfaceConfiguration(string name) + public SurfaceConfiguration CreateSurfaceConfiguration(string name) { var config = _surfaceService.CreateSurfaceConfiguration(name); Execute.OnUIThread(() => SurfaceConfigurations.Add(config)); @@ -69,7 +65,7 @@ namespace Artemis.UI.ViewModels.Screens var activeConfig = _surfaceService.ActiveSurfaceConfiguration; if (activeConfig == null) { - activeConfig = AddSurfaceConfiguration("Default"); + activeConfig = CreateSurfaceConfiguration("Default"); _surfaceService.SetActiveSurfaceConfiguration(activeConfig); } @@ -121,15 +117,25 @@ namespace Artemis.UI.ViewModels.Screens #region Configuration management - public void ConfirmationDialogClosing() + public async Task DeleteSurfaceConfiguration(SurfaceConfiguration surfaceConfiguration) { - if (!string.IsNullOrWhiteSpace(NewConfigurationName)) + var result = await _dialogService.ShowConfirmDialogAt( + "SurfaceListDialogHost", + "Delete surface configuration", + "Are you sure you want to delete this surface configuration?" + ); + if (result) { - var newConfig = AddSurfaceConfiguration(NewConfigurationName); - SelectedSurfaceConfiguration = newConfig; + SurfaceConfigurations.Remove(surfaceConfiguration); + _surfaceService.DeleteSurfaceConfiguration(surfaceConfiguration); } + } - NewConfigurationName = null; + public async Task AddSurfaceConfiguration() + { + var result = await _dialogService.ShowDialogAt("SurfaceListDialogHost"); + if (result is string name) + CreateSurfaceConfiguration(name); } #endregion @@ -274,9 +280,7 @@ namespace Artemis.UI.ViewModels.Screens } } else - { _surfaceService.UpdateSurfaceConfiguration(SelectedSurfaceConfiguration, true); - } Mouse.OverrideCursor = null; _mouseDragStatus = MouseDragStatus.None; diff --git a/src/Artemis.UI/ViewModels/Utilities/DialogViewModelHost.cs b/src/Artemis.UI/ViewModels/Utilities/DialogViewModelHost.cs new file mode 100644 index 000000000..7ecb10f0f --- /dev/null +++ b/src/Artemis.UI/ViewModels/Utilities/DialogViewModelHost.cs @@ -0,0 +1,28 @@ +using Artemis.UI.ViewModels.Dialogs; +using MaterialDesignThemes.Wpf; +using Stylet; + +namespace Artemis.UI.ViewModels.Utilities +{ + public class DialogViewModelHost : PropertyChangedBase + { + private readonly IViewManager _viewManager; + + public DialogViewModelHost(IViewManager viewManager) + { + _viewManager = viewManager; + } + public DialogViewModelBase ActiveDialogViewModel { get; set; } + public bool IsOpen { get; set; } + + public void OpenDialog(DialogViewModelBase viewModel, string dialogIdentifier) + { + var view = _viewManager.CreateViewForModel(viewModel); + DialogHost.Show(view, dialogIdentifier, viewModel.OnDialogClosed); + viewModel.DialogViewModelHost = this; + + ActiveDialogViewModel = viewModel; + IsOpen = true; + } + } +} \ No newline at end of file diff --git a/src/Artemis.UI/ViewModels/PanZoomViewModel.cs b/src/Artemis.UI/ViewModels/Utilities/PanZoomViewModel.cs similarity index 95% rename from src/Artemis.UI/ViewModels/PanZoomViewModel.cs rename to src/Artemis.UI/ViewModels/Utilities/PanZoomViewModel.cs index 4a88d7781..77673dc9c 100644 --- a/src/Artemis.UI/ViewModels/PanZoomViewModel.cs +++ b/src/Artemis.UI/ViewModels/Utilities/PanZoomViewModel.cs @@ -1,15 +1,11 @@ using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; using System.Windows; using System.Windows.Controls; using System.Windows.Input; using System.Windows.Media; using Stylet; -namespace Artemis.UI.ViewModels +namespace Artemis.UI.ViewModels.Utilities { public class PanZoomViewModel : PropertyChangedBase { diff --git a/src/Artemis.UI/Views/Controls/ProfileEditor/ProfileDeviceView.xaml b/src/Artemis.UI/Views/Controls/ProfileEditor/ProfileDeviceView.xaml index 95576a614..b905ca0c7 100644 --- a/src/Artemis.UI/Views/Controls/ProfileEditor/ProfileDeviceView.xaml +++ b/src/Artemis.UI/Views/Controls/ProfileEditor/ProfileDeviceView.xaml @@ -1,4 +1,4 @@ - + + + - + @@ -21,7 +25,7 @@ - diff --git a/src/Artemis.UI/Views/Controls/ProfileEditor/ProfileLedView.xaml b/src/Artemis.UI/Views/Controls/ProfileEditor/ProfileLedView.xaml index 91dde4813..e6bd1eba1 100644 --- a/src/Artemis.UI/Views/Controls/ProfileEditor/ProfileLedView.xaml +++ b/src/Artemis.UI/Views/Controls/ProfileEditor/ProfileLedView.xaml @@ -1,17 +1,21 @@ - + + + - + diff --git a/src/Artemis.UI/Views/Controls/SurfaceEditor/SurfaceDeviceView.xaml b/src/Artemis.UI/Views/Controls/SurfaceEditor/SurfaceDeviceView.xaml index 21755f1a2..ac52a02f9 100644 --- a/src/Artemis.UI/Views/Controls/SurfaceEditor/SurfaceDeviceView.xaml +++ b/src/Artemis.UI/Views/Controls/SurfaceEditor/SurfaceDeviceView.xaml @@ -15,10 +15,11 @@ MouseLeave="{s:Action MouseLeave}" ToolTip="{Binding DeviceConfiguration.Device.DeviceInfo.DeviceName}"> + - + + + + - - + + \ No newline at end of file diff --git a/src/Artemis.UI/Views/Dialogs/ConfirmDialogView.xaml b/src/Artemis.UI/Views/Dialogs/ConfirmDialogView.xaml new file mode 100644 index 000000000..15efe9d9f --- /dev/null +++ b/src/Artemis.UI/Views/Dialogs/ConfirmDialogView.xaml @@ -0,0 +1,22 @@ + + + + + + + + + + + diff --git a/src/Artemis.UI/Views/Screens/SurfaceEditorView.xaml b/src/Artemis.UI/Views/Screens/SurfaceEditorView.xaml index 944e2577e..d9aaac840 100644 --- a/src/Artemis.UI/Views/Screens/SurfaceEditorView.xaml +++ b/src/Artemis.UI/Views/Screens/SurfaceEditorView.xaml @@ -176,37 +176,8 @@ - - - - - - Add a new surface layout. - - - - - - - - + + @@ -215,32 +186,34 @@ - + + + + + + + + + - - - - - - + diff --git a/src/Artemis.UI/packages.config b/src/Artemis.UI/packages.config index c0952b3d7..d4434cb81 100644 --- a/src/Artemis.UI/packages.config +++ b/src/Artemis.UI/packages.config @@ -2,6 +2,7 @@ + @@ -21,5 +22,6 @@ + \ No newline at end of file