Click here to Skip to main content
11,704,509 members (55,323 online)

Silverlight / WPF

 
GeneralRe: Winfroms Component Z-Index Pin
Richard Deeming18-Jul-13 1:16
professionalRichard Deeming18-Jul-13 1:16 
GeneralRe: Winfroms Component Z-Index Pin
Pete O'Hanlon18-Jul-13 1:21
protectorPete O'Hanlon18-Jul-13 1:21 
GeneralRe: Winfroms Component Z-Index Pin
Richard Deeming18-Jul-13 1:24
professionalRichard Deeming18-Jul-13 1:24 
AnswerRe: Winfroms Component Z-Index Pin
Pete O'Hanlon18-Jul-13 12:24
protectorPete O'Hanlon18-Jul-13 12:24 
QuestionHow to handle button click event from DataTemplate Pin
jainga1021314-Jul-13 15:35
memberjainga1021314-Jul-13 15:35 
AnswerRe: How to handle button click event from DataTemplate Pin
Amitosh S.M.14-Jul-13 17:52
memberAmitosh S.M.14-Jul-13 17:52 
GeneralRe: How to handle button click event from DataTemplate Pin
jainga1021317-Jul-13 10:46
memberjainga1021317-Jul-13 10:46 
QuestionMy Thoughts On My WPF App Design Pin
Kevin Marois12-Jul-13 11:40
memberKevin Marois12-Jul-13 11:40 
I'd like to get your thoughts on this design...

So I am writing some software for personal use. I'm an independent developer, and I wanted to put together an app to track the work I'm doing and handle invoicing and billing. Conceptually I understand what I want, but programmatically I am working on the design. This is more about me learning than producing an app.

So, I am building this WPF/MVVM app in components. Most pieces are user controls. I decided that I would use relay messages to communicate between the user control a& its host.

For example, the Client View is found in the Client Center.

Each Client is viewed in its own tab in the Client Center. The Client Center has a toolbar with New, Edit, Save, Cancel and Print buttons. Since the center doesn't really know about the Client views in the tabs, the Center will broadcast a message for each function. The Client Center has an instance of a TabManager class, which is a collection of TabItems. The TabItem's Tag property contains the PK of the entity in the tab's content. So, this is available in the View Model.

As an example, when the Save button on the Client Center toolbar is clicked, then it does:

ClientViewSaveMessage message = new ClientViewSaveMessage
{
    // Get the Client's PK from the active tab's Tag property
    Clientid = getActiveTabEntityPK()
};
 
Messenger.Instance.Send<ClientViewSaveMessage>(message);

Then in the client view I have

//CTOR
public ClientViewModel
{
    messenger.Instance.Register<ClientViewSaveMessage>(p => receiveSaveMessage(ClientViewSaveMessage)p)
}

and then the receiveSaveMessage

private void receiveSaveMessage(ClientViewSaveMessage message)
{
    // Only call Save if the message is for this Client
    if(this.Client.Id == message.ClientId)
    {
        saveChanges();  
    }
}


This technique has the advantage of decoupling all the components. So far it's working well. It's easy to develop, and so far, easy to maintain.

A drawback might be that I will need a lot of messages. I could make one message that has different properties...

Any way, I'd like to hear what you guys think.

Thanks
If it's not broken, fix it until it is

AnswerRe: My Thoughts On My WPF App Design Pin
Mycroft Holmes12-Jul-13 13:06
professionalMycroft Holmes12-Jul-13 13:06 
GeneralRe: My Thoughts On My WPF App Design Pin
Kevin Marois14-Jul-13 13:42
memberKevin Marois14-Jul-13 13:42 
GeneralRe: My Thoughts On My WPF App Design Pin
Mycroft Holmes14-Jul-13 14:11
professionalMycroft Holmes14-Jul-13 14:11 
GeneralRe: My Thoughts On My WPF App Design Pin
Kevin Marois15-Jul-13 5:11
memberKevin Marois15-Jul-13 5:11 
GeneralRe: My Thoughts On My WPF App Design Pin
Mycroft Holmes16-Jul-14 21:46
professionalMycroft Holmes16-Jul-14 21:46 
GeneralRe: My Thoughts On My WPF App Design Pin
Kevin Marois17-Jul-14 6:49
memberKevin Marois17-Jul-14 6:49 
GeneralRe: My Thoughts On My WPF App Design Pin
Mycroft Holmes17-Jul-14 12:43
professionalMycroft Holmes17-Jul-14 12:43 
GeneralRe: My Thoughts On My WPF App Design Pin
Kevin Marois17-Jul-14 12:59
memberKevin Marois17-Jul-14 12:59 
GeneralRe: My Thoughts On My WPF App Design Pin
Mycroft Holmes17-Jul-14 14:09
professionalMycroft Holmes17-Jul-14 14:09 
QuestionWPF ComboBox Problem Pin
Kevin Marois10-Jul-13 19:13
memberKevin Marois10-Jul-13 19:13 
AnswerRe: WPF ComboBox Problem Pin
Richard Deeming11-Jul-13 1:58
professionalRichard Deeming11-Jul-13 1:58 
GeneralRe: WPF ComboBox Problem Pin
Kevin Marois11-Jul-13 17:48
memberKevin Marois11-Jul-13 17:48 
GeneralRe: WPF ComboBox Problem Pin
Kevin Marois19-Jul-13 16:27
memberKevin Marois19-Jul-13 16:27 
Questionhow to make an navigation title dropdownlist Pin
neodeaths10-Jul-13 9:45
memberneodeaths10-Jul-13 9:45 
AnswerRe: how to make an navigation title dropdownlist Pin
Mycroft Holmes10-Jul-13 12:44
professionalMycroft Holmes10-Jul-13 12:44 
QuestionAny Idea CFL in Silverlight? Pin
Tanmoy Mohish9-Jul-13 19:57
memberTanmoy Mohish9-Jul-13 19:57 
AnswerRe: Any Idea CFL in Silverlight? Pin
Mycroft Holmes9-Jul-13 21:10
professionalMycroft Holmes9-Jul-13 21:10 

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

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


Advertise | Privacy | Mobile
Web01 | 2.8.150819.1 | Last Updated 27 Aug 2015
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid