PopupPlacement Samples

3 posts, 0 answers
  1. Leon
    Leon avatar
    1 posts
    Member since:
    Apr 2011

    Posted 20 Mar 2012 Link to this post

    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. Pratik
    Pratik avatar
    1 posts
    Member since:
    Jul 2013

    Posted 03 Sep 2013 Link to this post

    Any answer to this?
  3. DevCraft banner
  4. Hristo
    Admin
    Hristo avatar
    832 posts

    Posted 04 Sep 2013 Link to this post

    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 >>
Back to Top