mirror of
https://github.com/sourcegit-scm/sourcegit.git
synced 2024-12-23 20:47:25 -08:00
refactor: using command binding instead of routed event binding
This commit is contained in:
parent
d0edc09b2e
commit
863f88133c
2 changed files with 7 additions and 12 deletions
|
@ -395,12 +395,17 @@
|
|||
Classes="icon_button"
|
||||
Width="14"
|
||||
Margin="8,0"
|
||||
Click="UpdateSubmodules"
|
||||
Command="{Binding UpdateSubmodules}"
|
||||
IsVisible="{Binding Submodules, Converter={x:Static c:ListConverters.IsNotNullOrEmpty}}"
|
||||
ToolTip.Tip="{DynamicResource Text.Repository.Submodules.Update}">
|
||||
<Path x:Name="iconSubmoduleUpdate" Width="12" Height="12" Data="{StaticResource Icons.Loading}"/>
|
||||
</Button>
|
||||
<Button Grid.Column="3" Classes="icon_button" Width="14" Margin="0,0,8,0" Command="{Binding AddSubmodule}" ToolTip.Tip="{DynamicResource Text.Repository.Submodules.Add}">
|
||||
<Button Grid.Column="3"
|
||||
Classes="icon_button"
|
||||
Width="14"
|
||||
Margin="0,0,8,0"
|
||||
Command="{Binding AddSubmodule}"
|
||||
ToolTip.Tip="{DynamicResource Text.Repository.Submodules.Add}">
|
||||
<Path Width="12" Height="12" Data="{StaticResource Icons.Submodule.Add}"/>
|
||||
</Button>
|
||||
</Grid>
|
||||
|
|
|
@ -1,6 +1,4 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
using Avalonia;
|
||||
using Avalonia.Controls;
|
||||
|
@ -306,14 +304,6 @@ namespace SourceGit.Views
|
|||
e.Handled = true;
|
||||
}
|
||||
|
||||
private void UpdateSubmodules(object sender, RoutedEventArgs e)
|
||||
{
|
||||
if (DataContext is ViewModels.Repository repo)
|
||||
repo.UpdateSubmodules();
|
||||
|
||||
e.Handled = true;
|
||||
}
|
||||
|
||||
private void CollectBranchesFromNode(List<Models.Branch> outs, ViewModels.BranchTreeNode node)
|
||||
{
|
||||
if (node == null || node.IsRemote)
|
||||
|
|
Loading…
Reference in a new issue