public QueryConstructorWindow() { InitializeComponent(); SQLiteConnection connection = DatabaseConnectionHandler.Invoke(); TextBlockQueryHeader.Text = this.Title; //_allTables = connection.Query<Table>("SELECT name FROM sqlite_master WHERE type='table';").ToList(); _allTablesString = connection.Query <string>("SELECT name FROM sqlite_master WHERE type='table';").ToList(); _allTablesString.Insert(0, "-"); JoinTableElement jte = new JoinTableElement(); JoinTableElementStorage js = new JoinTableElementStorage(); js.FirstTable = _allTablesString; js.SecondTable = _allTablesString; jte.OwnStorage = js; JoinTableElementPack jp = new JoinTableElementPack(); jp.Element = jte; jp.Storage = js; var t = new List <JoinTableElementPack>(); jp.Element.PropertyChanged += ElementChangeHandler; t.Add(jp); ListBoxJoins.ItemsSource = t; }
private void ButtonAddJoinsRow_OnClick(object sender, RoutedEventArgs e) { List <JoinTableElementPack> packs = ListBoxJoins.ItemsSource as List <JoinTableElementPack>; JoinTableElement jte = new JoinTableElement(); JoinTableElementStorage js = new JoinTableElementStorage(); jte.OwnStorage = js; //js.FirstTable = GetExistTables(packs); js.FirstTable = _allTablesString; js.SecondTable = _allTablesString; JoinTableElementPack joinTableElementPack = new JoinTableElementPack { Element = jte, Storage = js }; joinTableElementPack.Element.PropertyChanged += ElementChangeHandler; packs.Add(joinTableElementPack); ListBoxJoins.ItemsSource = null; ListBoxJoins.ItemsSource = packs; }