refactor(ui): simplify txtLastAction visibility binding
This commit is contained in:
@@ -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="⯆" Margin="12,0,0,0" x:Name="descCreatedDate" FontSize="14" PreviewMouseDown="orderBy_PreviewMouseDown" Cursor="Hand" Tag="3"/>
|
||||
<TextBlock Text="⯅" x:Name="ascCreatedDate" Tag="2" FontSize="14" Margin="0,0,13,0" PreviewMouseDown="orderBy_PreviewMouseDown" Cursor="Hand" />
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user