public Settings() { InitializeComponent(); templateService = new TemplateService(); pollService = new PollService(); List <Template> templateList = templateService.queryList(); bindingList = new BindingList <Template>(templateList); this.cmbTemplates.ItemsSource = bindingList; foreach (Template item in bindingList) { if (item.IsSelected) { this.cmbTemplates.SelectedItem = item; item.IsLasted = true; } } }
public MainWindow() { InitializeComponent(); indexs = new Dictionary <long, int>(); string directory = Environment.CurrentDirectory + "/data"; string dbPath = directory + "/SqliteModel.db"; bool exists = File.Exists(dbPath); if (!Directory.Exists(directory)) { Directory.CreateDirectory(directory); } dBManager = new DBManager(dbPath); if (!exists) { initTable(); } templateService = new TemplateService(); tagService = new TagService(); loadWindow(); }