diff --git a/src/Artemis.Core/Models/Profile/DataBindings/Modes/Direct/DataBindingModifier.cs b/src/Artemis.Core/Models/Profile/DataBindings/Modes/Direct/DataBindingModifier.cs
index 05d4c0aba..1883517c7 100644
--- a/src/Artemis.Core/Models/Profile/DataBindings/Modes/Direct/DataBindingModifier.cs
+++ b/src/Artemis.Core/Models/Profile/DataBindings/Modes/Direct/DataBindingModifier.cs
@@ -109,6 +109,14 @@ namespace Artemis.Core
$"it does not support this data binding's type {targetType.Name}");
ModifierType = modifierType;
+
+ // Ensure the right parameter static value is never null when the parameter type is a value type
+ if (ParameterType == ProfileRightSideType.Static && modifierType.ParameterType != null)
+ {
+ if (modifierType.ParameterType.IsValueType && ParameterStaticValue == null)
+ UpdateParameterStatic(modifierType.ParameterType.GetDefault());
+ }
+
ValidateParameter();
}
@@ -200,7 +208,7 @@ namespace Artemis.Core
ParameterPath = new DataModelPath(null, Entity.ParameterPath);
}
// Static parameter
- else if (ParameterType == ProfileRightSideType.Static && Entity.ParameterStaticValue != null && ParameterStaticValue == null)
+ else if (ParameterType == ProfileRightSideType.Static && Entity.ParameterStaticValue != null)
{
// Use the target type so JSON.NET has a better idea what to do
Type parameterType = ModifierType?.ParameterType ?? DirectDataBinding.DataBinding.GetTargetType();
@@ -217,7 +225,14 @@ namespace Artemis.Core
staticValue = Activator.CreateInstance(parameterType);
}
- UpdateParameterStatic(staticValue);
+ try
+ {
+ UpdateParameterStatic(staticValue);
+ }
+ catch (Exception e)
+ {
+ DeserializationLogger.LogModifierDeserializationFailure(GetType().Name, new JsonSerializationException("The JSON deserialized into a mismatching type", e));
+ }
}
}
diff --git a/src/Artemis.Core/Services/PluginService.cs b/src/Artemis.Core/Services/PluginService.cs
index 8f25194a9..207a8727a 100644
--- a/src/Artemis.Core/Services/PluginService.cs
+++ b/src/Artemis.Core/Services/PluginService.cs
@@ -220,8 +220,7 @@ namespace Artemis.Core.Services
Type pluginType = pluginTypes.Single();
try
{
- IParameter[] parameters = new IParameter[]
- {
+ IParameter[] parameters = {
new Parameter("PluginInfo", pluginInfo, false)
};
pluginInfo.Kernel = new ChildKernel(_kernel);
diff --git a/src/Artemis.UI.Shared/DataModelVisualization/Input/DataModelStaticView.xaml b/src/Artemis.UI.Shared/DataModelVisualization/Input/DataModelStaticView.xaml
index 5b4b60bfb..a069d383a 100644
--- a/src/Artemis.UI.Shared/DataModelVisualization/Input/DataModelStaticView.xaml
+++ b/src/Artemis.UI.Shared/DataModelVisualization/Input/DataModelStaticView.xaml
@@ -71,6 +71,7 @@
Visibility="{Binding InputViewModel, Converter={StaticResource NullToVisibilityConverter}}"
CornerRadius="3"
Padding="3"
+ Margin="0 -3"
HorizontalAlignment="Left"
MinWidth="140">
diff --git a/src/Artemis.UI.Shared/Services/DataModelUIService.cs b/src/Artemis.UI.Shared/Services/DataModelUIService.cs
index 8f4e86ef1..9f164e23d 100644
--- a/src/Artemis.UI.Shared/Services/DataModelUIService.cs
+++ b/src/Artemis.UI.Shared/Services/DataModelUIService.cs
@@ -220,8 +220,7 @@ namespace Artemis.UI.Shared.Services
if (initialValue != null && initialValue.GetType() != registration.SupportedType)
initialValue = Convert.ChangeType(initialValue, registration.SupportedType);
- IParameter[] parameters = new IParameter[]
- {
+ IParameter[] parameters = {
new ConstructorArgument("targetDescription", description),
new ConstructorArgument("initialValue", initialValue)
};
diff --git a/src/Artemis.UI.Shared/Services/Dialog/DialogService.cs b/src/Artemis.UI.Shared/Services/Dialog/DialogService.cs
index e4d8d4aad..16726ca47 100644
--- a/src/Artemis.UI.Shared/Services/Dialog/DialogService.cs
+++ b/src/Artemis.UI.Shared/Services/Dialog/DialogService.cs
@@ -28,8 +28,7 @@ namespace Artemis.UI.Shared.Services
public async Task ShowConfirmDialog(string header, string text, string confirmText = "Confirm", string cancelText = "Cancel")
{
- IParameter[] arguments = new IParameter[]
- {
+ IParameter[] arguments = {
new ConstructorArgument("header", header),
new ConstructorArgument("text", text),
new ConstructorArgument("confirmText", confirmText.ToUpper()),
@@ -41,8 +40,7 @@ namespace Artemis.UI.Shared.Services
public async Task ShowConfirmDialogAt(string identifier, string header, string text, string confirmText = "Confirm", string cancelText = "Cancel")
{
- IParameter[] arguments = new IParameter[]
- {
+ IParameter[] arguments = {
new ConstructorArgument("header", header),
new ConstructorArgument("text", text),
new ConstructorArgument("confirmText", confirmText.ToUpper()),