MinWidth disallows minimized Left position

2 posts, 0 answers
  1. MobiusStrip
    MobiusStrip avatar
    5 posts
    Member since:
    Dec 2010

    Posted 27 Dec 2010 Link to this post

    This one has me stumped.  
    I have a radWindow that I want to  show minimized when the page opens, and have a minimum height and width when the user expands it...the code looks like this...

    Private Sub OnPageLoaded()
       ' bar chart window
            _barchartwindow.WindowStartupLocation = WindowStartupLocation.Manual
            _barchartwindow.WindowState = WindowState.Minimized    
            _barchartwindow.CanClose = False
            _barchartwindow.Width = 900
            _barchartwindow.Height = 310
            _barchartwindow.MinHeight = 310 ' comment this out and starting vertical position is where I expect
            _barchartwindow.MinWidth = 900  
            _barchartwindow.IsRestricted = True
            _barchartwindow.Top = 250
            _barchartwindow.Left = 0
            _barchartwindow.Show()
    End Sub

    The Rad Window xaml looks like this:

    <telerik:RadWindow 
        x:Class="SimProjectSilverlightClientSolution.BarChartWindow"
        xmlns:local="clr-namespace:SimProjectSilverlightClientSolution"
        
        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:telerik="http://schemas.telerik.com/2008/xaml/presentation"  
        xmlns:sdk="http://schemas.microsoft.com/winfx/2006/xaml/presentation/sdk"   
        mc:Ignorable="d"     d:DesignHeight="300" d:DesignWidth="400"
        Header="Project Bar Chart">
        <local:BarChart />
    </telerik:RadWindow>

    The user control xaml is this:

    <UserControl
    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"
    mc:Ignorable="d"
    x:Class="SimProjectSilverlightClientSolution.BarChart"
    d:DesignWidth="1000" d:DesignHeight="480">
        <Grid x:Name="LayoutRoot" Background="White">
        <Canvas x:Name="CanvasRoot" Background="White" >      
        </Canvas>
        </Grid>
    </UserControl>

    But it doesn't really matter what the UserControl looks like, I've tried several varieties..all with the same results as follows:

    • If I comment out the _barchartwindow.MinHeight line, then the minimized Window appears where I want it! 
    • Otherwise, with .MinHeight set, the minimized window positions at what appears to be Top=0, Left=0 (as though Top setting is ignored)
    • Moreover, if I set the .Top value to an unusually large value, say 2200, then the position is somewhere around Top= 100 (2200, 2500, whatever value all position it at same vertical position).

    Setting .MinWidth and a Left value appears to function in much the same way.

    Bug, or just something that I am misunderstanding?

    Thanks
  2. Boyan
    Admin
    Boyan avatar
    758 posts

    Posted 03 Jan 2011 Link to this post

    Hi MobiusStrip,

    When you set MinHeight the control can't be smaller than that (even if minimized) and we are doing a trick by hiding the content so the RadWindow look minimized but it height is in fact the MinHeight. That is why when you move the minimized RadWindow it is restricted strange taking in consideration the MinHeight. This is normal. However this is interacting with the start up position in some way and miscalculates it. For now the workaround is to set just Height without setting MinHeight or remove IsRestricted=true. We will investigate what is happening and will try to provide a fix.

    Please, excuse us for the inconvenience. We have added points to your account for your report. Don't hesitate to contact us if you have other questions.


    Kind regards,
    Boyan
    the Telerik team
    Browse the videos here>> to help you get started with RadControls for Silverlight
  3. DevCraft banner
Back to Top