public TabItem(string path) : this(path, "") { this.Header = System.IO.Path.GetFileNameWithoutExtension(path); this.picture = ImageHelper.GetImageOfFile(path); var ext = System.IO.Path.GetExtension(path).ToLower(); if (ext == Properties.Resources.ColorExtension.ToLower()) { Content = new ColorListControlVM(path); ResetContent(); } else if (ext == Properties.Resources.ObjectExtension.ToLower()) { Content = ViewModelGenerator(Workspace.Load <IDominoProvider>(path), (path)); ResetContent(); } else { throw new InvalidOperationException("Incorrect file extension"); } }
public TabItem(ColorNodeVM project) : this(project.Name, ImageHelper.GetImageOfFile(project.AbsolutePath), project.AbsolutePath) { Content = new ColorListControlVM(project.parent.AssemblyModel.obj); ResetContent(); }