// Copyright (C) 2013 João Pedro Correia - All Rights Reserved
// Code under the terms of the GPLv2 license
// URL: http://flowstudio.codeplex.com

namespace FlowStudio.ViewModel.Data
{
    using System.Activities.Presentation.Model;
    using GalaSoft.MvvmLight;

    public abstract class OutlineItem : ObservableObject
    {
        private bool isExpanded;

        public bool IsExpanded
        {
            get { return isExpanded; }
            set { Set(() => IsExpanded, ref isExpanded, value); }
        }

        public abstract string DisplayText { get; }

        private OutlineItemObservableCollection innerItems;

        public OutlineItemObservableCollection InnerItems
        {
            get { return innerItems; }
            set { Set(() => InnerItems, ref innerItems, value); }
        }

        private ModelItem modelItem;

        public ModelItem ModelItem
        {
            get { return modelItem; }
            private set { Set(() => ModelItem, ref modelItem, value); }
        }

        protected OutlineItem(ModelItem modelItem)
        {
            ModelItem = modelItem;
            IsExpanded = true;
            InnerItems = new OutlineItemObservableCollection();
        }
    }
}
