public MainWindow(Settings settings, MainViewModel mainVM) { InitializeComponent(); DataContext = mainVM; _viewModel = mainVM; _settings = settings; }
public MainViewModel(Settings settings) { _saved = false; _queryTextBeforeLeaveResults = ""; _queryText = ""; _lastQuery = new Query(); _settings = settings; _historyItemsStorage = new JsonStrorage<History>(); _userSelectedRecordStorage = new JsonStrorage<UserSelectedRecord>(); _topMostRecordStorage = new JsonStrorage<TopMostRecord>(); _history = _historyItemsStorage.Load(); _userSelectedRecord = _userSelectedRecordStorage.Load(); _topMostRecord = _topMostRecordStorage.Load(); ContextMenu = new ResultsViewModel(_settings); Results = new ResultsViewModel(_settings); History = new ResultsViewModel(_settings); _selectedResults = Results; InitializeKeyCommands(); RegisterResultsUpdatedEvent(); SetHotkey(_settings.Hotkey, OnHotkey); SetCustomPluginHotkey(); }
public SettingWindow(IPublicAPI api, SettingWindowViewModel viewModel) { InitializeComponent(); _settings = viewModel.Settings; DataContext = viewModel; _viewModel = viewModel; _api = api; }
public ActionKeywords(string pluginId, Settings settings) { InitializeComponent(); _plugin = PluginManager.GetPluginForId(pluginId); _settings = settings; if (_plugin == null) { MessageBox.Show(_translater.GetTranslation("cannotFindSpecifiedPlugin")); Close(); } }
private void OnStartup(object sender, StartupEventArgs e) { Stopwatch.Normal("Startup Time", () => { RegisterDispatcherUnhandledException(); var settingVM = new SettingWindowViewModel(); _settings = settingVM.Settings; PluginManager.LoadPlugins(_settings.PluginSettings); var mainVM = new MainViewModel(_settings); var window = new MainWindow(_settings, mainVM); API = new PublicAPIInstance(settingVM, mainVM); PluginManager.InitializePlugins(API); ImageLoader.PreloadImages(); Current.MainWindow = window; Current.MainWindow.Title = Infrastructure.Constant.Wox; RegisterExitEvents(); AutoStartup(); AutoUpdates(); if (!_settings.HideOnStartup) { mainVM.MainWindowVisibility = Visibility.Visible; } }); }
public CustomQueryHotkeySetting(SettingWindow settingWidow, Settings settings) { _settingWidow = settingWidow; InitializeComponent(); _settings = settings; }