Artemis.ViewModels.Profiles.LayerEditorViewModel.LayerEditorViewModel C# (CSharp) Method

LayerEditorViewModel() public method

public LayerEditorViewModel ( LayerModel layer, IDataModel dataModel, IEnumerable types, List layerAnimations ) : System
layer LayerModel
dataModel IDataModel
types IEnumerable
layerAnimations List
return System
        public LayerEditorViewModel(LayerModel layer, IDataModel dataModel, IEnumerable<ILayerType> types,
            List<ILayerAnimation> layerAnimations)
        {
            Layer = layer;
            ProposedLayer = Clone(layer);
            ProposedLayer.Children.Clear();
            DataModel = DataModel;
            LayerTypes = new BindableCollection<ILayerType>(types);
            LayerAnimations = layerAnimations;

            DataModelProps = new BindableCollection<PropertyCollection>(GenerateTypeMap(dataModel));

            if (Layer.Properties == null)
                Layer.SetupProperties();

            // Setup existing conditions           
            var conditions = layer.Properties.Conditions.Select(c => new LayerConditionViewModel(this, c));
            LayerConditionVms = new BindableCollection<LayerConditionViewModel>(conditions);

            PropertyChanged += PropertiesViewModelHandler;

            // Setup existiing properties
            PreSelect();
        }