/// <summary> /// The function creates the folder tree node header /// </summary> /// <param name="repoItemFolder">the Repository Folder Base</param> /// <param name="imageType">Only if need different icon than default one then require to provide it</param> /// <returns></returns> protected StackPanel NewTVItemFolderHeaderStyle(RepositoryFolderBase repoItemFolder, eImageType imageType = eImageType.Null) { //The new item style with Source control StackPanel stack = new StackPanel(); stack.Orientation = Orientation.Horizontal; if (WorkSpace.Instance.SourceControl != null) { // Source control image ImageMakerControl sourceControlImage = new ImageMakerControl(); sourceControlImage.BindControl(repoItemFolder, nameof(RepositoryFolderBase.SourceControlStatus)); sourceControlImage.Width = 8; sourceControlImage.Height = 8; sourceControlImage.Margin = new Thickness(0, 0, 2, 0); stack.Children.Add(sourceControlImage); // Since it might take time to get the item status from SCM server // we run it on task so update will happen when status come back and we do not block the UI Task.Factory.StartNew(() => { repoItemFolder.RefreshFolderSourceControlStatus(); }); } // Add Item Image ImageMakerControl NodeImageType = new ImageMakerControl(); if (imageType == eImageType.Null) { GingerCore.GeneralLib.BindingHandler.ObjFieldBinding(NodeImageType, ImageMakerControl.ImageTypeProperty, repoItemFolder, nameof(RepositoryFolderBase.FolderImageType), BindingMode: System.Windows.Data.BindingMode.OneWay); } else { NodeImageType.ImageType = imageType; } NodeImageType.Width = 16; NodeImageType.Height = 16; stack.Children.Add(NodeImageType); // Add Item header text Label itemHeaderLabel = new Label(); itemHeaderLabel.BindControl(repoItemFolder, "DisplayName"); stack.Children.Add(itemHeaderLabel); return(stack); }
/// <summary> /// The function creates the folder tree node header /// </summary> /// <param name="repoItemFolder">the Repository Folder Base</param> /// <param name="imageType">Only if need different icon than default one then require to provide it</param> /// <returns></returns> protected StackPanel NewTVItemFolderHeaderStyle(RepositoryFolderBase repoItemFolder, eImageType imageType = eImageType.Null) { //The new item style with Source control StackPanel stack = new StackPanel(); stack.Orientation = Orientation.Horizontal; if (WorkSpace.Instance.SourceControl != null) { // Source control image ImageMakerControl sourceControlImage = new ImageMakerControl(); sourceControlImage.BindControl(repoItemFolder, nameof(RepositoryFolderBase.SourceControlStatus)); repoItemFolder.RefreshFolderSourceControlStatus(); sourceControlImage.Width = 8; sourceControlImage.Height = 8; sourceControlImage.Margin = new Thickness(0, 0, 2, 0); stack.Children.Add(sourceControlImage); } // Add Item Image ImageMakerControl NodeImageType = new ImageMakerControl(); if (imageType == eImageType.Null) { BindingLib.ControlsBinding.ObjFieldBinding(NodeImageType, ImageMakerControl.ImageTypeProperty, repoItemFolder, nameof(RepositoryFolderBase.FolderImageType), BindingMode: System.Windows.Data.BindingMode.OneWay); } else { NodeImageType.ImageType = imageType; } NodeImageType.Width = 16; NodeImageType.Height = 16; stack.Children.Add(NodeImageType); // Add Item header text Label itemHeaderLabel = new Label(); itemHeaderLabel.BindControl(repoItemFolder, "DisplayName"); stack.Children.Add(itemHeaderLabel); return(stack); }