public void P()
        {
            Thread thread = new Thread(() => { Dispatcher.Invoke((Action)(() => { RefreshPicture.RefreshPicturer(ListPicture, Convert.ToInt32(hour.Value), Convert.ToInt32(min.Value)); })); });

            refresh = thread;
            refresh.Start();
        }
 private void Button_Click_1(object sender, RoutedEventArgs e)
 {
     status.Items.Add("Выполняется");
     this.WindowState = WindowState.Minimized;
     RefreshPicture.RefreshPicturer(ListPicture, Convert.ToInt32(hour.Value), Convert.ToInt32(min.Value));
     this.WindowState = WindowState.Normal;
     status.Items.Add(@"Завершило выполнение и ожидает указаний");
 }
 private void Add_Click(object sender, RoutedEventArgs e)
 {
     RefreshPicture.AddPicture(ListPicture);
 }