mirror of
https://github.com/Artemis-RGB/Artemis
synced 2025-12-13 05:48:35 +00:00
31 lines
790 B
C#
31 lines
790 B
C#
using System.Threading.Tasks;
|
|
using Artemis.UI.Shared.Extensions;
|
|
using Avalonia;
|
|
using Avalonia.Controls;
|
|
using Avalonia.Markup.Xaml;
|
|
using Avalonia.ReactiveUI;
|
|
using Avalonia.Threading;
|
|
using ReactiveUI;
|
|
|
|
namespace Artemis.UI.Screens.ProfileEditor.ProfileTree.ContentDialogs;
|
|
|
|
public partial class ProfileElementRenameView : ReactiveUserControl<ProfileElementRenameViewModel>
|
|
{
|
|
public ProfileElementRenameView()
|
|
{
|
|
InitializeComponent();
|
|
this.WhenActivated(_ =>
|
|
{
|
|
this.ClearAllDataValidationErrors();
|
|
Dispatcher.UIThread.Post(DelayedAutoFocus);
|
|
});
|
|
}
|
|
|
|
private async void DelayedAutoFocus()
|
|
{
|
|
// Don't ask
|
|
await Task.Delay(200);
|
|
NameTextBox.SelectAll();
|
|
NameTextBox.Focus();
|
|
}
|
|
} |