Пример #1
0
        public static new void InitializeDocumentType(IUIVisualizerService uiVisualizerService, IViewModelLocator viewModelLocator)
        {
            viewModelLocator.Register <DialogueView, DialogueViewModel>();
            viewModelLocator.Register <DialogueControl, DialogueViewModel>();

            uiVisualizerService.Register(typeof(DialogueViewModel), typeof(DialogueView), true);
            Splat.Locator.CurrentMutable.Register(() => new NodeView(), typeof(IViewFor <DialogueNode>));
            RodskaApp app = (RodskaApp)RodskaApp.Current;

            app.AddType(GetTypeString(), typeof(Dialogue));
        }
Пример #2
0
        public static new void InitializeDocumentType(IUIVisualizerService uiVisualizerService, IViewModelLocator viewModelLocator)
        {
            viewModelLocator.Register <ProgressionTreeControl, ProgressTreeViewModel>();
            RodskaApp app = (RodskaApp)RodskaApp.Current;

            app.AddType(GetTypeString(), typeof(ProgressionTree));
        }
Пример #3
0
        protected override void OnStartup(StartupEventArgs e)
        {
#if DEBUG
            LogManager.AddDebugListener();
#endif
            ServiceLocator.Default.RegisterType <Company.DataAccess.If.IDbConfigruation, Config>();
            ServiceLocator.Default.RegisterType <Company.DataAccess.If.IDataAccess, Company.DataAccess.Ef.EfContext>(RegistrationType.Transient);
            ServiceLocator.Default.RegisterType <Company.DataQueries.If.IUnitOfWork, Company.DataQueries.Repositories.UnitOfWork>(RegistrationType.Transient);

            // TODO : Über Namesnkonvention regeln
            IViewModelLocator viewModelLocator = ServiceLocator.Default.ResolveType <IViewModelLocator>();
            viewModelLocator.Register(typeof(Company.UI.Views.Main), typeof(Company.Core.ViewModels.MainVm));
            viewModelLocator.Register(typeof(Company.UI.Views.Home), typeof(Company.Core.ViewModels.HomeVm));
            viewModelLocator.Register(typeof(Company.UI.Views.Customer), typeof(Company.Core.ViewModels.CustomerVm));

            base.OnStartup(e);

            // TODO : Themen die jetzt nicht beachtet wurden
            // Save und Cancel über IEdit abbilden (macht glaube ich auch Catel schon)
            // Mehrsprachenfähigkeit
            // ReadOnly bei keinem Schreibrecht
            // Das hinzufügen neuer Elemente
        }
Пример #4
0
        protected override void OnStartup(StartupEventArgs e)
        {
#if DEBUG
            //LogManager.AddDebugListener();
#endif

            Log.Info("Starting application");

            // Want to improve performance? Uncomment the lines below. Note though that this will disable
            // some features.
            //
            // For more information, see http://docs.catelproject.com/vnext/faq/performance-considerations/

            // Log.Info("Improving performance");
            // Catel.Windows.Controls.UserControl.DefaultCreateWarningAndErrorValidatorForViewModelValue = false;
            // Catel.Windows.Controls.UserControl.DefaultSkipSearchingForInfoBarMessageControlValue = true;

            // TODO: Register custom types in the ServiceLocator
            //Log.Info("Registering custom types");
            //var serviceLocator = ServiceLocator.Default;
            //serviceLocator.RegisterType<IMyInterface, IMyClass>();

            // To auto-forward styles, check out Orchestra (see https://github.com/wildgums/orchestra)
            // StyleHelper.CreateStyleForwardersForDefaultStyles();


            IViewModelLocator viewModelLocator = ServiceLocator.Default.ResolveType <IViewModelLocator>();

            viewModelLocator.Register(typeof(Views.MainWindow), typeof(MainWindowViewModel));
            viewModelLocator.Register(typeof(Views.PersonView), typeof(PersonViewModel));
            viewModelLocator.Register(typeof(Views.PersonTreeView), typeof(PersonTreeViewModel));

            Log.Info("Calling base.OnStartup");

            base.OnStartup(e);
        }
Пример #5
0
        /// <summary>
        /// Registers the specified view model in the local cache. This cache will also be used by the
        /// <see cref="ResolveViewModel{TView}" /> method.
        /// </summary>
        /// <typeparam name="TView">The type of the view.</typeparam>
        /// <typeparam name="TViewModel">The type of the view model.</typeparam>
        /// <param name="viewModelLocator">The view model locator.</param>
        /// <exception cref="ArgumentNullException">The <paramref name="viewModelLocator" /> is <c>null</c>.</exception>
        public static void Register <TView, TViewModel>(this IViewModelLocator viewModelLocator)
        {
            Argument.IsNotNull("viewModelLocator", viewModelLocator);

            viewModelLocator.Register(typeof(TView), typeof(TViewModel));
        }