refactor(ui): simplify txtLastAction visibility binding

This commit is contained in:
Meik
2026-03-05 20:16:11 +01:00
parent 2b5f9ec684
commit ba3e8ed74e
3 changed files with 8 additions and 16 deletions

View File

@@ -76,22 +76,10 @@
FontStyle="Italic"
Width="165"
Margin="0,32,145,4"
d:Visibility="Visible"
d:Text="test Ticket"
Text="{Binding Path=LastJournalEntryActionText,FallbackValue='test Ticket'}">
<TextBlock.Style>
<Style TargetType="{x:Type TextBlock}">
<Setter Property="Visibility"
Value="Visible" />
<Style.Triggers>
<Trigger Property="Text"
Value="">
<Setter Property="Visibility"
Value="Collapsed" />
</Trigger>
</Style.Triggers>
</Style>
</TextBlock.Style>
</TextBlock>
Text="{Binding Path=LastJournalEntryActionText,FallbackValue='test Ticket'}"
Visibility="{Binding Path=HasLastJournalEntryActionText, Converter={StaticResource BoolToVis}}" />
<Grid HorizontalAlignment="Right" Width="25" Grid.Row="1" x:Name="sortByCreatedDate" Visibility="Collapsed" VerticalAlignment="Bottom" Height="16" Margin="0,0,0,4">
<TextBlock Text="&#11206;" Margin="12,0,0,0" x:Name="descCreatedDate" FontSize="14" PreviewMouseDown="orderBy_PreviewMouseDown" Cursor="Hand" Tag="3"/>
<TextBlock Text="&#11205;" x:Name="ascCreatedDate" Tag="2" FontSize="14" Margin="0,0,13,0" PreviewMouseDown="orderBy_PreviewMouseDown" Cursor="Hand" />

View File

@@ -36,6 +36,7 @@ namespace C4IT_CustomerPanel.UserControls
OnPropertyChanged(nameof(Subject));
OnPropertyChanged(nameof(TicketNumber));
OnPropertyChanged(nameof(LastJournalEntryActionText));
OnPropertyChanged(nameof(HasLastJournalEntryActionText));
OnPropertyChanged(nameof(CreatedDate));
OnPropertyChanged(nameof(IsUnread));
OnPropertyChanged(nameof(State));
@@ -51,9 +52,12 @@ namespace C4IT_CustomerPanel.UserControls
{
_ticketItem._lastJournalEntryActionText = value;
OnPropertyChanged();
OnPropertyChanged(nameof(HasLastJournalEntryActionText));
}
}
public bool HasLastJournalEntryActionText => !string.IsNullOrWhiteSpace(LastJournalEntryActionText);
private Boolean _isUnread;