Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DismissOnClickOutside property added to DropDownButton #1048

Merged
merged 2 commits into from
Aug 25, 2022
Merged

DismissOnClickOutside property added to DropDownButton #1048

merged 2 commits into from
Aug 25, 2022

Conversation

MuhammadSulaiman001
Copy link
Contributor

@MuhammadSulaiman001 MuhammadSulaiman001 commented Aug 5, 2022

Hi, I have been using DropDownButtons and SplitButtons to show dialogs by setting the content of these buttons equals to the dialog's content, this results in a pretty slide-down show behavior.. This is a sample snippet

<fluent:DropDownButton
      Header="Header"
      IsDropDownOpen="{Binding IsDialogOpen, Mode=TwoWay}"
      SizeDefinition="Large, Large, Large">
      <fluent:DropDownButton.LargeIcon/>
      <views:MyDialog/>
</fluent:DropDownButton>

with this, I only miss one thing, prevent closing the drop-down-dialog when clicking outside, so, I have added a property named DismissOnClickOutside to DropDownButton class.. setting it to false will prevent closing the dialog unless the user clicks over the DropDownButton

Notes:

  1. This property does not affect other properties like IsDropDownOpen or ClosePopupOnMouseDown
  2. I could not have just Inherit DropDownButton and make my own DropDownButton to achive my purpose because I needed to add a check code inside PopupService.cs
  3. The default value of DismissOnClickOutside is true, which leads to the normal behavior (i.e. closing the popup when clicking outside)

@MuhammadSulaiman001 MuhammadSulaiman001 changed the title DismissOnClickOutside property added DismissOnClickOutside property added to DropDownButton Aug 5, 2022
@batzen batzen merged commit e90986e into fluentribbon:develop Aug 25, 2022
@batzen batzen added this to the 10.0 milestone Aug 25, 2022
@batzen batzen self-assigned this Aug 25, 2022
@batzen
Copy link
Member

batzen commented Aug 25, 2022

Thanks for contributing!

batzen added a commit that referenced this pull request Aug 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants