mirror of
https://github.com/sourcegit-scm/sourcegit
synced 2025-05-24 13:45:00 +00:00
refactor: use DataTemplates
instead of create NamedHighlightedTextBlock
manually for menu item (#1216)
Signed-off-by: leo <longshuang@msn.cn>
This commit is contained in:
parent
5fd074a9b6
commit
41416a6bed
7 changed files with 69 additions and 68 deletions
|
@ -3,6 +3,7 @@
|
|||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:vm="using:SourceGit.ViewModels"
|
||||
xmlns:v="using:SourceGit.Views"
|
||||
mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450"
|
||||
x:Class="SourceGit.Views.DeleteBranch"
|
||||
x:DataType="vm:DeleteBranch">
|
||||
|
@ -39,7 +40,9 @@
|
|||
</Border>
|
||||
|
||||
<Border Grid.Row="1" Grid.Column="1" Height="32" IsVisible="{Binding TrackingRemoteBranch, Converter={x:Static ObjectConverters.IsNotNull}}">
|
||||
<CheckBox Margin="6,0,0,0" Content="{Binding DeleteTrackingRemoteTip}" IsChecked="{Binding AlsoDeleteTrackingRemote, Mode=TwoWay}"/>
|
||||
<CheckBox Margin="6,0,0,0" IsChecked="{Binding AlsoDeleteTrackingRemote, Mode=TwoWay}">
|
||||
<v:NameHighlightedTextBlock Text="{Binding DeleteTrackingRemoteTip}" VerticalAlignment="Center" />
|
||||
</CheckBox>
|
||||
</Border>
|
||||
</Grid>
|
||||
</StackPanel>
|
||||
|
|
|
@ -49,12 +49,6 @@ namespace SourceGit.Views
|
|||
AffectsMeasure<NameHighlightedTextBlock>(TextProperty);
|
||||
}
|
||||
|
||||
public NameHighlightedTextBlock(string nameKey, params object[] args)
|
||||
{
|
||||
SetCurrentValue(TextProperty, App.Text(nameKey, args));
|
||||
VerticalAlignment = Avalonia.Layout.VerticalAlignment.Center;
|
||||
}
|
||||
|
||||
protected override Size MeasureOverride(Size availableSize)
|
||||
{
|
||||
var text = Text;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue