Posted 9 months ago by yejianbiao
Version: 24.1.2
Avatar

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.

Comments (3)

Posted 9 months ago by Actipro Software Support - Cleveland, OH, USA
Avatar

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!


Actipro Software Support

Posted 9 months ago by yejianbiao
Avatar

You replace the CheckBox with a ListBox and then set IsPopupOpen=false in the SelectionChanged event to reproduce it.

Posted 9 months ago by Actipro Software Support - Cleveland, OH, USA
Avatar

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;
}


Actipro Software Support

The latest build of this product (v24.1.5) was released 1 month ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.