RadWindow stuck in Activated / Deactivated loop

3 posts, 0 answers
  1. William
    William avatar
    2 posts
    Member since:
    Oct 2017

    Posted 19 Oct 2017 Link to this post

    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;     
        if (colorEditor.DialogResult != true)     
            font.Face.Color = initialColor;     

    But the window does not show up, 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 overriden 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. William
    William avatar
    2 posts
    Member since:
    Oct 2017

    Posted 20 Oct 2017 Link to this post

    Found the issue - App.xaml was missing styling tag for that window
  3. Dinko
    Dinko avatar
    657 posts

    Posted 24 Oct 2017 Link to this post

    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.

    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 allow you to write beautiful native mobile apps using a single shared C# codebase.
Back to Top