ChartWindow: Enhance ComboCheckBox

This commit is contained in:
2024-01-20 02:57:22 +01:00
parent 8b0a4d7979
commit 47658a72ae
3 changed files with 18 additions and 26 deletions

View File

@ -63,16 +63,17 @@
<TextBlock x:Name="GraphNum" Margin="55,0,0,0" FontSize="14" Width="50" Grid.Column="0" VerticalAlignment="Center" HorizontalAlignment="Left"/>
<Label Content="Für:" Margin="10,0,0,0" FontSize="14" Grid.Column="1" VerticalAlignment="Center"/>
<xctk:CheckComboBox x:Name="ContractInput" Margin="0,10,-42,5" Grid.Column="1" DisplayMemberPath="{Binding Listing}"
Delimiter=", " AllItemsSelectedContent="Alle" IsEnabled="False" ItemSelectionChanged="ContractInput_Changed"
Width="500" Height="25" HorizontalAlignment="Right">
<!--<xctk:CheckComboBox.ItemTemplate>
<xctk:CheckComboBox x:Name="ContractInput" Margin="0,10,-42,5" Grid.Column="1"
Delimiter=", " AllItemsSelectedContent="Alle" IsEnabled="False" ItemSelectionChanged="ContractInput_Changed"
Width="500" Height="25" HorizontalAlignment="Right">
<xctk:CheckComboBox.ItemTemplate>
<DataTemplate>
<StackPanel Orientation="Horizontal">
<TextBlock Text="{}" Width="40"/>
<TextBlock Text="{Binding Variety.Name}" Width="150"/>
<TextBlock Text="{Binding Attribute.Name}"/>
</StackPanel>
</DataTemplate>
</xctk:CheckComboBox.ItemTemplate>-->
</xctk:CheckComboBox.ItemTemplate>
</xctk:CheckComboBox>
</Grid>

View File

@ -73,7 +73,7 @@ namespace Elwig.Windows {
var data = EditBillingData.FromJson(PaymentVar.Data, attrVariants);
GraphEntries = [ ..data.GetPaymentGraphEntries(Context), ..data.GetQualityGraphEntries(Context)];
var contracts = ContractSelection.GetContractsForYear(Context, Year).DistinctBy(c => c.Listing).Order().ToList();
var contracts = ContractSelection.GetContractsForYear(Context, Year);
ControlUtils.RenewItemsSource(ContractInput, contracts, g => (g as ContractSelection)?.ToString());
ControlUtils.RenewItemsSource(GraphList, GraphEntries, g => (g as GraphEntry)?.Id, null, ControlUtils.RenewSourceDefault.First);