mirror of
https://github.com/sourcegit-scm/sourcegit
synced 2025-05-21 20:24:59 +00:00
code_style: simple window do not using DataContext
Signed-off-by: leo <longshuang@msn.cn>
This commit is contained in:
parent
43fed8e04d
commit
0860245674
6 changed files with 54 additions and 65 deletions
|
@ -1,43 +1,12 @@
|
|||
using System;
|
||||
|
||||
using Avalonia;
|
||||
using Avalonia.Interactivity;
|
||||
|
||||
namespace SourceGit.Views
|
||||
{
|
||||
public partial class Askpass : ChromelessWindow
|
||||
{
|
||||
public static readonly StyledProperty<bool> ShowPasswordProperty =
|
||||
AvaloniaProperty.Register<Askpass, bool>(nameof(ShowPassword));
|
||||
|
||||
public bool ShowPassword
|
||||
{
|
||||
get => GetValue(ShowPasswordProperty);
|
||||
set => SetValue(ShowPasswordProperty, value);
|
||||
}
|
||||
|
||||
public string Description
|
||||
{
|
||||
get;
|
||||
private set;
|
||||
} = string.Empty;
|
||||
|
||||
public string Passphrase
|
||||
{
|
||||
get;
|
||||
set;
|
||||
} = string.Empty;
|
||||
|
||||
public Askpass()
|
||||
{
|
||||
DataContext = this;
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
public Askpass(string description)
|
||||
{
|
||||
Description = description;
|
||||
DataContext = this;
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
|
@ -49,7 +18,8 @@ namespace SourceGit.Views
|
|||
|
||||
private void EnterPassword(object _1, RoutedEventArgs _2)
|
||||
{
|
||||
Console.Out.Write($"{Passphrase}\n");
|
||||
var passphrase = TxtPassphrase.Text ?? string.Empty;
|
||||
Console.Out.Write($"{passphrase}\n");
|
||||
App.Quit(0);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue