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!