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.
It sounds like you're looking for the Flyout.Opening or Opened event. The Flyout should be the sender, and you can use FrameworkElement.FindName or VisualTreeHelper on the Flyout's Content to find child controls of the Flyout. Data binding will probably be cleaner and easier.
--Rob