Hi,
I have a base MDI dialog window class which is subclass of XamDialogWindow and a lot of subclasses of the base class for each type of different forms. Also I have a main container (subclass of UserControl) for all MDI windows. When menu item is selected, application tries to create new window or if it exists and was minimized, restore to normal size:
if (this.Layout.Children.Contains(dlgView)) { dlgView.WindowState = Infragistics.Controls.Interactions.WindowState.Normal; dlgView.BringToFront(); dlgView.IsActive = true;
}...
and on BringToFront() call I got an error message:
Unable to cast object of type '...' to type 'Infragistics.Controls.Interactions.XamDialogWindow'. I tried to cast dlgView to XamDialogWindow - it doesn't help. If I try to use BringIntoView() - nothing happens. If I have only IsActive set to true 0 nothinhg happens again, i.e. form is not visible.
What can be wrong ?
Thanks,
Ed
Hi Ed,
Which version of the Infragistics WPF product are you using? Specifically what is the version number on the assemblies?
Hi Rob,
I use 12 v.1. Different projects in the solution use 12.1.20121.1010 and 12.1.20121.2314.
I created a sample to try and reproduce this but unfortunately I haven't had any luck. Tried with both 12.1.1010 and 12.1.2314 and neither of them produced an exception. You can see my sample attached below.
Maybe it has to do with the way I laid out my dialog windows? I created 3 classes, each subclassing XamDialogWindow. I then created an instance of each dialog in the main container and set their initial WindowState to Hidden. Through a menu item, I set the WindowState back to normal and call BringToFront just as in your code. This seemed to work correctly as when I clicked on the menu items, the windows are made visible and they appear on top of the other windows.
Can you try modifying my sample to reproduce your issue?
Do you still require assistance on this matter?