I know the canonical way to assign data to controls in the XAML world is to use binding like so in the XAML file:
<ListBox x:Name="lstbxPhotosets" ItemsSource="{Binding photosets}" . . .
...but I would just as soon assign it in code, something like this:
private void flyout_FlewOpen(object sender, RoutedEventArgs reargs)
{
sender.lstbxPhotosets.Items = GetPhotosets();
}
internal static List<String> GetPhotosets()
{
List<String> psets = new List<string>();
using (var db = new SQLite.SQLiteConnection(App.DBPath))
{
string sql = "SELECT photosetName FROM PhotraxBaseData ORDER BY photosetName";
psets = db.Query("sql"); // <= pseudocode; this doesn't compile
}
return psets;
}
Is this possible? If so, what event does the Flyout expose that I can tap into (no pun intended)?
Can I access controls on the Flyout via "sender", or...???
Note: This is a Windows 8.1 app, and a native (not Callista) flyout.