Hi,
I have a RadWindow with a listbox as part of the content. When an item in the listbox is selected a catastrophic failure occurs (below). I'd appreciate help on whether this is a bug or if I should be doing things differently.
Error: Unhandled Error in Silverlight 2 Application Catastrophic failure (Exception from HRESULT: 0x8000FFFF (E_UNEXPECTED)) 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 System.Windows.UIElement.TransformToVisual(UIElement visual)
at System.Windows.Controls.Primitives.Selector.IsOnCurrentPage(Int32 index, Rect& itemsHostRect, Rect& listBoxItemRect)
at System.Windows.Controls.Primitives.Selector.ScrollIntoView(Int32 index)
at System.Windows.Controls.Primitives.Selector.SetFocusedItem(Int32 index, Boolean scrollIntoView)
at System.Windows.Controls.ListBox.OnSelectionChanged(Int32 oldIndex, Int32 newIndex, Object oldValue, Object newValue)
at System.Windows.Controls.Primitives.Selector.OnSelectionChanging(Int32 oldIndex, Int32 newIndex, Object oldValue, Object newValue)
at System.Windows.Controls.Primitives.Selector.OnSelectedIndexChanged(Int32 oldIndex, Int32 newIndex)
at System.Windows.Controls.Primitives.Selector.OnSelectedIndexChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
at System.Windows.DependencyObject.RaisePropertyChangeNotifications(DependencyProperty dp, Object newValue, Object oldValue)
at System.Windows.DependencyObject.SetValueInternal(DependencyProperty dp, Object value, Boolean allowReadOnlySet, Boolean isSetByStyle, Boolean isSetByBuiltInStyle)
at System.Windows.DependencyObject.SetValueInternal(DependencyProperty dp, Object value)
at System.Windows.DependencyObject.SetValue(DependencyProperty property, Int32 i)
at System.Windows.Controls.Primitives.Selector.set_SelectedIndex(Int32 value)
at System.Windows.Controls.Primitives.Selector.NotifyListItemSelected(ListBoxItem listBoxItem, Boolean isSelected)
at System.Windows.Controls.ListBoxItem.OnIsSelectedChanged(Boolean oldValue, Boolean newValue)
at System.Windows.Controls.Primitives.Selector.OnIsSelectedChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
at System.Windows.DependencyObject.RaisePropertyChangeNotifications(DependencyProperty dp, Object newValue, Object oldValue)
at System.Windows.DependencyObject.SetValueInternal(DependencyProperty dp, Object value, Boolean allowReadOnlySet, Boolean isSetByStyle, Boolean isSetByBuiltInStyle)
at System.Windows.DependencyObject.SetValueInternal(DependencyProperty dp, Object value)
at System.Windows.DependencyObject.SetValue(DependencyProperty property, Boolean b)
at System.Windows.Controls.ListBoxItem.set_IsSelected(Boolean value)
at System.Windows.Controls.ListBoxItem.OnMouseLeftButtonDown(MouseButtonEventArgs e)
at System.Windows.Controls.Control.OnMouseLeftButtonDown(Control ctrl, EventArgs e)
at MS.Internal.JoltHelper.FireEvent(IntPtr unmanagedObj, IntPtr unmanagedObjArgs, Int32 argsTypeIndex, String eventName)
A search on google for similar problems indicate the listbox needs to be on the visual tree (eg. https://silverlight.net/forums/p/41636/117267.aspx). I have tried the same for my app and the problem does not appear with the same content in a stackpanel inside the root visual.
System info:
OS: WinXP SP2
Browser: Firefox 3.0.4; IE 7.0
Silverlight: 2 RTW
Telerik rad controls for Silverlight 2008.3 1105
File#1 PopupWindow.xaml
<UserControl x:Class="PopupWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:telerik="clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls.Navigation"
Width="120" Height="90">
<Grid x:Uid="LayoutRoot" x:Name="LayoutRoot" Background="White">
<telerik:RadWindow x:Uid="window" x:Name="window"
WindowStartupLocation="CenterScreen" TopOffset="0" LeftOffset="0"
WindowState="Normal" ResizeMode="NoResize" PinMode="NoPin" CloseMode="Close"
WindowAnimation="OnShow"
Background="AliceBlue"
Header="">
</telerik:RadWindow>
</Grid>
</UserControl>
File#2 PopupOpenWL.xaml
<UserControl x:Class="PopupOpenWL"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
>
<Grid x:Uid="LayoutRoot" x:Name="LayoutRoot">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<TextBlock x:Uid="tblWatch" x:Name="tblWatch" Grid.Row="0" Grid.Column="1" Text="Watch" Margin="5,5,5,0"/>
<StackPanel Grid.Row="1" Grid.Column="0" Margin="5, 5, 20, 5">
<RadioButton x:Uid="rbtnPersonal" x:Name="rbtnPersonal" Content="Personal" Click="rbtnPersonal_Click" />
<RadioButton x:Uid="rbtnPublic" x:Name="rbtnPublic" Content="Public" Click="rbtnPublic_Click"/>
<RadioButton x:Uid="rbtnTopPerformers" x:Name="rbtnTopPerformers" Content="Top Performers" Click="rbtnTopPerformers_Click"/>
</StackPanel>
<StackPanel Grid.Row="1" Grid.Column="1" Margin="5,2,5,5">
<ListBox x:Uid="lbxWatch" x:Name="lbxWatch" MinHeight="200" Width="300" SelectionChanged="lbxWatch_SelectionChanged">
</ListBox>
</StackPanel>
<StackPanel Grid.Row="2" Grid.ColumnSpan="2" Orientation="Horizontal" HorizontalAlignment="Right" Margin="5,5,5,5">
<Button x:Uid="btnOpen" x:Name="btnOpen" Content="Open" Margin="0,0,10,0" Click="btnOpen_Click" />
<Button x:Uid="btnCancel" x:Name="btnCancel" Content="Cancel" Click="btnCancel_Click" />
</StackPanel>
</Grid>
</UserControl>
The above files are used as follows:
PopupWindow popupWindow = new PopupWindow();
PopupOpenWL popupContent = new PopupOpenWL(popupWindow, m_watchListPresentationModel);
popupWindow.Window.Header = "Open...";
popupWindow.Window.Content = popupContent;
popupWindow.Window.ShowDialog();
Thanks,
Nic
I have a RadWindow with a listbox as part of the content. When an item in the listbox is selected a catastrophic failure occurs (below). I'd appreciate help on whether this is a bug or if I should be doing things differently.
Error: Unhandled Error in Silverlight 2 Application Catastrophic failure (Exception from HRESULT: 0x8000FFFF (E_UNEXPECTED)) 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 System.Windows.UIElement.TransformToVisual(UIElement visual)
at System.Windows.Controls.Primitives.Selector.IsOnCurrentPage(Int32 index, Rect& itemsHostRect, Rect& listBoxItemRect)
at System.Windows.Controls.Primitives.Selector.ScrollIntoView(Int32 index)
at System.Windows.Controls.Primitives.Selector.SetFocusedItem(Int32 index, Boolean scrollIntoView)
at System.Windows.Controls.ListBox.OnSelectionChanged(Int32 oldIndex, Int32 newIndex, Object oldValue, Object newValue)
at System.Windows.Controls.Primitives.Selector.OnSelectionChanging(Int32 oldIndex, Int32 newIndex, Object oldValue, Object newValue)
at System.Windows.Controls.Primitives.Selector.OnSelectedIndexChanged(Int32 oldIndex, Int32 newIndex)
at System.Windows.Controls.Primitives.Selector.OnSelectedIndexChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
at System.Windows.DependencyObject.RaisePropertyChangeNotifications(DependencyProperty dp, Object newValue, Object oldValue)
at System.Windows.DependencyObject.SetValueInternal(DependencyProperty dp, Object value, Boolean allowReadOnlySet, Boolean isSetByStyle, Boolean isSetByBuiltInStyle)
at System.Windows.DependencyObject.SetValueInternal(DependencyProperty dp, Object value)
at System.Windows.DependencyObject.SetValue(DependencyProperty property, Int32 i)
at System.Windows.Controls.Primitives.Selector.set_SelectedIndex(Int32 value)
at System.Windows.Controls.Primitives.Selector.NotifyListItemSelected(ListBoxItem listBoxItem, Boolean isSelected)
at System.Windows.Controls.ListBoxItem.OnIsSelectedChanged(Boolean oldValue, Boolean newValue)
at System.Windows.Controls.Primitives.Selector.OnIsSelectedChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
at System.Windows.DependencyObject.RaisePropertyChangeNotifications(DependencyProperty dp, Object newValue, Object oldValue)
at System.Windows.DependencyObject.SetValueInternal(DependencyProperty dp, Object value, Boolean allowReadOnlySet, Boolean isSetByStyle, Boolean isSetByBuiltInStyle)
at System.Windows.DependencyObject.SetValueInternal(DependencyProperty dp, Object value)
at System.Windows.DependencyObject.SetValue(DependencyProperty property, Boolean b)
at System.Windows.Controls.ListBoxItem.set_IsSelected(Boolean value)
at System.Windows.Controls.ListBoxItem.OnMouseLeftButtonDown(MouseButtonEventArgs e)
at System.Windows.Controls.Control.OnMouseLeftButtonDown(Control ctrl, EventArgs e)
at MS.Internal.JoltHelper.FireEvent(IntPtr unmanagedObj, IntPtr unmanagedObjArgs, Int32 argsTypeIndex, String eventName)
A search on google for similar problems indicate the listbox needs to be on the visual tree (eg. https://silverlight.net/forums/p/41636/117267.aspx). I have tried the same for my app and the problem does not appear with the same content in a stackpanel inside the root visual.
System info:
OS: WinXP SP2
Browser: Firefox 3.0.4; IE 7.0
Silverlight: 2 RTW
Telerik rad controls for Silverlight 2008.3 1105
File#1 PopupWindow.xaml
<UserControl x:Class="PopupWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:telerik="clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls.Navigation"
Width="120" Height="90">
<Grid x:Uid="LayoutRoot" x:Name="LayoutRoot" Background="White">
<telerik:RadWindow x:Uid="window" x:Name="window"
WindowStartupLocation="CenterScreen" TopOffset="0" LeftOffset="0"
WindowState="Normal" ResizeMode="NoResize" PinMode="NoPin" CloseMode="Close"
WindowAnimation="OnShow"
Background="AliceBlue"
Header="">
</telerik:RadWindow>
</Grid>
</UserControl>
File#2 PopupOpenWL.xaml
<UserControl x:Class="PopupOpenWL"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
>
<Grid x:Uid="LayoutRoot" x:Name="LayoutRoot">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<TextBlock x:Uid="tblWatch" x:Name="tblWatch" Grid.Row="0" Grid.Column="1" Text="Watch" Margin="5,5,5,0"/>
<StackPanel Grid.Row="1" Grid.Column="0" Margin="5, 5, 20, 5">
<RadioButton x:Uid="rbtnPersonal" x:Name="rbtnPersonal" Content="Personal" Click="rbtnPersonal_Click" />
<RadioButton x:Uid="rbtnPublic" x:Name="rbtnPublic" Content="Public" Click="rbtnPublic_Click"/>
<RadioButton x:Uid="rbtnTopPerformers" x:Name="rbtnTopPerformers" Content="Top Performers" Click="rbtnTopPerformers_Click"/>
</StackPanel>
<StackPanel Grid.Row="1" Grid.Column="1" Margin="5,2,5,5">
<ListBox x:Uid="lbxWatch" x:Name="lbxWatch" MinHeight="200" Width="300" SelectionChanged="lbxWatch_SelectionChanged">
</ListBox>
</StackPanel>
<StackPanel Grid.Row="2" Grid.ColumnSpan="2" Orientation="Horizontal" HorizontalAlignment="Right" Margin="5,5,5,5">
<Button x:Uid="btnOpen" x:Name="btnOpen" Content="Open" Margin="0,0,10,0" Click="btnOpen_Click" />
<Button x:Uid="btnCancel" x:Name="btnCancel" Content="Cancel" Click="btnCancel_Click" />
</StackPanel>
</Grid>
</UserControl>
The above files are used as follows:
PopupWindow popupWindow = new PopupWindow();
PopupOpenWL popupContent = new PopupOpenWL(popupWindow, m_watchListPresentationModel);
popupWindow.Window.Header = "Open...";
popupWindow.Window.Content = popupContent;
popupWindow.Window.ShowDialog();
Thanks,
Nic