mirror of
https://github.com/sourcegit-scm/sourcegit
synced 2025-05-25 14:15:00 +00:00
refactor: move binding for ToolTip.IsOpen
from code to axaml
Signed-off-by: leo <longshuang@msn.cn>
This commit is contained in:
parent
0cb2ca78fe
commit
e7f0217a7b
2 changed files with 7 additions and 17 deletions
|
@ -5,8 +5,6 @@ using System.Threading.Tasks;
|
|||
using Avalonia;
|
||||
using Avalonia.Controls;
|
||||
using Avalonia.Controls.Documents;
|
||||
using Avalonia.Data;
|
||||
using Avalonia.Data.Converters;
|
||||
using Avalonia.Input;
|
||||
using Avalonia.Threading;
|
||||
using Avalonia.VisualTree;
|
||||
|
@ -26,21 +24,6 @@ namespace SourceGit.Views
|
|||
|
||||
protected override Type StyleKeyOverride => typeof(SelectableTextBlock);
|
||||
|
||||
public CommitMessagePresenter()
|
||||
{
|
||||
var bindings = new MultiBinding()
|
||||
{
|
||||
Converter = BoolConverters.And,
|
||||
Bindings = new[]
|
||||
{
|
||||
new Binding() { Path = "IsPointerOver", Source = this },
|
||||
new Binding() { Path = "(ToolTip.Tip)", Source = this, TypeResolver = (_, name) => name == "ToolTip" ? typeof(ToolTip) : null, Converter = ObjectConverters.IsNotNull },
|
||||
}
|
||||
};
|
||||
|
||||
Bind(ToolTip.IsOpenProperty, bindings);
|
||||
}
|
||||
|
||||
protected override void OnPropertyChanged(AvaloniaPropertyChangedEventArgs change)
|
||||
{
|
||||
base.OnPropertyChanged(change);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue