diff --git a/src/client/spark/Modules/Spreader/VM/SyntheticEditorVM.cs b/src/client/spark/Modules/Spreader/VM/SyntheticEditorVM.cs index 2b162676a..7f294ab6c 100644 --- a/src/client/spark/Modules/Spreader/VM/SyntheticEditorVM.cs +++ b/src/client/spark/Modules/Spreader/VM/SyntheticEditorVM.cs @@ -2,7 +2,6 @@ using bts.shell; using bts.spark; using bts.utils; -using mbts.spark.utilities; using mbts.ui; using mbts.ui.shell; using mbts.ui.spark; @@ -110,7 +109,7 @@ namespace mbts.spark { _validate_leg_count(); }; - async Task commit_async(){ + async Task commit_async() { RequestUpdate?.Invoke(); bool valid = true; if (string.IsNullOrWhiteSpace(name)) { @@ -125,8 +124,7 @@ namespace mbts.spark { valid = false; } if (valid) { - _synthetic.Synthetic.Legs.Clear(); - _synthetic.Synthetic.Legs.AddRange(leg_tuples.Select(l => l.leg).OrderBy(l => l.Security, SecurityHelper.Comparer.Instance)); + _synthetic.Synthetic.Legs.SetItems(leg_tuples.Select(l => l.leg)); _synthetic.Symbol = _deduce_symbol(_synthetic); double tick_frac = _tick_factors.tick_unit / _tick_factors.tick_base; _synthetic.ContractSpec.LowTick = tick_frac; @@ -296,7 +294,6 @@ namespace mbts.spark { static IEnumerable _get_legs(Security synthetic, ExecutionStrategyImmutable strategy) => synthetic.Synthetic.Legs - .OrderBy(l => l.Security, SecurityHelper.Comparer.Instance) .Select(l => new LegSpreaderParamsTuple(l, strategy.LegParamsMap[l.Security.Id].Clone())); void _close_new_leg_popup() { @@ -339,4 +336,4 @@ namespace mbts.spark { else clear_error(nameof(leg_count)); } } -} +} \ No newline at end of file