Пример #1
0
        protected override async void OnStartup(StartupEventArgs e)
        {
            ShutdownMode = ShutdownMode.OnExplicitShutdown;
            Application.Current.DispatcherUnhandledException += UnhandledExceptionHndlr.OnCurrentDispatcherUnhandledException;
            EventManager.RegisterClassHandler(typeof(TextBox), TextBox.GotFocusEvent, new RoutedEventHandler((s, re) => { (s as TextBox).SelectAll(); }));             //tu: TextBox
            //---SetupTracingOptions("DDJ.", new TraceSwitch("OnlyUsedWhenInConfig", "This is the trace for all               messages... but who cares?   See ScrSvr for a model.") { Level = TraceLevel.Verbose });

            base.OnStartup(e);

#if __DEBUG
            new xPositionCircularSlider().ShowDialog();             // new KeyViewer().ShowDialog(); //			new AudioCompareMain().ShowDialog();
#else
            _vm = DdjViewModel.RestoreState(Settings.Default.DdjViewModel);
            //await _vm.LoadLkus();

            var vw = new MainPlayerView();

            _vm.Init_AutoStartPlayer(vw.wmp);

            var rv = BindableBaseViewModel.ShowModalMvvm(_vm, vw);

            await Task.Delay(1250);
#endif

            //InterceptKeys.UnHook();
            Application.Current.Shutdown();
        }
Пример #2
0
        protected override async void OnStartup(StartupEventArgs e)
        {
            ShutdownMode = ShutdownMode.OnExplicitShutdown;
            Application.Current.DispatcherUnhandledException += UnhandledExceptionHndlr.OnCurrentDispatcherUnhandledException;
            EventManager.RegisterClassHandler(typeof(TextBox), TextBox.GotFocusEvent, new RoutedEventHandler((s, re) => { (s as TextBox).SelectAll(); })); //tu: TextBox

            base.OnStartup(e);

#if __DEBUG
            new xPositionCircularSlider().ShowDialog();             // new KeyViewer().ShowDialog(); //			new AudioCompareMain().ShowDialog();
#else
            vmdl = DdjViewModel.RestoreState() ?? new DdjViewModel();

            var view = new MainPlayerView();

            vmdl.Init_AutoStartPlayer(view.wmp);

            var rv = BindableBaseViewModel.ShowModalMvvm(vmdl, view);

            await Task.Delay(1250);
#endif

            //InterceptKeys.UnHook();
            Application.Current.Shutdown();
        }