public override ImageSource Select(TreeListRowData rowData) { var editItem = (EditRepositoryItem)rowData.Node.Content; if (editItem.HasMergeRequest) return new BitmapImage(new Uri(@"/DXVcs2Git.UI;component/Images/red.png", UriKind.RelativeOrAbsolute)); return new BitmapImage(new Uri(@"/DXVcs2Git.UI;component/Images/green.png", UriKind.RelativeOrAbsolute)); }
/// <summary> /// Select node and adds icon to it /// </summary> /// <param name="rowData"><see cref="TreeListRowData"/></param> /// <returns>ImageSource</returns> public override ImageSource Select(TreeListRowData rowData) { var thingStatus = ((IHaveThingStatus)rowData.Row).ThingStatus; object classKindOverride = null; if (rowData.Row is ParameterOptionRowViewModel optionRowViewModel) { classKindOverride = ClassKind.Option; } if (rowData.Row is ParameterStateRowViewModel stateRowViewModel) { classKindOverride = ClassKind.ActualFiniteState; } if (rowData.Row is ParameterComponentValueRowViewModel componentRowViewModel) { classKindOverride = ClassKind.ParameterTypeComponent; } var image = this.Convert(new object[] { thingStatus }, null, classKindOverride, CultureInfo.InvariantCulture); return(image as ImageSource); }
public override ImageSource Select(TreeListRowData rowData) { if (rowData.Level == 0) { return(TaskImages[0]); } return(TaskImages[1]); }
public override ImageSource Select(TreeListRowData rowData) { var explorerItem = rowData.Node.Content as ExplorerItem; if (explorerItem != null) { return explorerItem.Image.ToBitmapImage(); } return null; }
public override ImageSource Select(TreeListRowData rowData) { var editItem = (EditRepositoryItem)rowData.Node.Content; if (editItem.HasMergeRequest) { return(new BitmapImage(new Uri(@"/DXVcs2Git.UI;component/Images/red.png", UriKind.RelativeOrAbsolute))); } return(new BitmapImage(new Uri(@"/DXVcs2Git.UI;component/Images/green.png", UriKind.RelativeOrAbsolute))); }
public override ImageSource Select(TreeListRowData rowData) { var row = rowData.Row as TreeViewDataRow; if (row != null) { return(ImageRepository.GetImage(row.Image as string)); } return(null); }
public override ImageSource Select(TreeListRowData rowData) { var explorerItem = rowData.Node.Content as ExplorerItem; if (explorerItem != null) { return(explorerItem.Image.ToBitmapImage()); } return(null); }
public override ImageSource Select(TreeListRowData rowData) { var row = rowData.Row as PrintElementNode; if (row != null) { return(ImageRepository.GetImage(row.ElementType)); } return(null); }
public override ImageSource Select(TreeListRowData rowData) { string groupName = rowData.View.DataControl.GetCellValue(rowData.RowHandle.Value, "GroupName") as string; if (ImageCache.ContainsKey(groupName)) { return(ImageCache[groupName]); } ImageSource image = new BitmapImage(new Uri(GroupNameToImageConverter.GetImagePathByGroupName(groupName), UriKind.Relative)); ImageCache.Add(groupName, image); return(image); }
public override ImageSource Select(TreeListRowData rowData) { if (rowData?.Node?.Content != null) { if (FileHelper.ImageFiles.Any(x => rowData.Node.Content.ToString().EndsWith(x, StringComparison.OrdinalIgnoreCase))) { return(Image); } if (FileHelper.VideoFiles.Any(x => rowData.Node.Content.ToString().EndsWith(x, StringComparison.OrdinalIgnoreCase))) { return(Video); } } return(Folder); }
/// <summary> /// Select node and adds icon to it /// </summary> /// <param name="rowData"><see cref="TreeListRowData"/></param> /// <returns>ImageSource</returns> public override ImageSource Select(TreeListRowData rowData) { var thingStatus = ((IHaveThingStatus)rowData.Row).ThingStatus; if (rowData.Row is ParameterOrOverrideBaseRowViewModel parameterOrOverrideBaseRow) { var productTreeIconConverter = new ProductTreeIconUriConverter(); var productTreeIcon = productTreeIconConverter.Convert(new object[] { thingStatus, parameterOrOverrideBaseRow.Usage }, null, null, CultureInfo.InvariantCulture); return(productTreeIcon as ImageSource); } var converter = new ThingToIconUriConverter(); var icon = converter.Convert(new object[] { thingStatus }, null, null, CultureInfo.InvariantCulture); return(icon as ImageSource); }
/// <summary> /// Select node and adds icon to it /// </summary> /// <param name="rowData"><see cref="TreeListRowData"/></param> /// <returns>ImageSource</returns> public override ImageSource Select(TreeListRowData rowData) { var thingStatus = ((IHaveThingStatus)rowData.Row).ThingStatus; Thing thing = null; if (rowData.Row is ParametricConstraintsFolderRowViewModel parametricConstraintsFolderRow) { thing = parametricConstraintsFolderRow.Thing; } else if (rowData.Row is ParametricConstraintRowViewModel parametricConstraintRow) { thing = parametricConstraintRow.Thing; } var converter = new ThingToIconUriConverter(); var image = converter.Convert(new object[] { thing, thingStatus }, null, null, CultureInfo.InvariantCulture); return(image as ImageSource); }
public override ImageSource Select(TreeListRowData rowData) { ImageSource result = null; var row = rowData.Row as ConfigElementNode; if (row != null) { if (!string.IsNullOrEmpty(row.ElementType)) { result = ImageRepository.GetImage("System/" + row.ElementType); } } if (result == null) { result = ImageRepository.GetImage(rowData.Node.IsExpanded ? "System/FolderOpen" : "System/FolderClosed"); } return(result); }
public override System.Windows.DataTemplate SelectTemplate(object item, System.Windows.DependencyObject container) { TreeListRowData rowData = item as TreeListRowData; if (rowData != null) { if (rowData.Row is Project) { return(ProjectTemplate); } if (rowData.Row is Stage) { return(StageTemplate); } if (rowData.Row is Task) { return(TaskTemplate); } } return(null); }
object IValueConverter.Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture) { TreeListRowData rowData = value as TreeListRowData; if (rowData != null) { Task task = rowData.Row as Task; if (task != null) { switch (task.Priority) { case Priority.Low: return(LowTemplate); case Priority.Normal: return(NormalTemplate); case Priority.High: return(HighTemplate); } } } return(null); }
public override ImageSource Select(TreeListRowData rowData) { return(Image); }