diff --git a/src/client/spark/mspark/Shell/MenuItems/SyntheticCreateMenuItem.cs b/src/client/spark/mspark/Shell/MenuItems/SyntheticCreateMenuItem.cs index 68708f493..9e52eabec 100644 --- a/src/client/spark/mspark/Shell/MenuItems/SyntheticCreateMenuItem.cs +++ b/src/client/spark/mspark/Shell/MenuItems/SyntheticCreateMenuItem.cs @@ -18,7 +18,7 @@ namespace mbts.spark.menu_items private readonly IBus _bus; - public string display_name => "Create Synthetic..."; + public string display_name => "Create Synthetic Spread..."; public int priority => 2; public ImageSource icon => Icons.Tetris; public string sectional_id => MenuItemSections.SecurityWindow; diff --git a/src/client/spark/mspark/Shell/MenuItems/SyntheticStrategyMenuItem.cs b/src/client/spark/mspark/Shell/MenuItems/SyntheticStrategyMenuItem.cs index 3dc941cd8..5380e078a 100644 --- a/src/client/spark/mspark/Shell/MenuItems/SyntheticStrategyMenuItem.cs +++ b/src/client/spark/mspark/Shell/MenuItems/SyntheticStrategyMenuItem.cs @@ -17,7 +17,7 @@ namespace mbts.spark.menu_items private readonly IBus _bus; - public string display_name => "Execution Strategy..."; + public string display_name => "Edit Synthetic Spread..."; public int priority => 1; public ImageSource icon => Icons.Knight; public string sectional_id => MenuItemSections.SecurityWindow; diff --git a/src/client/spark/mspark/Shell/Securities/Synthetic/SyntheticEditorDialog.xaml b/src/client/spark/mspark/Shell/Securities/Synthetic/SyntheticEditorDialog.xaml index a7f4aee02..6b211c27f 100644 --- a/src/client/spark/mspark/Shell/Securities/Synthetic/SyntheticEditorDialog.xaml +++ b/src/client/spark/mspark/Shell/Securities/Synthetic/SyntheticEditorDialog.xaml @@ -4,6 +4,7 @@ xmlns:u="clr-namespace:mbts.ui" xmlns:c="clr-namespace:mbts.ui.controls" xmlns:usp="clr-namespace:mbts.ui.spark" + u:WindowStyle.TitleContent="{Binding}" u:WindowStyle.SizeToContent="WidthAndHeight" Style="{StaticResource BTSDialogTitleTemplate}"> @@ -24,8 +25,8 @@ - - Synthetic Editor + + diff --git a/src/client/spark/mspark/Shell/Securities/Synthetic/VM/SyntheticEditorVM.cs b/src/client/spark/mspark/Shell/Securities/Synthetic/VM/SyntheticEditorVM.cs index 2a88eba06..924001e36 100644 --- a/src/client/spark/mspark/Shell/Securities/Synthetic/VM/SyntheticEditorVM.cs +++ b/src/client/spark/mspark/Shell/Securities/Synthetic/VM/SyntheticEditorVM.cs @@ -6,6 +6,7 @@ using System; using System.Collections.Generic; using System.Linq; using System.Windows.Input; +using System.Windows.Media; namespace mbts.spark { @@ -22,8 +23,16 @@ namespace mbts.spark public SyntheticEditorVM(IBus bus, Security synthetic, ExecutionStrategy strategy) { _synthetic = synthetic; leg_tuples = _synthetic.Synthetic.Legs.Select(l => new LegSpreaderParamsTuple(l, strategy.LegParamsMap[l.Security.Id])).ToList(); + bool is_new = synthetic.Id == 0; + if (is_new) { + title = "Create Synthetic Spread"; + icon = Icons.Tetris; + } else { + title = $"Edit '{synthetic.Synthetic.Name}'"; + icon = Icons.Knight; + } rows = new IRowModel [] { - new SizeModel(synthetic.Id != 0), + new SizeModel(!is_new), new PriceMultiplierModel(), new IsQuoteModel(), new EnableHedgingModel(), @@ -50,6 +59,8 @@ namespace mbts.spark private readonly Security _synthetic; + public string title { get; } + public ImageSource icon { get; } public string name { get => _synthetic.Synthetic.Name; set => _synthetic.Synthetic.Name = value; } public SyntheticContract.Types.PriceCalc price_calc { get => _synthetic.Synthetic.PriceCalc; set => _synthetic.Synthetic.PriceCalc = value; } public IReadOnlyCollection leg_tuples { get; }