﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.ComponentModel.Composition;
using SoftMod.Views;
using SoftMod.TabControl;
using System.Collections.ObjectModel;
using Dragablz;


namespace SoftMod.ViewModels
{
    [Export]
    public class TabViewModel
    {
        private readonly IInterTabClient _interTabClient;
        private readonly ObservableCollection<TabContent> _tabContents = new ObservableCollection<TabContent>();

        /// <summary>
        /// Constructor
        /// </summary>
        public TabViewModel()
        {
            _interTabClient = new DefaultInterTabClient();
        }

        // Initialise default view model
        public TabViewModel setDefault()
        {
            var model = new TabViewModel();

            model.TabContents.Add(new TabContent("Default", new DefaultTab()));

            return model;
        }

        public ObservableCollection<TabContent> TabContents
        {
            get { return _tabContents; }
        }

        public IInterTabClient InterTabClient
        {
            get { return _interTabClient; }
        }
        public Func<object> NewItemFactory
        {
            get { return () => new TabContent("Default", new DefaultTab()); }
        }
    }
}
