@@ -30,7 +30,33 @@ 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 ( this . WhenAnyValue ( x => x . ViewModel . KeepPrivate )
35+ . Subscribe ( keepPrivate =>
36+ {
37+ // because we removed this.Bind, set this by hand
38+ if ( keepPrivate != makePrivate . IsChecked )
39+ {
40+ makePrivate . IsChecked = keepPrivate ;
41+ }
42+ } ) ) ;
43+
44+ // BEGIN DANGER ZONE
45+ //
46+ // This replaces the default Bind behaviour as the Checkbox control
47+ // does not raise an event here when it is hosted in the Team Explorer
48+ // view.
49+ //
50+ // We've used this.Bind in other places (popups) so it's something
51+ // we need to investigate further
52+ //
53+ d ( Observable . FromEventPattern < RoutedEventArgs > ( makePrivate , "Checked" )
54+ . Subscribe ( _ => ViewModel . KeepPrivate = true ) ) ;
55+ d ( Observable . FromEventPattern < RoutedEventArgs > ( makePrivate , "Unchecked" )
56+ . Subscribe ( _ => ViewModel . KeepPrivate = false ) ) ;
57+ // END DANGER ZONE
58+
59+
3460 d ( this . OneWayBind ( ViewModel , vm => vm . CanKeepPrivate , v => v . makePrivate . IsEnabled ) ) ;
3561
3662 //d(this.OneWayBind(ViewModel, vm => vm.ShowUpgradeToMicroPlanWarning, v => v.upgradeToMicroPlanWarning.Visibility));
0 commit comments