Layer properties - Added back most of the reworked VMs and views

This commit is contained in:
SpoinkyNL committed 2020-05-18 23:56:43 +02:00
1 parent 2fd522bafb
commit 3d244ff028
21 files changed
+862 -146

No files matched your search

@@ -29,6 +29,7 @@ namespace Artemis.UI.Services
private readonly IKernel _kernel;
private TimeSpan _currentTime;
private TimeSpan _lastUpdateTime;
private int _pixelsPerSecond;
public ProfileEditorService(ICoreService coreService, IProfileService profileService, IKernel kernel)
{
@@ -46,6 +47,7 @@ namespace Artemis.UI.Services
{typeof(SKPoint), typeof(SKPointPropertyInputViewModel)},
{typeof(SKSize), typeof(SKSizePropertyInputViewModel)}
};
PixelsPerSecond = 31;
}
public Dictionary<Type, Type> RegisteredPropertyEditors { get; set; }
@@ -66,6 +68,17 @@ namespace Artemis.UI.Services
}
}
public int PixelsPerSecond
{
get => _pixelsPerSecond;
set
{
_pixelsPerSecond = value;
OnPixelsPerSecondChanged();
}
}
public LayerPropertyBaseViewModel CreateLayerPropertyViewModel(BaseLayerProperty baseLayerProperty, PropertyDescriptionAttribute propertyDescription)
{
// Go through the pain of instantiating a generic type VM now via reflection to make things a lot simpler down the line
@@ -93,7 +106,7 @@ namespace Artemis.UI.Services
{
new ConstructorArgument("layerPropertyViewModel", layerPropertyViewModel)
};
return new TreePropertyViewModel<T>(layerPropertyViewModel, (PropertyInputViewModel<T>) _kernel.Get(type, parameters));
return new TreePropertyViewModel<T>(layerPropertyViewModel, (PropertyInputViewModel<T>) _kernel.Get(type, parameters), this);
}
public void ChangeSelectedProfile(Profile profile)
@@ -181,8 +194,9 @@ namespace Artemis.UI.Services
public event EventHandler<ProfileElementEventArgs> ProfileElementSelected;
public event EventHandler<ProfileElementEventArgs> SelectedProfileElementUpdated;
public event EventHandler CurrentTimeChanged;
public event EventHandler PixelsPerSecondChanged;
public event EventHandler ProfilePreviewUpdated;
public void StopRegularRender()
{
_coreService.ModuleUpdatingDisabled = true;
@@ -218,6 +232,11 @@ namespace Artemis.UI.Services
CurrentTimeChanged?.Invoke(this, EventArgs.Empty);
}
protected virtual void OnPixelsPerSecondChanged()
{
PixelsPerSecondChanged?.Invoke(this, EventArgs.Empty);
}
protected virtual void OnProfilePreviewUpdated()
{
ProfilePreviewUpdated?.Invoke(this, EventArgs.Empty);