Page 1 of 1

Equivalent to Dispatcher in Noesis

Posted: 08 Jan 2025, 11:50
by MarioBarbero
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?
      
        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();
                });
            });
        }

Re: Equivalent to Dispatcher in Noesis

Posted: 08 Jan 2025, 19:07
by jsantos
Yes, our Views inherit from DispatcherObject. In fact, any framework object inherits from it and can be used to access the Dispatcher.

Could you try that?

Re: Equivalent to Dispatcher in Noesis

Posted: 13 Jan 2025, 14:03
by MarioBarbero
Yes, that is work.
Thank you very much