Skip to content
This repository has been archived by the owner on Jun 21, 2023. It is now read-only.

workaround for checkbox not propagating changes to KeepPrivate property #64

Merged
merged 3 commits into from
Sep 1, 2015
Merged

workaround for checkbox not propagating changes to KeepPrivate property #64

merged 3 commits into from
Sep 1, 2015

Conversation

shiftkey
Copy link
Member

@shiftkey shiftkey commented Sep 1, 2015

Proposed fix for #62 by observing the events directly

  • still have to bind the property to the VM somehow.
  • testing testing testing

We made an assumption here that the CheckBox IsChecked property
would update the property on the viewmodel, but this isn't working
when the user control is hosted in the Team Explorer panel.
@shiftkey shiftkey changed the title workaround for checkbox not propagating changes to KeepPrivate property [WIP] workaround for checkbox not propagating changes to KeepPrivate property Sep 1, 2015

d(Observable.FromEventPattern<RoutedEventArgs>(makePrivate, "Unchecked")
.Subscribe(_ => ViewModel.KeepPrivate = false));

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's add a comment on why this abomination is required as opposed to the more straightforward code that works elsewhere. 😄

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@shiftkey shiftkey changed the title [WIP] workaround for checkbox not propagating changes to KeepPrivate property workaround for checkbox not propagating changes to KeepPrivate property Sep 1, 2015
@haacked
Copy link
Contributor

haacked commented Sep 1, 2015

does your binding need an UpdateSourceTrigger maybe

@gulbanana We're not using XAML bindings. We're using ReactiveUI bindings. Note that the Bind method we used here is the same one we use in the repository create control: https://github.com/github/VisualStudio/blob/master/src/GitHub.VisualStudio/UI/Views/Controls/RepositoryCreationControl.xaml.cs#L50

It works over there, but not here for some reason.

@shiftkey
Copy link
Member Author

shiftkey commented Sep 1, 2015

Ready for review.

@haacked
Copy link
Contributor

haacked commented Sep 1, 2015

😢

Thanks for the fix @shiftkey! ✨

haacked added a commit that referenced this pull request Sep 1, 2015
workaround for checkbox not propagating changes to KeepPrivate property
@haacked haacked merged commit a523bf9 into github:master Sep 1, 2015
@gulbanana
Copy link

ah, ok. i've definitely experienced weird partial-supportedness with the IsChecked dependencyproperty before but that was using {Binding}, not reactiveui.

@shiftkey shiftkey deleted the checked-does-not-propagate branch September 1, 2015 02:49
shana added a commit that referenced this pull request Sep 1, 2015
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants