Equivalent to Dispatcher in Noesis
Posted: 08 Jan 2025, 11:50
Hello
I want yo do a Dispatcher en Noesis but I dont know what it is the equivalent. This Dispatcher code is worng when execute it in Unity.
How can I do that for Unity?
I want yo do a Dispatcher en Noesis but I dont know what it is the equivalent. This Dispatcher code is worng when execute it in Unity.
How can I do that for Unity?
Code: Select all
public string Password
{
get { return (string)GetValue(PasswordProperty); }
set { SetValue(PasswordProperty, value); }
}
public static readonly DependencyProperty PasswordProperty =
DependencyProperty.Register(nameof(Password), typeof(string), typeof(PasswordBoxControl), new PropertyMetadata(default(string), OnPasswordChanged));
private static void OnPasswordChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
{
var control = (PasswordBoxControl)d;
PasswordBox p = control.FindName("passwordControl") as PasswordBox;
//Set the delay of 800ms to give time to the PasswordChanged event of the PasswordBoxRevealBehavior behavior
Task.Delay(800).ContinueWith(t =>
{
Application.Current.Dispatcher.Invoke(() =>
{
if (p.Password != e.NewValue?.ToString())
p.Password = e.NewValue?.ToString();
});
});
}