mirror of
https://github.com/sourcegit-scm/sourcegit
synced 2025-05-24 05:35:00 +00:00
refactor<NameHighlightedTextBlock>: use NameHighlightedTextBlock's constructor instead of functions in each caller
This commit is contained in:
parent
cfe680ffd5
commit
1149c768d3
3 changed files with 39 additions and 48 deletions
|
@ -43,6 +43,11 @@ namespace SourceGit.Views {
|
|||
AffectsMeasure<NameHighlightedTextBlock>(TextProperty);
|
||||
}
|
||||
|
||||
public NameHighlightedTextBlock(string nameKey, params object[] args) {
|
||||
Text = App.Text(nameKey, args);
|
||||
VerticalAlignment = Avalonia.Layout.VerticalAlignment.Center;
|
||||
}
|
||||
|
||||
protected override Size MeasureOverride(Size availableSize) {
|
||||
var text = Text;
|
||||
if (string.IsNullOrEmpty(text)) return base.MeasureOverride(availableSize);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue