Skip to content

Commit

Permalink
DYN-4738-Custom-ColorPicker Code Review1
Browse files Browse the repository at this point in the history
Adding comments
  • Loading branch information
RobertGlobant20 committed Mar 3, 2023
1 parent 215ed6c commit a49d970
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/DynamoCoreWpf/UI/Converters.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3643,7 +3643,7 @@ private double GetRelativeLuminance(System.Windows.Media.Color color)
}

/// <summary>
/// This converter is used to add margin/Padding from Popup in the CustomColorPicker
/// This converter is used to add extra space between the ListBox and the CustomColorPicker border
/// </summary>
public class AdditionConverter : IValueConverter
{
Expand Down
11 changes: 10 additions & 1 deletion src/DynamoCoreWpf/ViewModels/Core/CustomColorPickerViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ namespace Dynamo.ViewModels
{
internal class CustomColorItem : ColorItem, INotifyPropertyChanged
{
/// <summary>
/// This event will help to execute the method OnPropertyChanged used for xaml bindings (NotificationObject class cannot be used due that we already derive from ColorItem)
/// </summary>
public event PropertyChangedEventHandler PropertyChanged;

private bool isColorItemSelected = false;
Expand All @@ -27,6 +30,11 @@ public bool IsColorItemSelected
}
}

/// <summary>
/// Constructor that initialize the base class with the values passed as paramters
/// </summary>
/// <param name="color">color that will be displayed in the ColorPicker list</param>
/// <param name="name">description or color name that will be displayed as tooltip when mouse hover a specific color</param>
public CustomColorItem(Color? color, string name) : base(color, name)
{

Expand Down Expand Up @@ -106,7 +114,8 @@ public CustomColorPickerViewModel()

private static ObservableCollection<CustomColorItem> CreateBasicColorsCollection()
{

//This list of colors were taken from the design created by the UX team in the Jira task (based from the Weave component).
//Also you can find more details of the colors used in the next link: https://weave.autodesk.com/web/basics/colors-data-viz
ObservableCollection<CustomColorItem> observableCollection = new ObservableCollection<CustomColorItem>();

List<(int R, int G, int B)> colors = new List<(int, int, int)>()
Expand Down
5 changes: 5 additions & 0 deletions src/DynamoCoreWpf/Views/Core/WorkspaceView.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1079,5 +1079,10 @@ private void OnGeometryScaling_Click(object sender, RoutedEventArgs e)
}
GeoScalingPopup.IsOpen = true;
}

private void InCanvasSearchBar_Opened(object sender, EventArgs e)
{
int i = 0;
}
}
}

0 comments on commit a49d970

Please sign in to comment.