Value does not fall within expected range on showing floating window

Apr 15, 2010 at 2:29 PM

I have the floating window, imported the template and added it to my project.

However when I try and show the window I get the above error when it tries to show the window. This error occurs when the ShowWindow function in the FloatableWindow.cs class

My XAML for the page is;

<UserControl 
    xmlns:data="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Data"  xmlns:controls="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls"  x:Class="STGFormulary.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:i="clr-namespace:System.Windows.Interactivity;assembly=System.Windows.Interactivity"
    xmlns:behaviours="clr-namespace:STGFormulary.Behaviours"
    xmlns:local="clr-namespace:STGFormulary"    
    xmlns:fs="clr-namespace:System.Windows.Controls;assembly=FloatableWindow"
    xmlns:stg="clr-namespace:STG.Core.Controls.Silverlight;assembly=STG.Core.Controls.Silverlight"
    mc:Ignorable="d" d:DesignWidth="640" d:DesignHeight="480">
    
    <Canvas x:Name="LayoutRoot">
        <local:BNFPickList x:Name="BNFPickingList" />
        <stg:Desktop x:Name="MyDesktop" Background="Transparent">
            <!-- Page Framework -->
            <Grid 	x:Name="DesktopFramework" 
	                ShowGridLines="False" 
	                Background="Transparent">
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="*" />
                </Grid.ColumnDefinitions>
                <Grid.RowDefinitions>
                    <RowDefinition Height="40"/>
                    <!-- Top Row -->
                    <RowDefinition Height="40" />
                    <!-- Breadcrumb Row -->
                    <RowDefinition Height="*" />
                    <!-- Main Body -->
                </Grid.RowDefinitions>
                <!-- Top Row Grid  -->
                <Grid x:Name="TopRow">
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="Auto" />
                        <ColumnDefinition Width="*" />
                    </Grid.ColumnDefinitions>
                    <Grid.RowDefinitions>
                        <RowDefinition Height="*" />
                    </Grid.RowDefinitions>
                    <Grid.Background>
                        <LinearGradientBrush StartPoint="0.5,0" EndPoint="0.5,1">
                            <GradientStop Color="#FF42B8EE" Offset="0" />
                            <GradientStop Color="#FF0F75A3" Offset="1" />
                        </LinearGradientBrush>
                    </Grid.Background>
                </Grid>

                <!-- Breadcrumb Menu -->
                <stg:BreadCrumbMenu x:Name="breadCrumbMenu" Grid.Column="0" Grid.Row="1" >
                    <stg:BreadCrumbMenu.Background>
                        <LinearGradientBrush  EndPoint="0.5,1" StartPoint="0.5,0">
                            <GradientStop Color="#FFFCFBFB" Offset="0"/>
                            <GradientStop Color="#FFE0E0E0" Offset="0.99"/>
                            <GradientStop Color="DarkGray" Offset="0.994"/>
                        </LinearGradientBrush>
                    </stg:BreadCrumbMenu.Background>
                    <stg:BreadCrumbMenu.Items>
                        <stg:BreadCrumbItem OptionText="Root" Value="ROOT" ValueType="BNF" />
                    </stg:BreadCrumbMenu.Items>
                </stg:BreadCrumbMenu>  
            </Grid>
        </stg:Desktop>
        <stg:SearchInterface x:Name="searchInterface" />
        
    </Canvas>
</UserControl>    

The Control using the FloatingImage is as follows;

<controls:FloatableWindow x:Class="STGFormulary.BNFPickList"
           xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
           xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
           xmlns:controls="clr-namespace:System.Windows.Controls;assembly=FloatableWindow"
           Width="400" Height="300" 
           Title="BNFPickList">
    <Grid x:Name="LayoutRoot" Margin="2">
        <Grid.RowDefinitions>
            <RowDefinition />
            <RowDefinition Height="Auto" />
        </Grid.RowDefinitions>

        <Button x:Name="CancelButton" Content="Cancel" Click="CancelButton_Click" Width="75" Height="23" HorizontalAlignment="Right" Margin="0,12,0,0" Grid.Row="1" />
        <Button x:Name="OKButton" Content="OK" Click="OKButton_Click" Width="75" Height="23" HorizontalAlignment="Right" Margin="0,12,79,0" Grid.Row="1" />
    </Grid>
</controls:FloatableWindow>

 

Any ideas and thanks in advance

Oct 11, 2010 at 8:18 AM

I got the same problem when trying to Show multiple FloatableWindow: Value does not fall within expected range

The problem apprears randomly (on the 3rd or 5th FloatableWindow) 1st FlaotableWindow alwasy OK

Still trying to find out the root cause....  anyone can help?