Click here to Skip to main content
15,905,420 members
Home / Discussions / WPF
   

WPF

 
GeneralRe: WPF - Why? Pin
Pete O'Hanlon11-Nov-14 20:46
mvePete O'Hanlon11-Nov-14 20:46 
QuestionProblem to synchronise two DataContext bound ComboBoxes Pin
Tom Rahav10-Oct-14 18:25
Tom Rahav10-Oct-14 18:25 
AnswerRe: Problem to synchronise two DataContext bound ComboBoxes Pin
Gerry Schmitz13-Oct-14 11:39
mveGerry Schmitz13-Oct-14 11:39 
GeneralRe: Problem to synchronise two DataContext bound ComboBoxes Pin
Tom Rahav13-Oct-14 14:39
Tom Rahav13-Oct-14 14:39 
QuestionDataGrid won't detect CTRL + C Pin
Mc_Topaz9-Oct-14 3:17
Mc_Topaz9-Oct-14 3:17 
AnswerRe: DataGrid won't detect CTRL + C Pin
Vincent Beek9-Oct-14 15:23
Vincent Beek9-Oct-14 15:23 
QuestionRe: DataGrid won't detect CTRL + C Pin
Mc_Topaz9-Oct-14 20:08
Mc_Topaz9-Oct-14 20:08 
AnswerRe: DataGrid won't detect CTRL + C Pin
Vincent Beek9-Oct-14 20:25
Vincent Beek9-Oct-14 20:25 
AnswerRe: DataGrid won't detect CTRL + C Pin
Hi I am Kevin29-Oct-14 6:05
Hi I am Kevin29-Oct-14 6:05 
QuestionViewBox Button alignment Pin
Member 102727486-Oct-14 10:00
Member 102727486-Oct-14 10:00 
AnswerRe: ViewBox Button alignment Pin
Mycroft Holmes6-Oct-14 14:21
professionalMycroft Holmes6-Oct-14 14:21 
QuestionDisplaying Validation Pin
cjb1102-Oct-14 21:49
cjb1102-Oct-14 21:49 
AnswerRe: Displaying Validation Pin
cjb1102-Oct-14 23:05
cjb1102-Oct-14 23:05 
QuestionReport Not Showing All Data Pin
Kevin Marois29-Sep-14 10:20
professionalKevin Marois29-Sep-14 10:20 
QuestionWPF Reporting Question Pin
Kevin Marois23-Sep-14 7:07
professionalKevin Marois23-Sep-14 7:07 
AnswerRe: WPF Reporting Question Pin
Bernhard Hiller23-Sep-14 21:56
Bernhard Hiller23-Sep-14 21:56 
GeneralRe: WPF Reporting Question Pin
Kevin Marois24-Sep-14 16:00
professionalKevin Marois24-Sep-14 16:00 
QuestionForm with ComboBoxes bound to the same source. Pin
cjb11016-Sep-14 2:45
cjb11016-Sep-14 2:45 
AnswerRe: Form with ComboBoxes bound to the same source. Pin
Pete O'Hanlon16-Sep-14 3:16
mvePete O'Hanlon16-Sep-14 3:16 
GeneralRe: Form with ComboBoxes bound to the same source. Pin
cjb11016-Sep-14 3:37
cjb11016-Sep-14 3:37 
GeneralRe: Form with ComboBoxes bound to the same source. Pin
Pete O'Hanlon16-Sep-14 6:25
mvePete O'Hanlon16-Sep-14 6:25 
GeneralRe: Form with ComboBoxes bound to the same source. Pin
cjb11017-Sep-14 22:05
cjb11017-Sep-14 22:05 
Ah, well right now we're not using VM. There's not a massive amount of experience, so we want to start slow and with what we're used to, so thats CodeBehind.

I've pasted, the XAML, Code Behind and entity here (given the size didn't seem sensible to flood the forum)
Pastie[^]

So each Unit has three fields (BusinessAreaId, DivisionalUnitId, ParentUnitId), that also reference a Unit, so I would like 3 comboboxes each with a list of units inside, and ideally as you add units, then the combobox items also grow.

My current ef entity load code is:
C#
BackgroundWorker worker = new BackgroundWorker();
//the action to run
worker.DoWork += (s, ev) =>
    {
        this.Dispatcher.Invoke(new Action(() =>
            UIHelper.ProgressBarRun(true)));

        context.Units.Load();
        context.UnitTypes.Load();
        unitNames = new ObservableCollection<UnitName>(
            context.Units.Local.Select(f => new UnitName() { Id = f.Id, Name = f.Name }));
    };
//what to run when the above completes
worker.RunWorkerCompleted += (s, ev) =>
    {
        viewSource.Source = context.Units.Local;
        unitTypeIdComboBox.ItemsSource = context.UnitTypes.Local;

        businessAreaIdComboBox.ItemsSource = unitNames;
        divisionalUnitIdComboBox.ItemsSource = unitNames;
        parentUnitIdComboBox.ItemsSource = unitNames;

        this.Dispatcher.Invoke(new Action(() =>
            {
                UIHelper.ProgressBarRun(false);
                navFirstButton.RaiseEvent(new RoutedEventArgs(Button.ClickEvent));
            }));
    };
//start the background work
worker.RunWorkerAsync();

AnswerRe: Form with ComboBoxes bound to the same source. Pin
cjb11022-Sep-14 4:29
cjb11022-Sep-14 4:29 
AnswerSubscribing to the PropertyChangedEventHandler of a class in a List from the class holding the List (solved, sort of...) Pin
GuyThiebaut14-Sep-14 1:25
professionalGuyThiebaut14-Sep-14 1:25 
GeneralRe: Subscribing to the PropertyChangedEventHandler of a class in a List from the class holding the List (solved, sort of...) Pin
SledgeHammer0114-Sep-14 9:41
SledgeHammer0114-Sep-14 9:41 

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.