This is a migrated thread and some comments may be shown as answers.

RadWindow stuck in Activated / Deactivated loop

2 Answers 91 Views
Window
This is a migrated thread and some comments may be shown as answers.
William
Top achievements
Rank 1
William asked on 19 Oct 2017, 09:28 PM

I have a class inheriting from RadWindow called ColorEditor expected to be shown by the following code from within a response to a color picker face click from another RadWindow:

private void EditFaceColor_Click(object sender, RoutedEventArgs e) {     
    var source = sender as FrameworkElement;     
    var font = DataContext as FontModel;     
    if (font == null) return;     
    var colorEditor = new ColorEditor     
    {         
         Alpha = false,
        InitialColor = Color.FromArgb(font.Face.Color.A, font.Face.Color.R, font.Face.Color.G, font.Face.Color.B)     
    };     
    var initialColor = font.Face.Color;     
    colorEditor.DataContext = font.Face;     
    if (source != null)     
    {         
        var loc = source.PointToScreen(new Point(0, 0));         
        colorEditor.Left = loc.X;         
        colorEditor.Top = loc.Y;     
    }     
    colorEditor.Owner = this;     
    colorEditor.ShowDialog();     
    if (colorEditor.DialogResult != true)     
    {         
        font.Face.Color = initialColor;     
    }
}

But the window does not show and freezes the entire application.

It also doesn't show up by calling Show(); or by trying to bring it to the front after showing.

After inserting some breakpoints in  OnActivate and OnDeactivate methods in ColorEditor, I noticed that the color editor gets stuck in a loop of OnActivate, immediately followed by OnDeactivate, then a pause, then OnActivate, followed by an immediate OnDeactivate again. 

Does anyone know what might be happening here?
Thank you!

2 Answers, 1 is accepted

Sort by
0
William
Top achievements
Rank 1
answered on 20 Oct 2017, 07:02 PM
Found the issue - App.xaml was missing styling tag for that window
0
Dinko | Tech Support Engineer
Telerik team
answered on 24 Oct 2017, 06:51 AM
Hi William,

We are happy to hear that you manage to found a solution for your case. If you have any other questions you can open a new forum thread with your questions inside.

Regards,
Dinko
Progress Telerik
Want to extend the target reach of your WPF applications, leveraging iOS, Android, and UWP? Try UI for Xamarin, a suite of polished and feature-rich components for the Xamarin framework, which you to write beautiful native mobile apps using a single shared C# codebase.
Tags
Window
Asked by
William
Top achievements
Rank 1
Answers by
William
Top achievements
Rank 1
Dinko | Tech Support Engineer
Telerik team
Share this question
or