Display conditions - Some work on inputs supporting multiple types

This commit is contained in:
SpoinkyNL committed 2020-07-07 22:28:32 +02:00
1 parent f617a6461a
commit b869078f08
16 files changed
+112 -49

No files matched your search

@@ -3,8 +3,6 @@
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:Artemis.UI.DataModelVisualization.Input"
xmlns:System="clr-namespace:System;assembly=System.Runtime"
xmlns:b="http://schemas.microsoft.com/xaml/behaviors"
xmlns:behaviors="clr-namespace:Artemis.UI.Shared.Behaviors;assembly=Artemis.UI.Shared"
xmlns:s="https://github.com/canton7/Stylet"
@@ -2,6 +2,7 @@
using System.Windows.Input;
using Artemis.Core.Plugins.Abstract.DataModels.Attributes;
using Artemis.UI.Shared.DataModelVisualization;
using FluentValidation.TestHelper;
namespace Artemis.UI.DataModelVisualization.Input
{
@@ -3,8 +3,6 @@
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:Artemis.UI.DataModelVisualization.Input"
xmlns:System="clr-namespace:System;assembly=System.Runtime"
xmlns:b="http://schemas.microsoft.com/xaml/behaviors"
xmlns:behaviors="clr-namespace:Artemis.UI.Shared.Behaviors;assembly=Artemis.UI.Shared"
xmlns:s="https://github.com/canton7/Stylet"
@@ -1,4 +1,5 @@
using System.Text.RegularExpressions;
using System;
using System.Text.RegularExpressions;
using System.Windows.Input;
using Artemis.Core.Plugins.Abstract.DataModels.Attributes;
using Artemis.UI.Shared.DataModelVisualization;
@@ -16,5 +17,10 @@ namespace Artemis.UI.DataModelVisualization.Input
var regex = new Regex("[^0-9]+");
e.Handled = regex.IsMatch(e.Text);
}
protected override int ConvertToSupportedType(object source)
{
return Convert.ToInt32(source);
}
}
}
@@ -3,8 +3,6 @@
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:Artemis.UI.DataModelVisualization.Input"
xmlns:System="clr-namespace:System;assembly=System.Runtime"
xmlns:b="http://schemas.microsoft.com/xaml/behaviors"
xmlns:behaviors="clr-namespace:Artemis.UI.Shared.Behaviors;assembly=Artemis.UI.Shared"
mc:Ignorable="d"
@@ -37,9 +37,9 @@ namespace Artemis.UI.Services
if (_registeredBuiltInDataModelInputs)
return;
_dataModelVisualizationService.RegisterDataModelInput<StringDataModelInputViewModel>(Constants.CorePluginInfo);
_dataModelVisualizationService.RegisterDataModelInput<IntDataModelInputViewModel>(Constants.CorePluginInfo);
_dataModelVisualizationService.RegisterDataModelInput<DoubleDataModelInputViewModel>(Constants.CorePluginInfo);
_dataModelVisualizationService.RegisterDataModelInput<StringDataModelInputViewModel>(Constants.CorePluginInfo, Constants.NumberTypes);
_dataModelVisualizationService.RegisterDataModelInput<IntDataModelInputViewModel>(Constants.CorePluginInfo, Constants.NumberTypes);
_dataModelVisualizationService.RegisterDataModelInput<DoubleDataModelInputViewModel>(Constants.CorePluginInfo, Constants.NumberTypes);
_registeredBuiltInDataModelInputs = true;
}
+4 -3
View File
@@ -1,4 +1,5 @@
using System.Windows;
using System;
using System.Windows;
using MaterialDesignExtensions.Controls;
namespace Artemis.UI.Utilities
@@ -22,8 +23,8 @@ namespace Artemis.UI.Utilities
public void ApplyToWindow(MaterialWindow window)
{
window.Top = Top;
window.Left = Left;
window.Top = Math.Max(0, Top);
window.Left = Math.Max(0, Left);
window.Height = Height;
window.Width = Width;
window.WindowState = IsMaximized ? WindowState.Maximized : WindowState.Normal;