예제 #1
0
        public App()
        {
            InitTrayMenu();

            translator = new Translator(
                ConfigurationManager.AppSettings["MsTransaltorApiUri"],
                new StsClient(new StsSettings(ConfigurationManager.AppSettings["StsUri"], ConfigurationManager.AppSettings["SubscribtionKey"])));
            translatorViewModel = new TranslatorViewModel(translator);
            translatorWindow    = new TranslatorWindow(translatorViewModel);

            spellCheckViewModel = new SpellCheckViewModel();
            spellCheckWindow    = new SpellCheckWindow(spellCheckViewModel);

            wndHandle = new WindowInteropHelper(translatorWindow).Handle;
            WinApi.RegisterAppHotKey(wndHandle);
            ComponentDispatcher.ThreadPreprocessMessage += ComponentDispatcher_ThreadPreprocessMessage;
            AppDomain.CurrentDomain.UnhandledException  += CurrentDomain_UnhandledException;
        }
예제 #2
0
 public TranslatorWindow(TranslatorViewModel viewModel)
 {
     InitializeComponent();
     this.viewModel   = viewModel;
     this.DataContext = viewModel;
 }