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 TranslatorWindow(TranslatorViewModel viewModel) { InitializeComponent(); this.viewModel = viewModel; this.DataContext = viewModel; }