
I use PopupContent on a PopupButton(A) using a PopupButton(B), when I set IsPopup=fase on PopupButton(B), PopupButton(A) is also closed,but I only wanted to close B.
I use PopupContent on a PopupButton(A) using a PopupButton(B), when I set IsPopup=fase on PopupButton(B), PopupButton(A) is also closed,but I only wanted to close B.
Hello,
I tried this in our latet version but didn't see the issue occur. I opened the nested PopupButton's popup and clicked the CheckBox to set the PopupButton.IsChecked back to false. It hides the nested PopupButton's popup but keeps the outer PopupButton's popup open.
<shared:PopupButton x:Name="pb1" Content="Outer">
<shared:PopupButton.PopupContent>
<shared:PopupButton x:Name="pb2" Margin="10" Content="Nested">
<shared:PopupButton.PopupContent>
<CheckBox Margin="10" Content="Nested IsOpen" IsChecked="{Binding ElementName=pb2, Path=IsPopupOpen, Mode=TwoWay}" />
</shared:PopupButton.PopupContent>
</shared:PopupButton>
</shared:PopupButton.PopupContent>
</shared:PopupButton>
If you still think there is a problem, please give the exact code to duplicate the issue. Thank you!
You replace the CheckBox with a ListBox and then set IsPopupOpen=false in the SelectionChanged event to reproduce it.
Hello,
It appears to be closing the outer PopupButton due to focus loss. If you focus the nested button before closing its popup programmatically, it seems to work around the issue:
private void ListBox_SelectionChanged(object sender, SelectionChangedEventArgs e) {
pb2.Focus();
pb2.IsPopupOpen = false;
}
Please log in to a validated account to post comments.