Click here to Skip to main content
15,122,559 members
Home / Discussions / WPF
   

WPF

 
Questionwpf gridview does not have a row selected event Pin
holdorf9-Aug-16 5:26
Memberholdorf9-Aug-16 5:26 
AnswerRe: wpf gridview does not have a row selected event Pin
Richard Deeming9-Aug-16 6:10
mveRichard Deeming9-Aug-16 6:10 
GeneralRe: wpf gridview does not have a row selected event Pin
holdorf9-Aug-16 10:57
Memberholdorf9-Aug-16 10:57 
GeneralRe: wpf gridview does not have a row selected event Pin
Richard Deeming9-Aug-16 11:09
mveRichard Deeming9-Aug-16 11:09 
GeneralRe: wpf gridview does not have a row selected event Pin
holdorf10-Aug-16 3:24
Memberholdorf10-Aug-16 3:24 
QuestionCopy directory with progress bar in WPF Pin
Dadou557-Aug-16 21:12
MemberDadou557-Aug-16 21:12 
AnswerRe: Copy directory with progress bar in WPF Pin
Richard MacCutchan7-Aug-16 22:14
mveRichard MacCutchan7-Aug-16 22:14 
GeneralRe: Copy directory with progress bar in WPF Pin
Dadou557-Aug-16 22:50
MemberDadou557-Aug-16 22:50 
i found this code (thanks for your link):

C#
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.IO;

namespace copynestedfolderformapplication
{
    public partial class Form1 : Form
    {
         int maxbytes = 0;
         int copied = 0;
         int total=0;
       
        public Form1()
        {
            InitializeComponent();
        }

        private void copybtn_Click(object sender, EventArgs e)
        {
            Copy1(@"F:\Posts", @"G:\copydata");
          
            MessageBox.Show("Done");
        }
       
        public void Copy1(string sourceDirectory, string targetDirectory)
        {
         
            DirectoryInfo diSource = new DirectoryInfo(sourceDirectory);
            DirectoryInfo diTarget = new DirectoryInfo(targetDirectory);
          //Gets size of all files present in source folder.
            GetSize(diSource, diTarget);
            maxbytes = maxbytes / 1024;
           
            progressBar1.Maximum = maxbytes;
            CopyAll(diSource, diTarget);
        }
        public void CopyAll(DirectoryInfo source, DirectoryInfo target)
        {
           
            if (Directory.Exists(target.FullName) == false)
            {
                Directory.CreateDirectory(target.FullName);
            }
            foreach (FileInfo fi in source.GetFiles())
            {
               
                fi.CopyTo(Path.Combine(target.ToString(), fi.Name), true);

                total += (int)fi.Length;
               
                copied += (int)fi.Length;
                copied /= 1024;
                progressBar1.Step =copied;
                            
                progressBar1.PerformStep();
                label1.Text = (total/1048576).ToString() + "MB of " + (maxbytes/1024).ToString() + "MB copied";
               
               
              
                label1.Refresh();
            }
            foreach (DirectoryInfo diSourceSubDir in source.GetDirectories())
            {
               
              
              
                DirectoryInfo nextTargetSubDir = target.CreateSubdirectory(diSourceSubDir.Name);
                CopyAll(diSourceSubDir, nextTargetSubDir);
            }
        }

        public  void GetSize(DirectoryInfo source, DirectoryInfo target)
        {

        
            if (Directory.Exists(target.FullName) == false)
            {
                Directory.CreateDirectory(target.FullName);
            }
            foreach (FileInfo fi in source.GetFiles())
            {
                maxbytes += (int)fi.Length;//Size of File
             
              
            }
            foreach (DirectoryInfo diSourceSubDir in source.GetDirectories())
            {
                DirectoryInfo nextTargetSubDir = target.CreateSubdirectory(diSourceSubDir.Name);
                GetSize(diSourceSubDir, nextTargetSubDir);
             
            }
           
        }
    }
}


where do i need to include the Backgroundworker in this code?
GeneralRe: Copy directory with progress bar in WPF Pin
Pete O'Hanlon7-Aug-16 23:06
mvePete O'Hanlon7-Aug-16 23:06 
GeneralRe: Copy directory with progress bar in WPF Pin
Dadou557-Aug-16 23:38
MemberDadou557-Aug-16 23:38 
GeneralRe: Copy directory with progress bar in WPF Pin
Pete O'Hanlon7-Aug-16 23:46
mvePete O'Hanlon7-Aug-16 23:46 
QuestionExecuting a WPF .exe program from an email link Pin
holdorf5-Aug-16 9:07
Memberholdorf5-Aug-16 9:07 
AnswerRe: Executing a WPF .exe program from an email link Pin
Richard Deeming5-Aug-16 9:26
mveRichard Deeming5-Aug-16 9:26 
AnswerRe: Executing a WPF .exe program from an email link Pin
holdorf5-Aug-16 10:40
Memberholdorf5-Aug-16 10:40 
GeneralRe: Executing a WPF .exe program from an email link Pin
Dave Kreskowiak5-Aug-16 10:45
mveDave Kreskowiak5-Aug-16 10:45 
AnswerRe: Executing a WPF .exe program from an email link Pin
Richard MacCutchan5-Aug-16 21:42
mveRichard MacCutchan5-Aug-16 21:42 
AnswerRe: Executing a WPF .exe program from an email link Pin
Gerry Schmitz6-Aug-16 8:07
mveGerry Schmitz6-Aug-16 8:07 
GeneralRe: Executing a WPF .exe program from an email link Pin
holdorf7-Aug-16 12:26
Memberholdorf7-Aug-16 12:26 
GeneralRe: Executing a WPF .exe program from an email link Pin
Gerry Schmitz7-Aug-16 13:16
mveGerry Schmitz7-Aug-16 13:16 
QuestionResourceDictionary swapped at run-time only applies to MainWindow Pin
James A. Young5-Aug-16 7:51
MemberJames A. Young5-Aug-16 7:51 
AnswerRe: ResourceDictionary swapped at run-time only applies to MainWindow Pin
Richard Deeming5-Aug-16 8:02
mveRichard Deeming5-Aug-16 8:02 
GeneralRe: ResourceDictionary swapped at run-time only applies to MainWindow Pin
James A. Young5-Aug-16 8:18
MemberJames A. Young5-Aug-16 8:18 
QuestionKeepTextBoxDisplaySynchronizedWithTextProperty Pin
Kevin Marois28-Jul-16 8:18
professionalKevin Marois28-Jul-16 8:18 
AnswerRe: KeepTextBoxDisplaySynchronizedWithTextProperty Pin
Matt T Heffron28-Jul-16 8:33
professionalMatt T Heffron28-Jul-16 8:33 
GeneralRe: KeepTextBoxDisplaySynchronizedWithTextProperty Pin
Kevin Marois28-Jul-16 8:39
professionalKevin Marois28-Jul-16 8:39 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.