Close popup on demand

2 posts, 0 answers
  1. Oleg
    Oleg avatar
    42 posts
    Member since:
    Oct 2011

    Posted 12 Mar 2012 Link to this post

    Hello there!

    This is a snippet of my MenuBar:

    <telerik:RadMenu Name="RadMenuBar" Background="Transparent">
                <telerik:RadMenuItem Name="MainMenuItem" Style="{StaticResource ExtraSmallFontStyle}">
                    <telerik:RadMenuItem Name="LogoutMenuItem" Header="{Binding Path=Strings.Logout, Source={StaticResource Strings}}" Click="LogoutMenuItem_Click"/>
                    <telerik:RadMenuItem IsSeparator="True" />
                    <telerik:RadMenuItem Name="ClientSelectorMenuItem" Header="{Binding Path=Strings.Clients, Source={StaticResource Strings}}" ItemsSource="{Binding}">
                        <telerik:RadMenuItem.ItemContainerStyle>
                            <Style TargetType="telerik:RadMenuItem" BasedOn="{StaticResource DefaultRadMenuItemStyle}">
                                <Setter Property="Header" Value="{Binding Name}"/>
                                <Setter Property="IsCheckable" Value="{Binding ClientID, Converter={StaticResource CurrentClientToBooleanConverter}, ConverterParameter='invert'}"/>
                                <Setter Property="IsChecked" Value="{Binding ClientID, Converter={StaticResource CurrentClientToBooleanConverter}}"/>
                                <Setter Property="Command" Value="{Binding ChangeClientCommand, ElementName=Main}"/>
                                <Setter Property="CommandParameter" Value="{Binding ClientID}"/>
                                <Setter Property="IsEnabled" Value="{Binding ClientID, Converter={StaticResource CurrentClientToBooleanConverter}, ConverterParameter='invert'}"/>
                            </Style>
                        </telerik:RadMenuItem.ItemContainerStyle>
                    </telerik:RadMenuItem>
                </telerik:RadMenuItem>
            </telerik:RadMenu>

    My question is - I want to close the RadMenu completely if user clicks on a subitem "ClientSelectorMenuItem" or "LogoutMenuItem". The problem is - after click I navigate to another page and make menubar temporary invisible. After making it visible - menu is still opened. There are no methods like "Collapse" or "Close" etc...

    I tried to get all popups of the menu with VisualTreeHelper and set "IsOpened" to false - it solves the popup problem - but i cant open it after it becouse the header of the top item is highlighted and reacts not on the click or mouseover untill you press "Esc". A bit strange...

    Do you have any tips for me?

    Thanks!

  2. Oleg
    Oleg avatar
    42 posts
    Member since:
    Oct 2011

    Posted 21 Mar 2012 Link to this post

    Support? Anyone?
  3. DevCraft banner
Back to Top