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

RadWindow from xaml Template

4 Answers 130 Views
Window
This is a migrated thread and some comments may be shown as answers.
derrick
Top achievements
Rank 2
derrick asked on 15 Oct 2009, 05:49 PM
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" >
...


4 Answers, 1 is accepted

Sort by
0
Miroslav Nedyalkov
Telerik team
answered on 20 Oct 2009, 11:52 AM
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.
0
derrick
Top achievements
Rank 2
answered on 20 Oct 2009, 02:12 PM
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
0
derrick
Top achievements
Rank 2
answered on 20 Oct 2009, 10:46 PM
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
0
Miroslav Nedyalkov
Telerik team
answered on 22 Oct 2009, 10:55 AM
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.
Tags
Window
Asked by
derrick
Top achievements
Rank 2
Answers by
Miroslav Nedyalkov
Telerik team
derrick
Top achievements
Rank 2
Share this question
or