private void BtnSkip_Click(object sender, RoutedEventArgs e)
        {
            Button           button = sender as Button;
            RecognitionModel model  = button.Tag as RecognitionModel;

            PV_Recognizer.Train(model, "Unknown");
            icImages.ItemsSource = PeopleImage.Where(x => x.Processed == false);
        }
        private void BtnSave_Click(object sender, RoutedEventArgs e)
        {
            Button           button  = sender as Button;
            RecognitionModel model   = button.Tag as RecognitionModel;
            TextBox          textBox = (button.Parent as DockPanel).Children.OfType <TextBox>().FirstOrDefault();
            string           name    = textBox.Text;

            PV_Recognizer.Train(model, name);
            icImages.ItemsSource = PeopleImage.Where(x => x.Processed == false);
        }
        private void Worker_ProgressChanged(object sender, ProgressChangedEventArgs e)
        {
            List <RecognitionModel> result = (List <RecognitionModel>)e.UserState;

            foreach (RecognitionModel rm in result)
            {
                PeopleImage.Add(rm);
            }
            if (icImages.ItemsSource != list_images)
            {
                icImages.ItemsSource = PeopleImage.Where(x => x.Processed == false);
            }
        }
        void ReleaseDesignerOutlets()
        {
            if (PeopleImage != null)
            {
                PeopleImage.Dispose();
                PeopleImage = null;
            }

            if (PeopleName != null)
            {
                PeopleName.Dispose();
                PeopleName = null;
            }
        }
        void folder_Selected(object sender, RoutedEventArgs e)
        {
            TreeViewItem item   = (TreeViewItem)sender;
            ItemsControl parent = ItemsControl.ItemsControlFromItemContainer(item);

            if (parent != null && ((TreeViewItem)parent).Header.ToString() == "People" && ((TreeViewItem)parent).Tag.ToString() == "125987546187")
            {
                Console.WriteLine(item.Header.ToString());
                if (item.Header.ToString() == "Unknown" && item.Tag.ToString() == "Unknown")
                {
                    icImages.ItemsSource = PeopleImage.Where(x => x.Processed == false);
                }
                else
                {
                    List <ImageModel> result = PeopleImage.Where(x => x.Label == item.Header.ToString()).Select(x => x.FullImage).ToList();
                    icImages.ItemsSource = result;
                }

                return;
            }
            else
            {
                if (icImages.ItemsSource != list_images)
                {
                    icImages.ItemsSource = list_images;
                }
            }
            list_images.Clear();
            SelectedFolder = item.Tag.ToString();
            if (LoadImageWorker.IsBusy)
            {
                LoadImageWorker.CancelAsync();
                //while (loadImageWorker.IsBusy) ;
            }
            else
            {
                LoadImageWorker.RunWorkerAsync();
            }
            e.Handled = true;
        }