Shared UI - Moved initialization code

Color picker - Added toggle to preview color on devices
Settings - Added toggable auto-save
This commit is contained in:
Robert committed 2020-09-24 21:33:56 +02:00
1 parent 33373bda57
commit fa329a9048
16 files changed
+276 -103

No files matched your search

@@ -205,17 +205,23 @@ namespace Artemis.UI.Screens.ProfileEditor.LayerProperties.DataBindings
private void UpdateTestResult()
{
if (Registration.DataBinding == null)
if (Registration.DataBinding == null || ActiveItem == null)
{
TestInputValue.UpdateValue(default);
TestResultValue.UpdateValue(default);
return;
}
var currentValue = Registration.Converter.ConvertFromObject(ActiveItem?.GetTestValue() ?? default(TProperty));
TestInputValue.UpdateValue(currentValue);
TestResultValue.UpdateValue(Registration.DataBinding != null ? Registration.DataBinding.GetValue(currentValue) : default);
if (ActiveItem.SupportsTestValue)
{
var currentValue = Registration.Converter.ConvertFromObject(ActiveItem?.GetTestValue() ?? default(TProperty));
TestInputValue.UpdateValue(currentValue);
TestResultValue.UpdateValue(Registration.DataBinding != null ? Registration.DataBinding.GetValue(currentValue) : default);
}
else
{
TestResultValue.UpdateValue(Registration.DataBinding != null ? Registration.DataBinding.GetValue(default) : default);
}
}
private void EnableDataBinding()