mirror of
https://github.com/sourcegit-scm/sourcegit.git
synced 2024-11-01 13:13:21 -07: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"
|
Classes="icon_button"
|
||||||
Width="14"
|
Width="14"
|
||||||
Margin="8,0"
|
Margin="8,0"
|
||||||
Click="UpdateSubmodules"
|
Command="{Binding UpdateSubmodules}"
|
||||||
IsVisible="{Binding Submodules, Converter={x:Static c:ListConverters.IsNotNullOrEmpty}}"
|
IsVisible="{Binding Submodules, Converter={x:Static c:ListConverters.IsNotNullOrEmpty}}"
|
||||||
ToolTip.Tip="{DynamicResource Text.Repository.Submodules.Update}">
|
ToolTip.Tip="{DynamicResource Text.Repository.Submodules.Update}">
|
||||||
<Path x:Name="iconSubmoduleUpdate" Width="12" Height="12" Data="{StaticResource Icons.Loading}"/>
|
<Path x:Name="iconSubmoduleUpdate" Width="12" Height="12" Data="{StaticResource Icons.Loading}"/>
|
||||||
</Button>
|
</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}"/>
|
<Path Width="12" Height="12" Data="{StaticResource Icons.Submodule.Add}"/>
|
||||||
</Button>
|
</Button>
|
||||||
</Grid>
|
</Grid>
|
||||||
|
|
|
@ -1,6 +1,4 @@
|
||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Threading.Tasks;
|
|
||||||
|
|
||||||
using Avalonia;
|
using Avalonia;
|
||||||
using Avalonia.Controls;
|
using Avalonia.Controls;
|
||||||
|
@ -306,14 +304,6 @@ namespace SourceGit.Views
|
||||||
e.Handled = true;
|
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)
|
private void CollectBranchesFromNode(List<Models.Branch> outs, ViewModels.BranchTreeNode node)
|
||||||
{
|
{
|
||||||
if (node == null || node.IsRemote)
|
if (node == null || node.IsRemote)
|
||||||
|
|
Loading…
Reference in a new issue