Click here to Skip to main content
15,886,873 members
Home / Discussions / WPF
   

WPF

 
GeneralRe: Winfroms Component Z-Index Pin
Richard Deeming18-Jul-13 1:16
mveRichard Deeming18-Jul-13 1:16 
GeneralRe: Winfroms Component Z-Index Pin
Pete O'Hanlon18-Jul-13 1:21
mvePete O'Hanlon18-Jul-13 1:21 
GeneralRe: Winfroms Component Z-Index Pin
Richard Deeming18-Jul-13 1:24
mveRichard Deeming18-Jul-13 1:24 
AnswerRe: Winfroms Component Z-Index Pin
Pete O'Hanlon18-Jul-13 12:24
mvePete O'Hanlon18-Jul-13 12:24 
QuestionHow to handle button click event from DataTemplate Pin
jainga1021314-Jul-13 15:35
jainga1021314-Jul-13 15:35 
AnswerRe: How to handle button click event from DataTemplate Pin
AlphaDeltaTheta14-Jul-13 17:52
AlphaDeltaTheta14-Jul-13 17:52 
GeneralRe: How to handle button click event from DataTemplate Pin
jainga1021317-Jul-13 10:46
jainga1021317-Jul-13 10:46 
QuestionMy Thoughts On My WPF App Design Pin
Kevin Marois12-Jul-13 11:40
professionalKevin 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
professionalKevin 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
professionalKevin 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
professionalKevin 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
professionalKevin 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
professionalKevin Marois10-Jul-13 19:13 
AnswerRe: WPF ComboBox Problem Pin
Richard Deeming11-Jul-13 1:58
mveRichard Deeming11-Jul-13 1:58 
GeneralRe: WPF ComboBox Problem Pin
Kevin Marois11-Jul-13 17:48
professionalKevin Marois11-Jul-13 17:48 
GeneralRe: WPF ComboBox Problem Pin
Kevin Marois19-Jul-13 16:27
professionalKevin Marois19-Jul-13 16:27 
Questionhow to make an navigation title dropdownlist Pin
neodeaths10-Jul-13 9:45
neodeaths10-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 Mahish9-Jul-13 19:57
Tanmoy Mahish9-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    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.