for a xap file dotfuscated with Preemtive Dotfuscator for WP7, I keep getting exception "RadWindow does not work in an application that does not contain a single panel". It's a simple xaml with a RadWindow and a grid, nothing special.
Exception in Preemtive is:
Exception 0: System.InvalidOperationException
Message: RadWindow does not work in an application that does not contain a single panel.
Any ideas?
Thanks
16 Answers, 1 is accepted
Thank you for writing.
Is it possible for you to send your application so that I may inspect this behavior. I have a feeling that the obfuscation is not working. Does the project run without obfuscation?
I am looking forward to your reply.
Victor
the Telerik team
Thank you for being the most amazing .NET community! Your unfailing support is what helps us charge forward! We'd appreciate your vote for Telerik in this year's DevProConnections Awards. We are competing in mind-blowing 20 categories and every vote counts! VOTE for Telerik NOW >>
I use no obfuscation and I get this message on the following simple page...
<
phone:PhoneApplicationPage
x:Class
=
"{namespace}.MainPage"
xmlns:phone
=
"clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone"
xmlns:shell
=
"clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone"
xmlns:gauges
=
"clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls.DataVisualization"
xmlns:telerikPrimitives
=
"clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls.Primitives"
xmlns:telerikCore
=
"clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Core"
xmlns:local
=
"clr-namespace:{namespace}"
mc:Ignorable
=
"d"
d:DesignWidth
=
"480"
d:DesignHeight
=
"696"
FontFamily
=
"{StaticResource PhoneFontFamilyNormal}"
FontSize
=
"{StaticResource PhoneFontSizeNormal}"
Foreground
=
"Black"
SupportedOrientations
=
"Portrait"
Orientation
=
"Portrait"
shell:SystemTray.IsVisible
=
"True"
telerikCore:InteractionEffectManager.IsInteractionEnabled
=
"False"
>
<!--LayoutRoot is the root grid where all page content is placed-->
<
Grid
x:Name
=
"ucLayout"
Background
=
"Transparent"
>
<
Grid.RowDefinitions
>
<
RowDefinition
Height
=
"*"
/>
</
Grid.RowDefinitions
>
<
Grid.ColumnDefinitions
>
<
ColumnDefinition
Width
=
"*"
/>
</
Grid.ColumnDefinitions
>
<
telerikPrimitives:RadModalWindow
x:Name
=
"alertWindow"
Background
=
"{StaticResource myTrans50}"
Placement
=
"CenterCenter"
>
<
Border
BorderBrush
=
"{StaticResource PhoneAccentBrush}"
BorderThickness
=
"{StaticResource PhoneBorderThickness}"
>
<
Grid
Background
=
"{StaticResource myTrans75}"
>
<
Grid.RowDefinitions
>
<
RowDefinition
/>
<
RowDefinition
/>
</
Grid.RowDefinitions
>
<
Grid.ColumnDefinitions
>
<
ColumnDefinition
/>
<
ColumnDefinition
/>
</
Grid.ColumnDefinitions
>
<
TextBlock
Grid.Row
=
"0"
x:Name
=
"alertWindowText"
Grid.ColumnSpan
=
"2"
TextWrapping
=
"Wrap"
VerticalAlignment
=
"Bottom"
Margin
=
"{StaticResource PhoneMargin}"
Style
=
"{StaticResource PhoneTextBlock_Small}"
Foreground
=
"{StaticResource PhoneAccentBrush}"
Width
=
"400"
Text
=
"{Binding Path=Localizedresources.MainPage_MicrophoneNotCalibrated, Source={StaticResource LocalizedStrings}}"
/>
<
Button
Grid.Row
=
"1"
Grid.Column
=
"0"
Content
=
"{Binding Path=Localizedresources.Global_No, Source={StaticResource LocalizedStrings}}"
Click
=
"ButtonNo_Click"
Foreground
=
"{StaticResource PhoneAccentBrush}"
Background
=
"{StaticResource myTrans50}"
BorderBrush
=
"Transparent"
/>
<
Button
Grid.Row
=
"1"
Grid.Column
=
"1"
Content
=
"{Binding Path=Localizedresources.Global_Yes, Source={StaticResource LocalizedStrings}}"
Click
=
"ButtonYes_Click"
Foreground
=
"{StaticResource PhoneAccentBrush}"
BorderBrush
=
"{StaticResource PhoneAccentBrush}"
Background
=
"Transparent"
/>
</
Grid
>
</
Border
>
<
telerikPrimitives:RadModalWindow.OpenAnimation
>
<
telerikCore:RadPlaneProjectionAnimation
CenterY
=
"0.5"
CenterX
=
"0"
StartAngleX
=
"-90"
EndAngleX
=
"0"
Axes
=
"X"
>
<
telerikCore:RadPlaneProjectionAnimation.Easing
>
<
CubicEase
EasingMode
=
"EaseInOut"
/>
</
telerikCore:RadPlaneProjectionAnimation.Easing
>
</
telerikCore:RadPlaneProjectionAnimation
>
</
telerikPrimitives:RadModalWindow.OpenAnimation
>
</
telerikPrimitives:RadModalWindow
>
</
Grid
>
</
phone:PhoneApplicationPage
>
Thank you for writing.
I could not reproduce the exception with the XAML you provided. I removed the references to static resources that did not exist in my application an just ran it. The window opened as expected.
I tested with the Q2 2011 SP release. Please upgrade to the service pack and if you are still experiencing the issue, please post a support ticket with a sample application that demonstrates the issue so that I may debug it.
I am looking forward to your reply.
Victor
the Telerik team
Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>
in my case, my windows are having visibility binded in View Models and that could be a reason.
I'm trying to wrap a project which reproduce it. It happens even with latest builds.
Regards
Emi
Thank you for your effort. We are continuing our efforts to reproduce it on our side but it seems we are missing some application state and the exception does no occur. We are standing by to diagnose the problem as soon as we have enough information to reproduce it.
Best wishes,Victor
the Telerik team
Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>
<telerikPrimitives:RadWindow Name="GreetingWindow"
WindowSizeMode="FitToPlacementTarget">
<Border Margin="10,5,5,10"
BorderBrush="White"
BorderThickness="5"
Background="#FFA2C139">
<Grid Margin="12,12,12,0">
<Grid.RowDefinitions>
<RowDefinition/>
<RowDefinition Height="72"/>
</Grid.RowDefinitions>
<StackPanel Grid.Row="0">
<TextBlock Name="TextBlock4" Text="{Binding Source={StaticResource LocalizedStrings}, Path=Localizedresources.IntroGreetingText1, Mode=OneWay}" TextWrapping="Wrap" Foreground="White" Margin="0,10" FontSize="{StaticResource PhoneFontSizeMediumLarge}" />
<TextBlock Name="TextBlock5" Text="{Binding Source={StaticResource LocalizedStrings}, Path=Localizedresources.IntroGreetingText2, Mode=OneWay}" TextWrapping="Wrap" Foreground="White" Margin="0,10" FontSize="{StaticResource PhoneFontSizeMediumLarge}" />
</StackPanel>
<Button Grid.Row="1" Name="CloseGreetingWindow" Content="close" Foreground="White" HorizontalAlignment="Right" BorderBrush="White" Click="CloseGreetingWindow_Click" />
</Grid>
</Border>
</telerikPrimitives:RadWindow>
It's strange but it only happens once every 5-6 "Restarts" (CTRL+SHIFT+F5 in studio)...
How can I send you the solution? I can only attach images...
Do you want a URL to download it?
We already have a sample application that was sent by another user. We are working on finding the issue.
Thank you for your feedback.
Victor
the Telerik team
Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>
Please try opening the window at a later stage of the application lifecycle, for example in the Loaded event handler of the page. It is guaranteed that the window will find its panel when the visual tree is fully loaded. We will see what can be done so that the window opens correctly regardless of the time IsOpen is set to true.
Please write again if you need further assistance.
Victor
the Telerik team
Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>
Thank you...
Below is the exception I am getting:
at Telerik.Windows.Controls.RadWindow.TryOpen()
at Telerik.Windows.Controls.RadWindow.Open()
at Telerik.Windows.Controls.RadWindow.<>c__DisplayClass5.<TryOpen>b__4(Object sender, RoutedEventArgs args)
at MS.Internal.CoreInvokeHandler.InvokeEventHandler(Int32 typeIndex, Delegate handlerDelegate, Object sender, Object args)
at MS.Internal.JoltHelper.FireEvent(IntPtr unmanagedObj, IntPtr unmanagedObjArgs, Int32 argsTypeIndex, Int32 actualArgsTypeIndex, String eventName)
Thanks for writing.
This exception is thrown when RadWindw tries to open but fails to find a Panel instance in the page's element tree. RadWindow needs this panel in order to work properly and in the very early stages of the app startup, the visual tree is not loaded yet so the search fails.
The stack trace you provided does tell during which event you are opening the window. Is it possible to explain in a little more detail how you are using RadWindow? During page loaded you should be able to open it without problems.
Also, please note that in the latest version of the controls, which will be released this Wednesday, RadWindow no longer throws this exception, but fires an OpenFailed event instead.
Please write again if you need further assistance.
Victor
the Telerik team
Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>
I am not using explicitly the RadWindow control in my code (i.e. if I do a search across all the file for RadWindow, there's no occurences found). That's why I am a bit puzzeled by that error. I am using RadPhoneApplicationFrame, RadHubTile, RadCustomHubTile, RadToggleSwitch, InteractionEffectManager, and RadRateApplicationReminder. That's all...
Martin
In this case, RadRateApplicationReminder is using RadWindow internally. Please post more details about your usage of RadRateApplicationReminder. A sample application which crashes with the exception would be best. This way I will be able to advise you what you can tweak in order to avoid it.
I am looking forward to your reply.
Victor
the Telerik team
Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>
public
partial
class
MainPage : PhoneApplicationPage
{
static
MainPage()
{
InteractionEffectManager.AllowedTypes.Add(
typeof
(RadHubTile));
InteractionEffectManager.AllowedTypes.Add(
typeof
(RadCustomHubTile));
}
public
MainPage()
{
this
.InitializeComponent();
RadRateApplicationReminder rateReminder =
new
RadRateApplicationReminder();
rateReminder.RecurrencePerUsageCount = 5;
rateReminder.Notify();
}
private
void
PhoneApplicationPage_Loaded(
object
sender, System.Windows.RoutedEventArgs e)
{
// ...
}
}
Yes, try in the Loaded event, it should work ok then.
Should you need further assistance, we're ready to provide it.
Victor
the Telerik team
Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>