Example #1
0
        private static DialogRegistrator RegisterDialogs(Window wnd)
        {
            DialogRegistrator dialogRegistrator = new DialogRegistrator(wnd);

            dialogRegistrator.Register <AboutDialogViewModel, AboutWindow>();
            dialogRegistrator.Register <SavePresetDialogViewModel, SavePresetDialogWindow>();
            dialogRegistrator.Register <RenamePresetDialogViewModel, RenamePresetDialogWindow>();
            return(dialogRegistrator);
        }
Example #2
0
        private static UnityContainer RegisterTypes(DialogRegistrator dialogRegistrator, CycleBellManager manager)
        {
            var container = new UnityContainer();

            container.RegisterInstance <IDialogRegistrator>(dialogRegistrator);

            var alarm = new Alarm(new MediaPlayerFactory());

            alarm.LoadDefaultSoundCollection();
            alarm.SetDefaultSound();

            container.RegisterInstance <IAlarm>(alarm);

            container.RegisterInstance <ICycleBellManager>(manager);

            container.RegisterType <MainViewModel>();
            return(container);
        }