/** public void createUc() - create user controls (display reminders) * */ public void createUc() { int i = 0; UserControl1[] uc = new UserControl1[200]; SQLiteConnection new_con = new SQLiteConnection(customwindow.Properties.Settings.Default.ConnectionString.ToString()); new_con.Open(); SQLiteCommand get = new SQLiteCommand("SELECT * FROM reminder LIMIT 0 , 30", new_con); String header; SQLiteDataReader reader; reader = get.ExecuteReader(); while (reader.Read()) { //data[i,0] = new ArrayList(); string[] str = new string[3]; str[0]=reader[0].ToString(); str[1]=DateTime.Parse(reader[1].ToString()).ToShortDateString(); str[2]=DateTime.Parse(reader[5].ToString()).ToShortTimeString(); reminderList.Add(str); header = String.Format("{1,-20} {0,5}", reader[2].ToString(), DateTime.Parse(reader[1].ToString()).ToShortDateString()); uc[i] = new UserControl1(); uc[i].setContent(Convert.ToInt16(reader[0].ToString()), reader[3].ToString(), reader[4].ToString(), DateTime.Parse(reader[5].ToString()).ToShortTimeString() , header); WrapPanel1.Children.Add(uc[i]); i++; } reminderlistarray = reminderList.ToArray(); }
void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target) { switch (connectionId) { case 1: this.UserControl = ((customwindow.UserControl1)(target)); return; case 2: this.LayoutRoot = ((System.Windows.Controls.Grid)(target)); return; case 3: this.Expander1 = ((System.Windows.Controls.Expander)(target)); return; case 4: this.UserControlExpanderGrid1 = ((customwindow.UserControlExpanderGrid)(target)); return; } this._contentLoaded = true; }