Пример #1
0
        /// <summary>
        /// Load the differents data to the form
        /// </summary>
        private void FrmMain_Loaded(object sender, RoutedEventArgs e)
        {
            try {
                // Load the actual build to the UserControls
                UcActualBuildStats.UcBuild         = ActualBuild;
                UcActualCustomBuildStats.UcBuild   = ActualBuild;
                UcActualSkillsManager.ActualSkills = ActualBuild.BSkill;
                UcActualRunesManager.ActualBuild   = ActualBuild;

                // Load data in datagrid and combobox
                ItemsDataGrid.ItemsSource = EncycloDB.GetAllItemsWithImg();

                MscbxRarity.ItemsSource = EncycloDB.GetAllRarities();
                MscbxType.ItemsSource   = EncycloDB.GetAllTypes();
                MscbxStats.ItemsSource  = EncycloDB.GetAllStats();

                // Create events
                CreateBuildImagesEvents();
                // Create an event that will trigger when the data of the datagrid are updated
                CollectionView myCollectionView = (CollectionView)CollectionViewSource.GetDefaultView(ItemsDataGrid.Items);
                ((INotifyCollectionChanged)myCollectionView).CollectionChanged += ItemsDataGrid_CollectionChanged;
            } catch (Exception ex) {
                MessageBox.Show(ex.Message);
            }
        }