コード例 #1
0
        public SettingsView CreateAndBindSettingsViewModel(object creationContext = null)
        {
            //Create View And ViewModel With Factories
            var viewModel = _viewModelFactory.CreateSettingsViewModel();
            var view      = _viewFactory.CreateSettingsView();

            //Bind ViewModel To It's View
            Caliburn.Micro.ViewModelBinder.Bind(viewModel, view, creationContext);

            return(view);
        }
コード例 #2
0
        public bool Show()
        {
            var config = ClientServiceLocator.GetService <IUserConfiguration>();
            var state  = config.LoadConfiguration();

            using (var view = factory.CreateSettingsView()) {
                view.SetState(state);
                if (view.ShowView())
                {
                    config.SaveConfigurate(state);
                    return(true);
                }
            }
            return(false);
        }