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

Close popup on demand

1 Answer 85 Views
Menu
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Oleg
Top achievements
Rank 1
Oleg asked on 12 Mar 2012, 11:04 AM

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!

1 Answer, 1 is accepted

Sort by
0
Oleg
Top achievements
Rank 1
answered on 21 Mar 2012, 10:13 AM
Support? Anyone?
Tags
Menu
Asked by
Oleg
Top achievements
Rank 1
Answers by
Oleg
Top achievements
Rank 1
Share this question
or