RadWindow from xaml Template

5 posts, 0 answers
  1. derrick
    derrick avatar
    21 posts
    Member since:
    Sep 2009

    Posted 15 Oct 2009 Link to this post

    Hi,

    I'm trying to use a RadWindow inside a template, and it never displays (probably because .Show() is not called).  The only way to get my templated control to invoke the OnApplyTemplate override is by adding it to the tree, in which case I can't do a .Show() without getting an error that the RadWindow already has a parent (which it doesn't appear to).

    Anyway, I'm just trying to use the RadWindow inside a template, like this.  Is there a trick to this?  (Maybe getting it to show without calling .Show or something...)

      <Style TargetType="local:peResults">
        <Setter Property="Template">
          <Setter.Value>
            <ControlTemplate TargetType="local:peResults">
              <telerikNavigation:RadWindow x:Name="PART_RootElement" Header="Results" Left="100" Top="20" Width="260" ResizeMode="CanResize" >
    ...


  2. Miroslav Nedyalkov
    Admin
    Miroslav Nedyalkov avatar
    1718 posts

    Posted 20 Oct 2009 Link to this post

    Hello Derrick,

    I would recommend not to use the RadWindow control in a ControlTemplate - it is not meant to be used like this. If you share what is the idea of adding the RadWindow to a ControlTemplate we would be able to give you a suggestion how you could do it in a better way.

    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. derrick
    derrick avatar
    21 posts
    Member since:
    Sep 2009

    Posted 20 Oct 2009 Link to this post

    Hi,

    I'm making a reusable toolbar, where some of the buttons have popup windows that go with them.  Currently I'm using RadWindow as the windowing mechanism, but I want all levels of my components to be templatable--so the UI can be modified later.  (i.e. maybe later one window is a flyout from the left, another is a fixed window on the right, etc.)  So, I really just need a resizable/draggable window that can be used inside a control template.

    Thank you,

    Derrick
  5. derrick
    derrick avatar
    21 posts
    Member since:
    Sep 2009

    Posted 20 Oct 2009 Link to this post

    Hi again,

    I've just spent the better part of a day working with RadWindow's control templates, and I have to say there's a couple things that could be improved. 

    Obviously the fact that the control cannot be used inside a template is the first serious issue.

    The second is that the default (and themed) control templates have a background going across the whole control, including the client area!  It does make for a nifty effect with the header gradient extending to the borders, but if I want to have the client area be semi-transparent I'm forced to re-skin your control.  (If I remove the gradient then the header is transparent too...)

    I think this is a great control, but offering a simple resizable templatable window control would be useful.

    Thanks,

    Derrick
  6. Miroslav Nedyalkov
    Admin
    Miroslav Nedyalkov avatar
    1718 posts

    Posted 22 Oct 2009 Link to this post

    Hi Derrick,

    What I could suggest you is to try the ToolWindow that is in use in the Docking control. It has only the basic functionality of the RadWindow (drag and resize) and doesn't use any popups to display itself. That means that it shouldn't cause any problems to be in a control template, but you will need to add Popup to this control template and to put the ToolWindow in this Popup control.

    Thank you for your comments - I'll write them down and will consider improving these things, but putting a RadWindow into a ControlTemplate is not a supported sceanario. May be we should consider creating simple window like the ToolWindow control that will not be in the Docking assembly and will allow you to do this.

    Greetings,
    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.
Back to Top
DevCraft banner