I have a modal xamDialogWindow that I have added to a ChildWindow. When the xamDialogWindow is shown, it is shown on the parent form of the ChildWindow, not on the ChildWindow itself.
Hi Competent, XamDialogWindow works very well with ChildWindow. You just need to set property RestrictInContainer="True" foe your XamDialogWindow. Here is a sample application - hope this cha help :-)
Cheers!
Mihail
<UserControl x:Class="XDWinChildWindow.MainPage"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:Controls="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls" mc:Ignorable="d"
d:DesignHeight="300" d:DesignWidth="400" xmlns:ig="http://schemas.infragistics.com/xaml">
<Grid x:Name="LayoutRoot" Background="White">
<Controls:ChildWindow x:Name="MyChileWindow" Width="300" Height="200">
<Grid>
<ig:XamDialogWindow Height="80" Width="150" HorizontalAlignment="Left" RestrictInContainer="True" Name="xamDialogWindow1" VerticalAlignment="Top">
<TextBlock Text="Simple Content!!!"/>
</ig:XamDialogWindow>
</Grid>
</Controls:ChildWindow>
</UserControl>
There is also a secondary, probably related issue with this configuration: I added the xamDialogWindow to a usercontrol so that we could leverage its functionality in multiple windows, but now the control is throwing the following exception after the user control is loaded into the page (the xamDialogWindow does not have to be loaded for this exception to be thrown):
Message: Unhandled Error in Silverlight Application ) General Information*********************************************TimeStamp: 10/17/2010 4:27:17 PMAssembly: UITestAppDomainName: Silverlight AppDomain1) Exception Information*********************************************Exception Type: System.ArgumentExceptionMessage: Value does not fall within the expected range.StackTrace Information********************************************* at MS.Internal.XcpImports.MethodEx(IntPtr ptr, String name, CValue[] cvData) at MS.Internal.XcpImports.MethodPack(IntPtr objectPtr, String methodName, Object[] rawData) at MS.Internal.XcpImports.UIElement_TransformToVisual(UIElement element, UIElement visual) at Infragistics.Controls.Interactions.XamDialogWindow.GetContainerPanelCoords(FrameworkElement container) at Infragistics.Controls.Interactions.XamDialogWindow.CenterDialogWindow() at Infragistics.Controls.Interactions.XamDialogWindow.XamWebDialogWindow_LayoutUpdated(Object sender, EventArgs e) at System.Windows.FrameworkElement.OnLayoutUpdated(Object sender, EventArgs e) at MS.Internal.JoltHelper.RaiseEvent(IntPtr target, UInt32 eventId, IntPtr coreEventArgs, UInt32 eventArgsTypeIndex) at MS.Internal.XcpImports.MethodEx(IntPtr ptr, String name, CValue[] cvData) at MS.Internal.XcpImports.MethodPack(IntPtr objectPtr, String methodName, Object[] rawData) at MS.Internal.XcpImports.UIElement_TransformToVisual(UIElement element, UIElement visual) at Infragistics.Controls.Interactions.XamDialogWindow.GetContainerPanelCoords(FrameworkElement container) at Infragistics.Controls.Interactions.XamDialogWindow.CenterDialogWindow() at Infragistics.Controls.Interactions.XamDialogWindow.XamWebDialogWindow_LayoutUpdated(Object sender, EventArgs e) at System.Windows.FrameworkElement.OnLayoutUpdated(Object sender, EventArgs e) at MS.Internal.JoltHelper.RaiseEvent(IntPtr target, UInt32 eventId, IntPtr coreEventArgs, UInt32 eventArgsTypeIndex)Line: 1Char: 1Code: 0
competent, please review the new sample I have attached and let me know if this helps. I made a few property changes on the XamDialog Window, including setting IsModal to False. I think this works better as False because the ChildWindow itself is a modal dialog. I also set the WindowState to Hidden and removed the Visibility setting.
I have also implemented the dialog as a separate user control. I am not seeing the exception as you are. Please test out this sampe and let me know if this helps.
Thanks,Francis