public PreferencesViewModel(Preferences model)
        {
            this.model = model;

            editing = new Preferences();
            model.CopyTo(editing);

            CommitCommand = new RelayCommand(o => Commit());
            CancelCommand = new RelayCommand(o => Cancel());
        }
        public MainViewModel()
        {
            var setting = SearchQueryCompilerBuilder.Instance.BuildUpDefaultObjectCompilerSetting<ProductViewModel>();
            compiler = SearchQueryCompilerBuilder.Instance.BuildUpCompiler<ProductViewModel>(setting);
            Preferences = new PreferencesViewModel(((App)Application.Current).Preferences);

            Products = new ObservableCollection<ProductViewModel>();
            SearchResult = new ObservableCollection<ProductViewModel>();
            AutoCompleteItems = new ObservableCollection<IAutoCompleteItem>(setting.ExtractAutoCompleteItems());

            SearchCommand = new RelayCommand(o => Search(o.ToString()));
            LogCommand = new RelayCommand(o => OpenDiagnosticsView());
            PreferencesCommand = new RelayCommand(o => OpenPreferencesView());
            AboutCommand = new RelayCommand(o => OpenAboutView());
            CloseCommand = new RelayCommand(o => Close());
        }