New Posts New Posts RSS Feed: Multiple active views
  FAQ FAQ  Forum Search   Calendar   Register Register  Login Login

Multiple active views

 Post Reply Post Reply
Author
mikedfox View Drop Down
Newbie
Newbie


Joined: 29-Apr-2010
Posts: 21
Post Options Post Options   Quote mikedfox Quote  Post ReplyReply Direct Link To This Post Topic: Multiple active views
    Posted: 09-Apr-2012 at 7:30am
We currently are using PRISM for development, but it is more complicated that I'd like, so I'm very interested in the cocktail project.
 
One feature that makes PRISM so useful is the view/region management. In the TempHire video it was mentioned that it would be easy to implement multiple objects being editted at once, via a tab interface for example. However, other than with PRISM, I have never found that to be an easy thing to manage. Do you have any examples of using cocktail in a multi edit way, or any other kind of more complicated view composition?
 
 
Back to Top
mgood View Drop Down
IdeaBlade
IdeaBlade
Avatar

Joined: 18-Nov-2010
Location: Emeryville, CA
Posts: 583
Post Options Post Options   Quote mgood Quote  Post ReplyReply Direct Link To This Post Posted: 09-Apr-2012 at 10:39am
I don't have a ready example that I can send you, but I'll take some time to create a multi-edit version of TempHire, since I brought it up on the video.
Back to Top
mgood View Drop Down
IdeaBlade
IdeaBlade
Avatar

Joined: 18-Nov-2010
Location: Emeryville, CA
Posts: 583
Post Options Post Options   Quote mgood Quote  Post ReplyReply Direct Link To This Post Posted: 09-Apr-2012 at 7:20pm
Mike,
I've created an MDI version of TempHire that demonstrates what you are looking for. Double clicking on a row opens the item. You can download it from my Skydrive.

https://skydrive.live.com/redir.aspx?cid=b37183c914f0fbe8&resid=B37183C914F0FBE8!209&parid=B37183C914F0FBE8!208&authkey=!AN0Ya37NsYMJIuw

You can use a diff tool to see what's different between the SDI and the MDI version. The difference is very minimal. Mostly changes around lifecycle and closing strategy of the VMs and a TabManager to manage the open tabs. 

I've modified both the WPF and the Silverlight version. In Silverlight, because the TabControl is badly broken I opted for a row of buttons to switch between the open items. The WPF version uses a TabControl instead. The code is identical, just different views.
Back to Top
mikedfox View Drop Down
Newbie
Newbie


Joined: 29-Apr-2010
Posts: 21
Post Options Post Options   Quote mikedfox Quote  Post ReplyReply Direct Link To This Post Posted: 10-Apr-2012 at 1:24pm
thanks Marcel
Back to Top
giotis View Drop Down
Groupie
Groupie
Avatar

Joined: 26-Apr-2012
Location: Greece
Posts: 53
Post Options Post Options   Quote giotis Quote  Post ReplyReply Direct Link To This Post Posted: 08-May-2012 at 2:41pm
I tried to create a new MDI different version but failed,

is
possible ?


link about image  http://docs.google.com/open?id=0BwsfMcd3_Ex2akNSbk5sX0wxb1U
Back to Top
giotis View Drop Down
Groupie
Groupie
Avatar

Joined: 26-Apr-2012
Location: Greece
Posts: 53
Post Options Post Options   Quote giotis Quote  Post ReplyReply Direct Link To This Post Posted: 08-May-2012 at 2:47pm
Every time clicked the button "Resource Management" to create a new Tab
Back to Top
giotis View Drop Down
Groupie
Groupie
Avatar

Joined: 26-Apr-2012
Location: Greece
Posts: 53
Post Options Post Options   Quote giotis Quote  Post ReplyReply Direct Link To This Post Posted: 08-May-2012 at 3:01pm
or to create new Tab from StaffingResource.Id

link  http://docs.google.com/open?id=0BwsfMcd3_Ex2QTdlNDgySHRTR0E

Edited by giotis - 25-May-2012 at 4:55pm
Back to Top
giotis View Drop Down
Groupie
Groupie
Avatar

Joined: 26-Apr-2012
Location: Greece
Posts: 53
Post Options Post Options   Quote giotis Quote  Post ReplyReply Direct Link To This Post Posted: 08-May-2012 at 3:11pm
Back to Top
mgood View Drop Down
IdeaBlade
IdeaBlade
Avatar

Joined: 18-Nov-2010
Location: Emeryville, CA
Posts: 583
Post Options Post Options   Quote mgood Quote  Post ReplyReply Direct Link To This Post Posted: 08-May-2012 at 5:10pm
Yes, that can all be done. The answers are all in the MDI example.
Back to Top
giotis View Drop Down
Groupie
Groupie
Avatar

Joined: 26-Apr-2012
Location: Greece
Posts: 53
Post Options Post Options   Quote giotis Quote  Post ReplyReply Direct Link To This Post Posted: 25-May-2012 at 6:13pm
I studied extensively the cocktail and concluded that the object "DomainUnitOfWorkManager"
manage the "DomainUnitOfWork" for the creation and sharing of multiple object instances at runtime
but unique, one at a time. When we have same instance of "IWorkspace" more than once then we have a conflict
because we need to manage same "DomainUnitOfWork" objects and "DomainUnitOfWorkManager"does not leave us
because do not know who the owner is, behave as if there is only one owner, this is right but not an MDI
enviroment.
how to manage the incident?

comment
Very rightly at the new version you introduced the method "Refresh",
which fits well because in one instance we can delete a record and another instance should be informed accordingly.
-About "Refresh" a point here I think must be disable when state entity is modify because a silly Secretary
may delete pending entities-
Back to Top
mgood View Drop Down
IdeaBlade
IdeaBlade
Avatar

Joined: 18-Nov-2010
Location: Emeryville, CA
Posts: 583
Post Options Post Options   Quote mgood Quote  Post ReplyReply Direct Link To This Post Posted: 25-May-2012 at 11:03pm
If I understand you correctly, you want to be able to open the same entity in more than one tab. What's the use case for that? If you edit the same entity in multiple tabs you'll create a concurrency conflict with yourself. That doesn't make much sense. You don't open the same document twice in Word, either. If the document is already open, Word brings it to the foreground. The MDI TempHire example does the same. Anyway, the ObjectManager manages instances by keys. You pick the key that makes sense for your scenario. You can create an artificial key, for example a GUID for each of the open tabs instead of using the entity ID, but again, I'm not sure from a user experience opening the same entity in multiple tabs makes much sense. 

I'm not quite understanding your second point. A word about deleting. I know in TempHire you can actually delete a StaffingResource, but deleting is very bad in general. It causes lots of problems if you actually delete records from the database. Generally, you should not delete, but instead mark the record as inactive/expired or something like that. 


Edited by mgood - 25-May-2012 at 11:04pm
Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down