Skip to content

Commit

Permalink
Adding changes from build igniteui-xplat-examples-output+PRs_2024.1.2…
Browse files Browse the repository at this point in the history
…3.1 (#611)

Co-authored-by: tfsbuild <[email protected]>
  • Loading branch information
azure-pipelines[bot] and tfsbuild authored Jan 23, 2024
1 parent a880e09 commit 188ab75
Showing 1 changed file with 30 additions and 46 deletions.
76 changes: 30 additions & 46 deletions samples/charts/category-chart/data-aggregations/App.razor
Original file line number Diff line number Diff line change
Expand Up @@ -25,28 +25,6 @@
Changed="EditorChangeUpdateInitialGroups">
</IgbPropertyEditorPropertyDescription>

<IgbPropertyEditorPropertyDescription
PropertyPath="InitialSummariesHandler"
Name="InitialSummaries"
@ref="initialSummaries"
Label="Initial Summaries"
ValueType="PropertyEditorValueType.EnumValue"
ShouldOverrideDefaultEditor="true"
PrimitiveValue="@("Sum(Sales) as Sales")"
Changed="EditorChangeUpdateInitialSummaries">
</IgbPropertyEditorPropertyDescription>

<IgbPropertyEditorPropertyDescription
PropertyPath="GroupSortsHandler"
Name="GroupSorts"
@ref="groupSorts"
Label="Sort Groups"
ValueType="PropertyEditorValueType.EnumValue"
ShouldOverrideDefaultEditor="true"
PrimitiveValue="@("Sales Desc")"
Changed="EditorChangeUpdateGroupSorts">
</IgbPropertyEditorPropertyDescription>

</IgbPropertyEditorPanel>

</div>
Expand Down Expand Up @@ -78,8 +56,6 @@
{
var editor = this.editor;
var initialGroups = this.initialGroups;
var initialSummaries = this.initialSummaries;
var groupSorts = this.groupSorts;
var chart = this.chart;

this.BindElements = () => {
Expand All @@ -94,8 +70,6 @@

private IgbPropertyEditorPanel editor;
private IgbPropertyEditorPropertyDescription initialGroups;
private IgbPropertyEditorPropertyDescription initialSummaries;
private IgbPropertyEditorPropertyDescription groupSorts;
private IgbCategoryChart chart;

public void PropertyEditorInitAggregationsOnViewInit()
Expand All @@ -104,39 +78,49 @@
this.editor.EnsureReady().ContinueWith(new Action<Task>((e) =>
{
var editor = this.editor;
var initialSummaries = editor.Properties.Where((p) => p.Label == "Initial Summaries").First;
initialSummaries.DropDownNames = ["Sum(Sales) as Sales", "Avg(Sales) as Sales", "Min(Sales) as Sales", "Max(Sales) as Sales", "Count(Sales) as Sales" ];
initialSummaries.DropDownValues = ["Sum(Sales) as Sales", "Avg(Sales) as Sales", "Min(Sales) as Sales", "Max(Sales) as Sales", "Count(Sales) as Sales"];

var groupSorts = editor.Properties.Where((p) => p.Label == "Sort Groups").First;
groupSorts.DropDownNames = ["Sales Desc", "Sales Asc"];
groupSorts.DropDownValues = ["Sales Desc", "Sales Asc"];
var initialSummariesDropdown = new IgbPropertyEditorPropertyDescription();
var sortGroupsDropdown = new IgbPropertyEditorPropertyDescription();
initialSummariesDropdown.Label = "Initial Summaries";
initialSummariesDropdown.ValueType = PropertyEditorValueType.EnumValue;
initialSummariesDropdown.ShouldOverrideDefaultEditor = true;
initialSummariesDropdown.DropDownNames = ["Sum(Sales) as Sales", "Avg(Sales) as Sales", "Min(Sales) as Sales", "Max(Sales) as Sales", "Count(Sales) as Sales"];
initialSummariesDropdown.DropDownValues = ["Sum(Sales) as Sales", "Avg(Sales) as Sales", "Min(Sales) as Sales", "Max(Sales) as Sales", "Count(Sales) as Sales"];
sortGroupsDropdown.Label = "Sort Groups";
sortGroupsDropdown.ValueType = PropertyEditorValueType.EnumValue;
sortGroupsDropdown.ShouldOverrideDefaultEditor = true;
sortGroupsDropdown.DropDownNames = ["Sales Asc", "Sales Desc"];
sortGroupsDropdown.DropDownValues = ["Sales Asc", "Sales Desc"];

editor.Properties.Add(initialSummariesDropdown);
editor.Properties.Add(sortGroupsDropdown);

initialSummariesDropdown.Changed += this.EditorChangeUpdateInitialSummaries;
sortGroupsDropdown.Changed += this.EditorChangeUpdateGroupSorts;
}));

}

public void EditorChangeUpdateInitialGroups(IgbPropertyEditorPropertyDescriptionChangedEventArgs args)
public void EditorChangeUpdateInitialSummaries(IgbPropertyEditorPropertyDescriptionChangedEventArgs args)
{
var chart = this.chart;
var intialGroupVal = args.NewValue.ToString();
chart.InitialGroups = null;
chart.InitialGroups = intialGroupVal;
var chart = this.chart;
var intialSummaryVal = args.NewValue.ToString();
chart.InitialSummaries = intialSummaryVal;
}

public void EditorChangeUpdateInitialSummaries(IgbPropertyEditorPropertyDescriptionChangedEventArgs args)
public void EditorChangeUpdateGroupSorts(IgbPropertyEditorPropertyDescriptionChangedEventArgs args)
{
var chart = this.chart;
var intialSummariesVal = args.NewValue.ToString();
chart.InitialSummaries = null;
chart.InitialSummaries = intialSummariesVal;
var chart = this.chart;
var groupSortsVal = args.NewValue.ToString();
chart.GroupSorts = groupSortsVal;
}

public void EditorChangeUpdateGroupSorts(IgbPropertyEditorPropertyDescriptionChangedEventArgs args)
public void EditorChangeUpdateInitialGroups(IgbPropertyEditorPropertyDescriptionChangedEventArgs args)
{
var chart = this.chart;
var groupSortsVal = args.NewValue.ToString();
chart.GroupSorts = null;
chart.GroupSorts = groupSortsVal;
var intialGroupVal = args.NewValue.ToString();
chart.InitialGroups = null;
chart.InitialGroups = intialGroupVal;
}

private SalesData _salesData = null;
Expand Down

0 comments on commit 188ab75

Please sign in to comment.