mirror of
https://github.com/sourcegit-scm/sourcegit
synced 2025-05-24 21:54:59 +00:00
code_style: remove all IDE warnings
This commit is contained in:
parent
9ac550242e
commit
a807aa9e12
94 changed files with 785 additions and 807 deletions
|
@ -7,7 +7,7 @@ namespace SourceGit.Views
|
|||
public class AutoFocusBehaviour : AvaloniaObject
|
||||
{
|
||||
public static readonly AttachedProperty<bool> IsEnabledProperty =
|
||||
AvaloniaProperty.RegisterAttached<AutoFocusBehaviour, TextBox, bool>("IsEnabled", false, false);
|
||||
AvaloniaProperty.RegisterAttached<AutoFocusBehaviour, TextBox, bool>("IsEnabled");
|
||||
|
||||
static AutoFocusBehaviour()
|
||||
{
|
||||
|
@ -30,9 +30,11 @@ namespace SourceGit.Views
|
|||
{
|
||||
elem.AttachedToVisualTree += (o, _) =>
|
||||
{
|
||||
var text = o as TextBox;
|
||||
text.Focus(NavigationMethod.Directional);
|
||||
text.CaretIndex = text.Text == null ? 0 : text.Text.Length;
|
||||
if (o is TextBox box)
|
||||
{
|
||||
box.Focus(NavigationMethod.Directional);
|
||||
box.CaretIndex = box.Text?.Length ?? 0;
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue