Click here to Skip to main content
       

Silverlight / WPF

 
AnswerRe: Need to Remove Extra column header in Datagrid PinprofessionalKenneth Haugland18-Jul-13 21:12 
AnswerRe: Need to Remove Extra column header in Datagrid PinmemberSebastian Meier18-Aug-13 1:04 
Question[SOLVED] Winfroms Component Z-Index [modified] PinmemberAmitosh S.M.14-Jul-13 19:34 
AnswerRe: Winfroms Component Z-Index PinprotectorPete O'Hanlon17-Jul-13 12:44 
GeneralRe: Winfroms Component Z-Index PinmemberAmitosh S.M.17-Jul-13 17:50 
GeneralRe: Winfroms Component Z-Index PinprotectorPete O'Hanlon17-Jul-13 21:22 
GeneralRe: Winfroms Component Z-Index PinprofessionalRichard Deeming18-Jul-13 2:16 
GeneralRe: Winfroms Component Z-Index PinprotectorPete O'Hanlon18-Jul-13 2:21 
GeneralRe: Winfroms Component Z-Index PinprofessionalRichard Deeming18-Jul-13 2:24 
AnswerRe: Winfroms Component Z-Index PinprotectorPete O'Hanlon18-Jul-13 13:24 
QuestionHow to handle button click event from DataTemplate Pinmemberjainga1021314-Jul-13 16:35 
AnswerRe: How to handle button click event from DataTemplate PinmemberAmitosh S.M.14-Jul-13 18:52 
GeneralRe: How to handle button click event from DataTemplate Pinmemberjainga1021317-Jul-13 11:46 
QuestionMy Thoughts On My WPF App Design PinmemberKevin Marois12-Jul-13 12: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 PinprofessionalMycroft Holmes12-Jul-13 14:06 
GeneralRe: My Thoughts On My WPF App Design PinmemberKevin Marois14-Jul-13 14:42 
GeneralRe: My Thoughts On My WPF App Design PinprofessionalMycroft Holmes14-Jul-13 15:11 
GeneralRe: My Thoughts On My WPF App Design PinmemberKevin Marois15-Jul-13 6:11 
GeneralRe: My Thoughts On My WPF App Design PinprofessionalMycroft Holmes16-Jul-14 22:46 
GeneralRe: My Thoughts On My WPF App Design PinmemberKevin Marois17-Jul-14 7:49 
GeneralRe: My Thoughts On My WPF App Design PinprofessionalMycroft Holmes17-Jul-14 13:43 
GeneralRe: My Thoughts On My WPF App Design PinmemberKevin Marois17-Jul-14 13:59 
GeneralRe: My Thoughts On My WPF App Design PinprofessionalMycroft Holmes17-Jul-14 15:09 
QuestionWPF ComboBox Problem PinmemberKevin Marois10-Jul-13 20:13 
AnswerRe: WPF ComboBox Problem PinprofessionalRichard Deeming11-Jul-13 2:58 
GeneralRe: WPF ComboBox Problem PinmemberKevin Marois11-Jul-13 18:48 
GeneralRe: WPF ComboBox Problem PinmemberKevin Marois19-Jul-13 17:27 
Questionhow to make an navigation title dropdownlist Pinmemberneodeaths10-Jul-13 10:45 
AnswerRe: how to make an navigation title dropdownlist PinprofessionalMycroft Holmes10-Jul-13 13:44 
QuestionAny Idea CFL in Silverlight? PinmemberTanmoy Mohish9-Jul-13 20:57 
AnswerRe: Any Idea CFL in Silverlight? PinprofessionalMycroft Holmes9-Jul-13 22:10 
GeneralRe: Any Idea CFL in Silverlight? PinmemberTanmoy Mohish9-Jul-13 22:38 
GeneralRe: Any Idea CFL in Silverlight? PinprofessionalMycroft Holmes9-Jul-13 23:45 
GeneralRe: Any Idea CFL in Silverlight? PinmemberTanmoy Mohish10-Jul-13 0:56 
GeneralRe: Any Idea CFL in Silverlight? PinprofessionalMycroft Holmes10-Jul-13 2:06 
AnswerRe: Any Idea CFL in Silverlight? PinmvpRichard MacCutchan10-Jul-13 2:40 
Questionhow to use equalizer using naudio wpf PinprofessionalMember 101119067-Jul-13 18:50 
Question[SOLVED] WPF Printing in milimeters [modified] PinmemberSaksida Bojan5-Jul-13 23:16 
SuggestionRe: WPF Printing in milimeters PinmemberAmitosh S.M.7-Jul-13 22:18 
GeneralRe: WPF Printing in milimeters PinmemberSaksida Bojan8-Jul-13 0:59 
QuestionWhat is the use of somefile.g.i.cs auto-generated file in Wpf? PinprofessionalMohammed Hameed3-Jul-13 21:24 
AnswerRe: What is the use of somefile.g.i.cs auto-generated file in Wpf? PinprotectorPete O'Hanlon3-Jul-13 21:45 
GeneralRe: What is the use of somefile.g.i.cs auto-generated file in Wpf? PinprofessionalMohammed Hameed3-Jul-13 22:10 
GeneralRe: What is the use of somefile.g.i.cs auto-generated file in Wpf? PinprotectorPete O'Hanlon3-Jul-13 22:44 
GeneralRe: What is the use of somefile.g.i.cs auto-generated file in Wpf? PinprofessionalMohammed Hameed3-Jul-13 22:55 
AnswerRe: What is the use of somefile.g.i.cs auto-generated file in Wpf? PinmvpRichard MacCutchan3-Jul-13 22:12 
GeneralRe: What is the use of somefile.g.i.cs auto-generated file in Wpf? PinprofessionalMohammed Hameed3-Jul-13 22:20 
GeneralRe: What is the use of somefile.g.i.cs auto-generated file in Wpf? PinmvpRichard MacCutchan3-Jul-13 23:29 
AnswerRe: What is the use of somefile.g.i.cs auto-generated file in Wpf? PinmemberAmitosh S.M.4-Jul-13 21:37 
GeneralRe: What is the use of somefile.g.i.cs auto-generated file in Wpf? PinprofessionalMohammed Hameed4-Jul-13 22:03 

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.141223.1 | Last Updated 27 Dec 2014
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid