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

Commit eb3f7f2

Browse files
committed
workaround for checkbox not propagating changes to KeepPrivate property
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.
1 parent 56511e5 commit eb3f7f2

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/GitHub.VisualStudio/UI/Views/Controls/RepositoryPublishControl.xaml.cs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,13 @@ public RepositoryPublishControl()
3030
d(this.Bind(ViewModel, vm => vm.RepositoryName, v => v.nameText.Text));
3131

3232
d(this.Bind(ViewModel, vm => vm.Description, v => v.description.Text));
33-
d(this.Bind(ViewModel, vm => vm.KeepPrivate, v => v.makePrivate.IsChecked));
33+
34+
d(Observable.FromEventPattern<RoutedEventArgs>(makePrivate, "Checked")
35+
.Subscribe(_ => ViewModel.KeepPrivate = true));
36+
37+
d(Observable.FromEventPattern<RoutedEventArgs>(makePrivate, "Unchecked")
38+
.Subscribe(_ => ViewModel.KeepPrivate = false));
39+
3440
d(this.OneWayBind(ViewModel, vm => vm.CanKeepPrivate, v => v.makePrivate.IsEnabled));
3541

3642
//d(this.OneWayBind(ViewModel, vm => vm.ShowUpgradeToMicroPlanWarning, v => v.upgradeToMicroPlanWarning.Visibility));

0 commit comments

Comments
 (0)