Click here to Skip to main content
15,879,348 members
Home / Discussions / WPF
   

WPF

 
QuestionDynamically controls are binding vertically Pin
Ashfaque Hussain10-Dec-13 1:14
Ashfaque Hussain10-Dec-13 1:14 
AnswerRe: Dynamically controls are binding vertically Pin
Pete O'Hanlon10-Dec-13 1:34
mvePete O'Hanlon10-Dec-13 1:34 
QuestionHow to Make Buttons Pin
twoplass9-Dec-13 19:59
twoplass9-Dec-13 19:59 
SuggestionRe: How to Make Buttons Pin
thatraja16-Dec-13 0:36
professionalthatraja16-Dec-13 0:36 
GeneralWPF with Entity Framework. Pin
mishamit6-Dec-13 3:31
mishamit6-Dec-13 3:31 
GeneralRe: WPF with Entity Framework. Pin
Vincent Beek26-Feb-14 20:51
Vincent Beek26-Feb-14 20:51 
GeneralRe: WPF with Entity Framework. Pin
mishamit27-Feb-14 10:28
mishamit27-Feb-14 10:28 
QuestionWPF User Control Revisited Pin
Kevin Marois4-Dec-13 8:08
professionalKevin Marois4-Dec-13 8:08 
WPF using MVVM...

I have posted similar questions before and honest;y I haven't always uinderstood the responses. Now I have a new requirement from my client and I have to revisit this.

Please see this screen shot[^]. On the right is a section of the Job Screen called Job Personnel with 6 combo boxes. The XAML for the Superintendant is shown also. Up till now, the combo box was populated from a list of employees filtered to only those that is IsSupervisor = true.

The new requirement is that this drop down, and all others that show employees, will be loaded based on the employee's position. An Employee's position is set in the Employee screen.

So, the app will now query all employees for a position code. Positions are stored in a lookup table with a code relevant to each position:

LookupCode   SystemCode      Caption
------------ --------------- ---------------------
empposition  accountant      Accountant
empposition  fldsuper        Field Superintendent
empposition  foreman         Foreman
empposition  projectmanager  Project Manager
empposition  safetyofficer   Safety Officer

I now need to add the button next to any combo showing Employees so that the user can pick ANY employee and assign him to the drop down. It's a way to temporarily override the position.

Please see this[^]

So, on load the combo will be loaded from the lookup table using the code. Then when the user picks a new employee via the dialog, that employee is added to the combo and its Id is assigned to the Job.SuperintendantId.

So far I can handle all of this. Here's where I get hung up...

I think that this should be done via a control. The control would have the label, a combo, and button. Somewhere I would set the code, probably in the XAML. ALso in the XAML the selected EmployeeId from the control would be exposed and bound to the appropriate field on the job, or whatever entity is using employees. By making this a control I can use it all over the app.

What I don't understand is how to create this. I'm guessing the selected Id needs to be a DP so I can bind to it. Can I do in XAML? I'm using MVVM. Do I create a view and VM and work with that?

I could use some direction. An example would be great.

Many thanks
If it's not broken, fix it until it is

AnswerRe: WPF User Control Revisited - Figured it out, with one question though... Pin
Kevin Marois4-Dec-13 10:49
professionalKevin Marois4-Dec-13 10:49 
GeneralRe: WPF User Control Revisited - Figured it out, with one question though... Pin
Jason Gleim4-Dec-13 13:01
professionalJason Gleim4-Dec-13 13:01 
QuestionHow to Set RadProgress bar on method load Pin
ramkie3-Dec-13 18:19
ramkie3-Dec-13 18:19 
AnswerRe: How to Set RadProgress bar on method load Pin
Mycroft Holmes3-Dec-13 18:53
professionalMycroft Holmes3-Dec-13 18:53 
QuestionPass values between windows Pin
shers2-Dec-13 6:35
shers2-Dec-13 6:35 
AnswerRe: Pass values between windows Pin
Elman905-Dec-13 23:02
Elman905-Dec-13 23:02 
AnswerRe: Pass values between windows Pin
Andy41120-Dec-13 2:36
Andy41120-Dec-13 2:36 
Questionhow to access cell template control's in listview in wpf Pin
dharmaa.m1-Dec-13 7:20
dharmaa.m1-Dec-13 7:20 
AnswerRe: how to access cell template control's in listview in wpf Pin
Mycroft Holmes1-Dec-13 11:48
professionalMycroft Holmes1-Dec-13 11:48 
GeneralRe: how to access cell template control's in listview in wpf Pin
dharmaa.m1-Dec-13 22:03
dharmaa.m1-Dec-13 22:03 
AnswerRe: how to access cell template control's in listview in wpf Pin
Varsha Ramnani1-Dec-13 23:15
professionalVarsha Ramnani1-Dec-13 23:15 
GeneralRe: how to access cell template control's in listview in wpf Pin
dharmaa.m2-Dec-13 0:32
dharmaa.m2-Dec-13 0:32 
GeneralRe: how to access cell template control's in listview in wpf Pin
Varsha Ramnani2-Dec-13 1:10
professionalVarsha Ramnani2-Dec-13 1:10 
QuestionHow to send the parent name when we click on chlid Pin
Ashfaque Hussain29-Nov-13 3:41
Ashfaque Hussain29-Nov-13 3:41 
QuestionCreate two window by silverlight for windows embeded compact7 os Pin
yingkou21-Nov-13 2:09
yingkou21-Nov-13 2:09 
AnswerRe: Create two window by silverlight for windows embeded compact7 os Pin
Mycroft Holmes21-Nov-13 11:48
professionalMycroft Holmes21-Nov-13 11:48 
GeneralRe: Create two window by silverlight for windows embeded compact7 os Pin
yingkou23-Nov-13 18:02
yingkou23-Nov-13 18:02 

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.