Click here to Skip to main content
15,891,033 members
Home / Discussions / WPF
   

WPF

 
GeneralRe: ListView issues Pin
Pete O'Hanlon6-Mar-10 9:41
mvePete O'Hanlon6-Mar-10 9:41 
AnswerRe: ListView issues Pin
Pete O'Hanlon6-Mar-10 10:22
mvePete O'Hanlon6-Mar-10 10:22 
QuestionDisplay System.Windows.Forms.Form as child of Wpf Window Pin
abhinish6-Mar-10 1:01
abhinish6-Mar-10 1:01 
AnswerRe: Display System.Windows.Forms.Form as child of Wpf Window Pin
#realJSOP6-Mar-10 2:17
mve#realJSOP6-Mar-10 2:17 
GeneralRe: Display System.Windows.Forms.Form as child of Wpf Window Pin
abhinish6-Mar-10 5:00
abhinish6-Mar-10 5:00 
GeneralRe: Display System.Windows.Forms.Form as child of Wpf Window Pin
#realJSOP6-Mar-10 5:29
mve#realJSOP6-Mar-10 5:29 
GeneralRe: Display System.Windows.Forms.Form as child of Wpf Window Pin
Valentin Billotte31-May-10 4:51
Valentin Billotte31-May-10 4:51 
QuestionBackgroundWorker and comboBox.Items.Add(f) Pin
HahnTech5-Mar-10 15:35
HahnTech5-Mar-10 15:35 
Hi,
I'm new to Threading and WPF and need some help Adding to my Combo Box. I Understand I can't touch the UI from a background thread I just cant seem to figure out the work around. I got This Far. You'll see a Combo1.Items.Add(f); That is throwing.

If I can get a good example of how you are suppose to do something like this I'll have a chunk of code I can play with and learn from.

Thank you very much For any help

 private void button1_Click(object sender, RoutedEventArgs e)
        {
            string Server;
            Server = cmdServers.SelectedItem.ToString();           
            FillApplicationCombo(Server);
        }

void FillApplicationCombo( string Server)
        {
            int count;
            string Path;
            int Version;
            string AppName;            

            Path = @"\\" + Server + @"\" + "DOCFOCUS";

            progressBar1.Minimum = 0;
            progressBar1.Maximum = _DirectoryFiles.Count;

            _Worker = new BackgroundWorker();
            _Worker.WorkerReportsProgress = true;
            _Worker.WorkerSupportsCancellation = true;
            _Worker.DoWork += (s, args) =>
            {
                BackgroundWorker worker = s as BackgroundWorker;
                DirSearch(Path); //Gets All Files in the Path
               
                count = 0;
                foreach (string f in _DirectoryFiles)
                {
                    count++;
                    worker.ReportProgress(count);
                    

                    AppName = FileVersionInfo.GetVersionInfo(f).ProductName;
                    if (AppName == null)
                        continue;

                    if (AppName.ToUpper().IndexOf("MYAPPNAME") == -1)
                        continue;

                    Version = FileVersionInfo.GetVersionInfo(f).ProductMajorPart;//FileVersion;
                    
                    if (Version == 6)
                    {

                        Combo1.Items.Add(f);//What should I do about this?
                        
                    }
                }
            };

            _Worker.RunWorkerCompleted += (s, args) =>
            {
                progressBar1.Value = 0;
            };

            _Worker.ProgressChanged += (s, args) =>
           {
               progressBar1.Value = args.ProgressPercentage;
           };

            _Worker.RunWorkerAsync();

        }
Ronald Hahn, CNT - Computer Engineering Technologist

New Technologies Analyst

HahnTech Affiliated With Code Constructors
Edmonton, Alberta, Canada
Email: rhahn82@telus.net


AnswerRe: BackgroundWorker and comboBox.Items.Add(f) Pin
#realJSOP6-Mar-10 2:18
mve#realJSOP6-Mar-10 2:18 
GeneralRe: BackgroundWorker and comboBox.Items.Add(f) Pin
HahnTech8-Mar-10 12:31
HahnTech8-Mar-10 12:31 
QuestionMessage Removed Pin
5-Mar-10 3:38
professionalN_tro_P5-Mar-10 3:38 
AnswerRe: ResourceDictionaries Pin
Pete O'Hanlon5-Mar-10 4:34
mvePete O'Hanlon5-Mar-10 4:34 
GeneralMessage Removed Pin
5-Mar-10 8:33
professionalN_tro_P5-Mar-10 8:33 
GeneralRe: ResourceDictionaries Pin
Pete O'Hanlon5-Mar-10 9:41
mvePete O'Hanlon5-Mar-10 9:41 
QuestionDatabinding to a property which is a collection. Pin
ddecoy5-Mar-10 2:37
ddecoy5-Mar-10 2:37 
AnswerRe: Databinding to a property which is a collection. Pin
Pete O'Hanlon5-Mar-10 2:58
mvePete O'Hanlon5-Mar-10 2:58 
GeneralRe: Databinding to a property which is a collection. Pin
ddecoy5-Mar-10 3:08
ddecoy5-Mar-10 3:08 
QuestionCreating Custom Control in WPF (.Net 3.5) Pin
Mehdi Ghiasi4-Mar-10 23:13
Mehdi Ghiasi4-Mar-10 23:13 
AnswerRe: Creating Custom Control in WPF (.Net 3.5) Pin
Pete O'Hanlon4-Mar-10 23:21
mvePete O'Hanlon4-Mar-10 23:21 
QuestionRe: Creating Custom Control in WPF (.Net 3.5) Pin
Mehdi Ghiasi5-Mar-10 5:51
Mehdi Ghiasi5-Mar-10 5:51 
QuestionCustom Property for User control in MVVM model Pin
Joe Rozario4-Mar-10 19:13
Joe Rozario4-Mar-10 19:13 
AnswerRe: Custom Property for User control in MVVM model Pin
Pete O'Hanlon4-Mar-10 21:07
mvePete O'Hanlon4-Mar-10 21:07 
QuestionWPF - UIElement from binded property Pin
Ravi Mori4-Mar-10 19:10
Ravi Mori4-Mar-10 19:10 
AnswerRe: WPF - UIElement from binded property Pin
Pete O'Hanlon5-Mar-10 9:36
mvePete O'Hanlon5-Mar-10 9:36 
QuestionAgDataGrid Date column for Custom Date format [modified] Pin
Satish Pai4-Mar-10 17:23
Satish Pai4-Mar-10 17:23 

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.