Example #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;
        }
 public SpellCheckWindow(SpellCheckViewModel viewModel)
 {
     InitializeComponent();
     this.viewModel   = viewModel;
     this.DataContext = viewModel;
 }