mirror of
https://github.com/Artemis-RGB/Artemis
synced 2026-11-12 03:48:56 +00:00
Datamodel - Simplified some things
This commit is contained in:
1 parent
e184d8b724
commit
1bc8d65237
10 files changed
+111
-116
No files matched your search
@@ -0,0 +1,23 @@
|
||||
using System.Reflection;
|
||||
using Artemis.Core.Plugins.Abstract.DataModels.Attributes;
|
||||
using FastMember;
|
||||
|
||||
namespace Artemis.UI.DataModelVisualization
|
||||
{
|
||||
public class DataModelPropertyViewModel : DataModelVisualizationViewModel
|
||||
{
|
||||
private readonly ObjectAccessor _accessor;
|
||||
|
||||
public DataModelPropertyViewModel(PropertyInfo propertyInfo, DataModelPropertyAttribute propertyDescription, DataModelViewModel parent)
|
||||
{
|
||||
_accessor = ObjectAccessor.Create(parent.Model);
|
||||
|
||||
PropertyInfo = propertyInfo;
|
||||
Parent = parent;
|
||||
PropertyDescription = propertyDescription;
|
||||
}
|
||||
|
||||
public PropertyInfo PropertyInfo { get; }
|
||||
public object Value => _accessor[PropertyInfo.Name];
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user