i'm doing a little project for a friend's business with C# Wpf and Entity Framework and im having some problems.
Here is what i've done so far:
I'm going to explain a little bit the diagram. The program is separated by tabs in clients, users, stock, etc. Every part is sub-separated, for example for clients is separated in View clients, Add client, etc.. Each separation is made with a different Xaml Control and the context to that control is set in the parent xaml to a property object existing the parent UI class.
So, there is a Main Xaml Window with context set to General UI Class in that main xaml window there is a control of Clients Xaml with context set to Client General UI Class.
And so on, in clients xaml there is a control of View Clients Xaml with context set to View Clients UI Class and a control of Add client Xaml with context set to Add Client UI Class
In View Clients UI Class is an element of Client Wrapper Class which is the current selected client to show with the client properties binded to the form controls. And there is also a list of Client Wrapper Class to show and search all existing clients.
Same concept for Add Client UI Class
Base Db Client Class is the class generated by Entity Framework to manage the entity in the database. This class is wrapped with Client Wrapper Class for purposes of data managment (some properties return complex data) but more important for WPF binding since Client Wrapper Class implements PropertyChangedEventHandler.
Now that we have the basics of the structure lets talk about the problems.
Client Wrapper Class has an element of Base Db Client Class and im not sure how to retrive the data of that element, if copy it or just return the properties of Base Db Client Class
When I retrive a list of Client Wrapper Class to store in View Clients UI Class relationship properties from clients like created by or status are disposed and the binding throws an error when try to display those properies in the form.
Sorry for not being more explicit and the poor quality of the diagram.
I hope you can point me in the right direction
Thank you all!!