SPARK-2208 / SPARK-2229 don't indent param rows

This commit is contained in:
John Colvin committed 2019-04-03 13:46:42 -05:00
1 parent 1885cef7f1
commit 7e88ffa5bf
2 files changed
+28 -3

No files matched your search

@@ -18,8 +18,21 @@ namespace mbts.spark {
public IAlgoVM algo { get; set; }
public IAlgoParamVM param { get; }
public int level => parent == null ? 0 : parent.level + 1;
public AlgoParamRowVM parent { get; }
public int level => parent == null ? 0 : parent.level + 1;
public string path_disambiguation {
get {
if (parent == null)
return string.Empty;
string pd = parent.path_disambiguation;
if (parent.algo.order_type == bts.api.orderman.CustomOrderDefinition.CustomOneofCase.Cover) {
if (pd.Length > 0)
pd += ".";
pd += parent.param.display_name;
}
return pd;
}
}
public bool is_enabled { get => _is_enabled; set => Set(ref _is_enabled, value); }
public void raise_invalidated() => invalidated?.Invoke();
@@ -44,7 +44,19 @@
<usp:OrderTypeItem DisplayName="{Binding display_name}" BadgeFill="{Binding meta.Color, Converter={StaticResource ColorToBrushConverter}}"/>
</DataTemplate>
<DataTemplate x:Key="ParamNameCellTemplate">
<DataTemplate x:Key="ParamNameAndDisambiguationCellTemplate">
<StackPanel Orientation="Horizontal">
<TextBlock x:Name="disambig_text" Margin="0,0,2,0" FontWeight="Light" Text="{Binding path_disambiguation, StringFormat='[{0}]', Mode=OneWay}"/>
<TextBlock FontWeight="SemiBold" Text="{Binding Path='param.(sp:IAlgoParamVM.display_name)', Mode=OneWay}"/>
</StackPanel>
<DataTemplate.Triggers>
<DataTrigger Binding="{Binding path_disambiguation}" Value="{x:Static sys:String.Empty}">
<Setter TargetName="disambig_text" Property="Visibility" Value="Collapsed"/>
</DataTrigger>
</DataTemplate.Triggers>
</DataTemplate>
<DataTemplate x:Key="IndentedParamNameAndBadgeCellTemplate">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="{Binding level, Converter={StaticResource GridLengthPixelConverter}}"/>
@@ -227,7 +239,7 @@
RowStyleSelector="{StaticResource RowStyleSelector}"
>
<DataGrid.Columns>
<DataGridTemplateColumn IsReadOnly="True" Header="Param" CellTemplate="{StaticResource ParamNameCellTemplate}" MinWidth="140" Width="Auto">
<DataGridTemplateColumn IsReadOnly="True" Header="Param" CellTemplate="{StaticResource ParamNameAndDisambiguationCellTemplate}" MinWidth="140" Width="Auto">
<DataGridTemplateColumn.CellStyle>
<Style TargetType="DataGridCell" BasedOn="{StaticResource {x:Type DataGridCell}}">
<Setter Property="IsTabStop" Value="False"/>