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

PopupPlacement Samples

2 Answers 59 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Leon
Top achievements
Rank 1
Leon asked on 20 Mar 2012, 07:40 AM

Are there some samples for new PopupPlacement class? I tried to use it in a control template, but failed.

What's wrong with following code?

<telerikControls:PopupPlacement x:Key="RadMenuPopupPlacement"

                                 Placement="Top">

 

 

</telerikControls:PopupPlacement>

<Popup x:Name="PART_Popup" telerikControls:PopupPlacement.PopupPlacement="{StaticResource RadMenuPopupPlacement}" >

 

 

 

2 Answers, 1 is accepted

Sort by
0
Pratik
Top achievements
Rank 1
answered on 03 Sep 2013, 04:06 PM
Any answer to this?
0
Hristo
Telerik team
answered on 04 Sep 2013, 12:52 PM
Hello Leon,

PopupPlacement class is used in Silverlight to workaround the missing features of Microsoft Popup control compared to the one from WPF. For example there is no built-in boundary detection, no Placement property, no PlacementTarget property, etc.
Its use is very simple. You attach it on a popup instance and bind all needed properties. For example if you use it in ControlTemplate you have to bind PopupPlacement.IsOpen to some Boolean property of the control (probably using TemplateBinding or Binding with RelativeSource=Self).
You can also set Placement and PlacementTarget and that's it.

Here is a simple usage:
<Popup>
   <telerik:PopupPlacement.PopupPlacement>
      <telerik:PopupPlacement StaysOpen="False" Placement="Bottom" IsOpen="{TemplatedBinding IsOpen}"/>
   </telerik:PopupPlacement.PopupPlacement>
   <!-- Popup child here -->
</Popup>

Let us know if you need more information.

Regards,
Hristo
Telerik
TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for SILVERLIGHT.
Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
Sign up for Free application insights >>
Tags
General Discussions
Asked by
Leon
Top achievements
Rank 1
Answers by
Pratik
Top achievements
Rank 1
Hristo
Telerik team
Share this question
or