/// <summary>
        /// Initialize viewmodel
        /// </summary>
        /// <param name="model">Model to initialize</param>
        public void Initialize(FileStructure model)
        {
            this.model     = model;
            directories    = new ObservableCollection <DirectoryViewModel>();
            rawDirectories = new List <DirectoryViewModel>();

            foreach (var directory in model.Directories.Where(x => x.Parent == null))
            {
                var directoryViewModel = new DirectoryViewModel(directory, this)
                {
                    Parent = this
                };

                directories.Add(directoryViewModel);
                rawDirectories.Add(directoryViewModel);
                directoryViewModel.LoadChildren(directory, model.Directories);
            }

            RemoveValidators(nameof(Name));

            // Add template validator
            if (model.IsTemplate)
            {
                AddValidator(nameof(Name), new StringPropertyNoWhiteSpace());
            }

            if (model.StackGuid != null && model.InstanceDataGuid != null)
            {
                rootPath = stackService.GetInstanceDataContent(model.StackGuid.Value, model.InstanceDataGuid.Value);
            }

            IsDirty = false;
            RefreshPath();
        }
        /// <summary>
        /// Load subdirectories
        /// </summary>
        /// <param name="parent">Parent directory</param>
        /// <param name="directoryModels">Complete directory list</param>
        internal void LoadChildren(Directory parent, IList <Directory> directoryModels)
        {
            foreach (var directory in directoryModels.Where(x => x.Parent?.Id == parent?.Id))
            {
                var directoryViewModel = new DirectoryViewModel(directory, structureViewModel)
                {
                    // Set FileStructureViewModel as parent
                    Parent = this
                };

                directories.Add(directoryViewModel);
                structureViewModel.RawDirectories.Add(directoryViewModel);
                directoryViewModel.LoadChildren(directory, directoryModels);
            }
        }