Can i create a RadWindow that can be resizable but without Maximize and Minimize button?

16 posts, 0 answers
  1. Michael Chong
    Michael Chong avatar
    18 posts
    Member since:
    Jul 2009

    Posted 02 Sep 2009 Link to this post

    As what the title says.

    Hope for any help and information.

    Thank you.
  2. Miroslav Nedyalkov
    Admin
    Miroslav Nedyalkov avatar
    1718 posts

    Posted 02 Sep 2009 Link to this post

    Hello Michael,

    Yes, you can do this. What you need to do is to change the ControlTemplate of the RadWindow control and to remove the buttons from the original one.

    If you have further questions, don't hesitate to ask.

    Regards,
    Miroslav Nedyalkov
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
  3. DevCraft banner
  4. Michael Chong
    Michael Chong avatar
    18 posts
    Member since:
    Jul 2009

    Posted 02 Sep 2009 Link to this post

    Can I have some sample code?

    Thank you.
  5. Miroslav Nedyalkov
    Admin
    Miroslav Nedyalkov avatar
    1718 posts

    Posted 03 Sep 2009 Link to this post

    Hi Michael,

    The attached project demonstrates how to do this.

    Regards,
    Miroslav Nedyalkov
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
  6. Rodrigo Mamede
    Rodrigo Mamede avatar
    2 posts
    Member since:
    Sep 2009

    Posted 09 Mar 2010 Link to this post

    work fine when i have just one window.

    but, i realized that just one window can be opened. If i try to open a "Custom window" and inside this try to open a new "Custom window" an error occur.

    any ideias?
  7. Miroslav Nedyalkov
    Admin
    Miroslav Nedyalkov avatar
    1718 posts

    Posted 11 Mar 2010 Link to this post

    Hi Rodrigo,

     Could you please send us a sample project that reproduces the issue - this will help us find out what causes the problem?

    Sincerely yours,
    Miroslav Nedyalkov
    the Telerik team

    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
  8. Rodrigo Mamede
    Rodrigo Mamede avatar
    2 posts
    Member since:
    Sep 2009

    Posted 11 Mar 2010 Link to this post

    Hi,

    let me try ti explane.

    i created a user control, with a RADWINDOW. On the style i remove the buttons Minimize and Maximize.
    <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" 
        xmlns:telerikNavigation="clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls.Navigation" 
        xmlns:telerik="clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls" 
        x:Class="MyWayDesigner.UIWebSilverlight.JanelaCustomResizableView" 
        > 
     
        <UserControl.Resources> 
            <SolidColorBrush x:Key="BorderShadowColor1" Color="#0C000000"/> 
            <SolidColorBrush x:Key="BorderShadowColor2" Color="#19000000"/> 
            <SolidColorBrush x:Key="BorderShadowColor3" Color="#33000000"/> 
            <SolidColorBrush x:Key="BorderShadowColor4" Color="#4C000000"/> 
            <SolidColorBrush x:Key="RadWindow_OuterOuterBorder" Color="#CA000000"/> 
            <LinearGradientBrush x:Key="RadWindow_OuterBorder" EndPoint="0.933220924036204,0.903735795235198" StartPoint="0.0687608619440813,0.315483972696259"
                <GradientStop Color="#FFDEDEDE" Offset="1"/> 
                <GradientStop Color="#FFFFFFFF" Offset="0.35294289873343759"/> 
            </LinearGradientBrush> 
            . 
            . 
            . 
            . 
                <Setter Property="HorizontalAlignment" Value="Left"/> 
                <Setter Property="VerticalAlignment" Value="Top"/> 
                <Setter Property="WindowState" Value="Normal"/> 
                <Setter Property="WindowStartupLocation" Value="Manual"/> 
                <Setter Property="Header" Value="RadWindow"/> 
                <Setter Property="Margin" Value="0"/> 
                <Setter Property="TabNavigation" Value="Cycle"/> 
            </Style> 
        </UserControl.Resources> 
     
        <Grid x:Name="LayoutRoot"
            <telerikNavigation:RadWindow x:Name="window" VerticalAlignment="Stretch" Content="RadWindow" d:LayoutOverrides="Height" HorizontalAlignment="Stretch" Style="{StaticResource RadWindowStyle}"/> 
        </Grid> 
    </UserControl> 
     

    To open this custom window i´m using:

               JanelaCustomResizableView janelaAbrir = new JanelaCustomResizableView(); 
                janelaAbrir.window.ModalBackground = new System.Windows.Media.SolidColorBrush(System.Windows.Media.Color.FromArgb(150, 0, 0, 0)); 
                janelaAbrir.window.ResizeMode = ResizeMode.CanResize; 
                janelaAbrir.window.WindowStartupLocation = WindowStartupLocation.CenterOwner; 
                janelaAbrir.window.Header = "Abrir Projeto"
                janelaAbrir.window.Content = new AbrirProjetoDePortal(janelaAbrir.window); 
                janelaAbrir.window.ShowDialog(); 

    this works fine.

    But when i need open a new window without closing the first one the second window does not open..


  9. Hristo
    Admin
    Hristo avatar
    832 posts

    Posted 18 Mar 2010 Link to this post

    Hi Rodrigo Mamede,

    I'm sorry for the late response.
    Could you share we us your project so that we can get better understanding on your scenario? (in order to attach files you have to open a support ticket).
    How do you open janelaAbrir.window for the second time?

    Kind regards,
    Hristo
    the Telerik team

    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
  10. Colin
    Colin avatar
    3 posts
    Member since:
    Sep 2010

    Posted 13 Oct 2010 Link to this post

    Expecting people to modify a control template for what should be basic, supplied properties is a brain - dead solution, sorry :(
    The ResizeMode property should be changed to add the ability to hide the minimize, hide the maximize and retain resizing if desired.

    Your minimize function is also worthless if the user has set a minimum size and ends up removing the content of the window, rather than rolling it up into the header as it does when minimum size is not selected.
  11. Miroslav Nedyalkov
    Admin
    Miroslav Nedyalkov avatar
    1718 posts

    Posted 18 Oct 2010 Link to this post

    Hello Colin,

     We are currently working on the case with hiding the buttons independently of the WindowResizeMode property. This will be possible by handling and stopping the commands of the buttons. This feature will be included in the Q3 release.

    Setting MinWidth and MinHeight will prevent the whole control to become smaller than these sizes - this is how the Silverlight/WPF layout works and we cannot change that. What you can do is to hook-up to the WindowStateChanged event and to reset the MinWdith/Height if minimized and to restore it if not.

    Hope this helps!

    Sincerely yours,
    Miroslav Nedyalkov
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  12. João
    João avatar
    5 posts
    Member since:
    Sep 2010

    Posted 17 Nov 2010 Link to this post

    Hi,

    I haven't tried Q3 yet. Has this feature been implemented?

    I'm trying to create a RadWindow that can be resized, closed and maximized but not minimized. Is this possible to do without having to change the control template? Honestly having to change the control template to tweak some basic window functionallity seems to me like a hack.

    Best regards,
    Manuel Felício.
  13. Miroslav Nedyalkov
    Admin
    Miroslav Nedyalkov avatar
    1718 posts

    Posted 22 Nov 2010 Link to this post

    Hello Mario,

     What you need to do to stop minimizing functionality is to handle and stop the WindowCommands.Minimize command. Here is an example that demonstrates how to hide the Minimize button:

    var window = new RadWindow();
    CommandManager.AddPreviewCanExecuteHandler(window, (s, e) =>
    {
        if (e.Command == WindowCommands.Minimize)
        {
            e.Handled = true;
            e.CanExecute = false;
        }
    });
    window.Show();

    All the best,
    Miroslav Nedyalkov
    the Telerik team
    Browse the videos here>> to help you get started with RadControls for Silverlight
  14. Denis Vuyka
    Denis Vuyka avatar
    39 posts
    Member since:
    Oct 2009

    Posted 27 May 2011 Link to this post

    As for "CommandManager.AddPreviewCanExecuteHandler"...
    This seems to be a workaround rather than a solution as for me, sorry. I would discourage people using such approach for production code even if someone proves this code does not provide memory leaks. 
    Can we just have a dedicated API for that? Something like "ShowMinimizeButton" property, so that everyones configures the behavior, and your control has all the implementation the way you want it.
    Thanks in advance,
    Denis
  15. Miroslav Nedyalkov
    Admin
    Miroslav Nedyalkov avatar
    1718 posts

    Posted 30 May 2011 Link to this post

    Hello Denis,

     Thank you for sharing your opinion. Actually this code shouldn't produce any memory leaks if the handler is a static method instead of anonymous method. The example is using an anonymous method just for shortcut.

    The reason why we didn't add property for the minimize button is that we don't want to add such property for every single visual element of the RadWindow. The correct way to remove visual parts is to change the ControlTemplate of the control and as you correctly noticed handling the PreviewExecute is a shortcut for this, not for a missing feature.

    Best wishes,
    Miroslav Nedyalkov
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  16. kevin
    kevin avatar
    2 posts
    Member since:
    Oct 2008

    Posted 17 Aug 2011 Link to this post

    Is there no easier way to choose which button options you want to be exposed on a per-window basis? Having a completely different template style for each type of window makes little sense. 

    Thanks!
    Kevin
  17. Miroslav Nedyalkov
    Admin
    Miroslav Nedyalkov avatar
    1718 posts

    Posted 19 Aug 2011 Link to this post

    Hi Kevin,

     You could use either the approach I suggested in this thread (by handling the button commands) or to directly remove the buttons in the style. Hope this helps.

    Regards,
    Miroslav Nedyalkov
    the Telerik team

    Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get now >>

Back to Top
DevCraft banner