internal static IObservable <Unit> BindConnect(this XafApplication application) { if (application == null) { return(Observable.Empty <Unit>()); } var controlsCreated = application.WhenObjectViewCreated() .ControlsCreated().Select(tuple => tuple).Publish().RefCount(); return(controlsCreated.ViewModelProperties() .Merge(controlsCreated.ViewItemBindData()) .Do(tuple => BindTo(tuple)) .ToUnit() .Merge(application.BindLayoutGroupControl())); }