This is a migrated thread and some comments may be shown as answers.

Error: Value does not fall within the expected range.

3 Answers 139 Views
Window
This is a migrated thread and some comments may be shown as answers.
Kenneth
Top achievements
Rank 1
Kenneth asked on 08 Sep 2011, 03:51 AM
I'm upgrading to most recent version of Silverlight controls and have now started getting a bug when attempting to run:

 at MS.Internal.XcpImports.CheckHResult(UInt32 hr)
   at MS.Internal.XcpImports.SetValue(IManagedPeerBase obj, DependencyProperty property, DependencyObject doh)
   at MS.Internal.XcpImports.SetValue(IManagedPeerBase doh, DependencyProperty property, Object obj)
   at System.Windows.DependencyObject.SetObjectValueToCore(DependencyProperty dp, Object value)
   at System.Windows.DependencyObject.SetEffectiveValue(DependencyProperty property, EffectiveValueEntry& newEntry, Object newValue)
   at System.Windows.DependencyObject.UpdateEffectiveValue(DependencyProperty property, EffectiveValueEntry oldEntry, EffectiveValueEntry& newEntry, ValueOperation operation)
   at System.Windows.DependencyObject.SetValueInternal(DependencyProperty dp, Object value, Boolean allowReadOnlySet)
   at System.Windows.Controls.ContentPresenter.set_Content(Object value)
   at Telerik.Windows.Controls.InternalWindow.PopupWindowHost.Setup(IWindowDragAware window)
   at Telerik.Windows.Controls.InternalWindow.WindowHostFactory.GetWindowHost(WindowBase window)
   at Telerik.Windows.Controls.WindowBase.ShowWindow(Boolean isModal)
   at Telerik.Windows.Controls.RadWindow.Show()
   at MyTalkTools.SL.MainPage.MainPageLoaded(Object sender, RoutedEventArgs e)
   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)

This is the code:

<telerikNavigation:RadWindow
    x:Name="LoginWindow"
    WindowStartupLocation="CenterOwner"
    ResizeMode="NoResize"
    Opened="LoginWindowOpened"
    CanClose="False"
    Closed="LoginWindowClosed"
    Style="{StaticResource Task_Windows}" >
    <telerikNavigation:RadWindow.Header>
        <TextBlock FontSize="20" Foreground="#FFFFFF">MyTalkTools Login</TextBlock>
    </telerikNavigation:RadWindow.Header>
    <Grid Margin="0 15 0 0">
        <Grid.RowDefinitions>
            <RowDefinition/>
            <RowDefinition/>
            <RowDefinition/>
            <RowDefinition/>
        </Grid.RowDefinitions>
        <Grid.ColumnDefinitions>
            <ColumnDefinition />
            <ColumnDefinition/>
        </Grid.ColumnDefinitions>
        <TextBlock FontSize="15" Grid.Row="0" Grid.Column="0" Padding="5,5,5,5" VerticalAlignment="Center" Text="User name" Foreground="White" />
        <TextBox FontSize="12" x:Name="UserNameTextBox" Text="{Binding Path=UserName, Mode=TwoWay}" Width="200" HorizontalAlignment="Left" Grid.Row="0" Grid.Column="1" Margin="5,5,5,5" KeyUp="UserNameTextBoxKeyUp"  />
        <TextBlock FontSize="15" Grid.Row="1" Grid.Column="0" Padding="5,5,5,5" VerticalAlignment="Center" Foreground="White" Text="Password" />
        <PasswordBox FontSize="12" x:Name="PasswordTextBox" Width="200" HorizontalAlignment="Left" Grid.Row="1" Grid.Column="1" Margin="5,5,5,5" KeyUp="UserNameTextBoxKeyUp"/>
        <TextBlock FontSize="15" x:Name="EmailTextBlock" Grid.Row="2" Grid.Column="0" Padding="5,5,5,5" VerticalAlignment="Center" Visibility="Collapsed" Foreground="White" Text="Email Address"/>
        <TextBox FontSize="12" x:Name="EmailTexBox" Width="200" HorizontalAlignment="Left" Visibility="Collapsed" Grid.Row="2" Grid.Column="1" Margin="5,5,5,5" KeyUp="UserNameTextBoxKeyUp"  />
        <StackPanel Orientation="Horizontal" Grid.Row="3" Grid.Column="0" Grid.ColumnSpan="2" HorizontalAlignment="Right">
            <telerik:RadButton Style="{StaticResource White_RadButtonStyle}" FontSize="12" x:Name="CreateAccountButton"
                               Margin="5" Padding="5" Click="CreateAccountButtonClick"
                               Content="Create New Account" />
            <telerik:RadButton Style="{StaticResource White_RadButtonStyle}" FontSize="12"
                               x:Name="LoginButton" Margin="5"  Padding="5" Click="LoginButtonClick"
                               Content="Login" />
            <telerik:RadButton Style="{StaticResource White_RadButtonStyle}" FontSize="12"
                               x:Name="CreateButton" Margin="5"  Padding="5" Click="CreateButtonClick"
                               Visibility="Collapsed" Content="Create" />
            <telerik:RadButton Style="{StaticResource White_RadButtonStyle}" FontSize="12"
                               x:Name="CancelButton" Margin="5"  Padding="5" Click="CancelButtonClick" 
                               Visibility="Collapsed" Content="Cancel" />
        </StackPanel>
    </Grid>
</telerikNavigation:RadWindow>

Any ideas on what's happening? 

3 Answers, 1 is accepted

Sort by
0
Miroslav Nedyalkov
Telerik team
answered on 08 Sep 2011, 01:32 PM
Hi Kenneth,

 It seems that the RadWindow tag is not a root of your XAML (the namespace declarations are missing) and this usage of the RadWindow control is not supported. You should either create the RadWindow control in CodeBehind or use it as a root tag in XAML. For more information about how to use the RadWindow control you could refer to this article.

Greetings,
Miroslav Nedyalkov
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 >>

0
Kenneth
Top achievements
Rank 1
answered on 09 Sep 2011, 02:53 AM
It's not - because you introduced a big breaking change. 

Creating 15-20 hours of work.

-Ken
0
Miroslav Nedyalkov
Telerik team
answered on 12 Sep 2011, 10:53 AM
Hello Kenneth,

We did this change an year ago, but stayed backwards compatible until the last release. We just decided that it is time to drop this as we decided that it is not correct to place RadWindow in the layout as this has side effects like the layout changes when the window is shown and the bindings are broken as we remove the window from the visual tree in order to open it.

Hope this helps you understand why we dropped this.

Regards,
Miroslav Nedyalkov
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 >>

Tags
Window
Asked by
Kenneth
Top achievements
Rank 1
Answers by
Miroslav Nedyalkov
Telerik team
Kenneth
Top achievements
Rank 1
Share this question
or