Exemple #1
0
        /// <summary>
        /// Method to execute whenever the Library selection changes
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void ComboLibraries_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            // Assign the selected Library
            SelectedLibrary = comboLibraries.SelectedItem as Library;

            // Get all content from the select library
            MainManager.Families = Unifi.GetContentFromLibrary(SelectedLibrary.Id);

            // Loop through all Content and retrieve Manufacturer and Model parameter data
            foreach (var c in MainManager.Families)
            {
                c.Manufacturer = Unifi.GetParameterByName(c, "Manufacturer").Value;
                c.Model        = Unifi.GetParameterByName(c, "Model").Value;
            }

            // Display list of Content objects in main DataGrid
            dataGridMain.ItemsSource = MainManager.Families;

            // Update status message
            textBoxStatus.Text = SelectedLibrary.Name + ": " + MainManager.Families.Count().ToString();
        }