PRISM Master-Details with navigation between the Master and details view

Hi, I have a Master list with accounts and a Details list containing transactions.
The Master list : has a UserControl (AccountListView) and Viewmodel(AccountListViewModel)
The list is bound to an observable collection of type AccountViewModel and has a SelectedAccount property to get the current selected account. Each AccountViewModel has a collection of type TransactionViewModel.
 public AccountListView(IAccountListViewModel viewModel)
            //this.DataContext = vm;
            InitializeComponent();
            ViewModel = viewModel;
        public Infrastructure.IViewModel ViewModel
            get
                return (IAccountListViewModel)DataContext;
            set
                DataContext = value;
//the viewmodel
        public AccountListViewModel(IRegionManager regionManager)
            this.regionManager = regionManager;
            this.AccountList = GetAccounts(); // gets the list of accounts from another layer
        public AccountViewModel SelectedAccount
            get { return selectedAccount; }
            set
                selectedAccount = value;
                OnPropertyChanged("SelectedAccount");
And the Details view has a user control(TransactionListView) and a viewmodel(AccountView);
public TransactionListView(IAccountViewModel viewModel)
            InitializeComponent();
            ViewModel = viewModel;
            //this.DataContext = vm.SelectedAccount;
        public Infrastructure.IViewModel ViewModel
            get
               return (IAccountViewModel)DataContext;
            set
                DataContext = value;
//the viewmodel 
public AccountViewModel(Business.Account a)
                AccountId = a.AccountId;
                accountName = a.AccountName;
I created a hyperlink command so that whenever I click on the name of an account from the master list it will navigate to the detail list and set the as the DataContext the account I clicked on. Before I had both Master and Detail lists displayed at the
same time and set the DataContext of the Detail List as the SelectedAccount property(which is bound to the SelectedItem of the Master List) of the Master List. I am not sure how to pass the SelectedAccount when I navigate to the Detail List and set it as the
DataContext of the Detail List.
       

>>I'm using the reguestnavigate method, but from what I read you can't pass objects as parameters ?
As I mentioned there is a NavigationParameters class that you can create an instance of and pass as a parameter to the RequestNavigate method in Prism 5:
private void NavigateTransaction(AccountViewModel obj)
var parameters = new NavigationParameters();
parameters.Add("accountViewModel", obj);
regionManager.RequestNavigate(RegionNames.ContentRegion, new Uri(transactionview, UriKind.Relative), parameters);
The TransactionView should then implement the Microsoft.Practices.Prism.Regions.INavigationAware interface and retrieve the parameter in the OnNavigatedTo method:
public partial class TransactionView : UserControl, INavigationAware
public TransactionView()
InitializeComponent();
void INavigationAware.OnNavigatedTo(NavigationContext navigationContext)
AccountViewModel myParameter = navigationContext.Parameters["accountViewModel"] as AccountViewModel;
this.DataContext = myParameter;
public bool IsNavigationTarget(NavigationContext navigationContext)
return true;
public void OnNavigatedFrom(NavigationContext navigationContext)
In Prism 4 there is no NavigationParameters class so you either need to upgrade to Prism 5 if you haven't already done so or you could store the parameters to be passed yourself somewhere else. Please refer to the following links for more information and
examples of how you could do this:
http://stackoverflow.com/questions/9320638/how-to-pass-an-object-when-navigating-to-a-new-view-in-prism
http://visualstudiomagazine.com/articles/2012/08/20/view-communication-in-wpf-and-prism.aspx
Please also remember to mark helpful posts as answer to close the thread and then start a new thread if you have a new question. Please don't ask several questions in the same thread.

Similar Messages

  • My host name changes every few days, since Xmas adding a macbook its changed 6 times. Do I need to stop this? Does it cause problems with sharing between the iMac and macbook?

    my host name changes every few days, since Xmas adding a macbook its changed 6 times. Do I need to stop this? Does it cause problems with sharing between the iMac and macbook?

    There are several possible causes for this problem.
    1. Two (or more) computers on the local network have the same Bonjour name, such as "X's-MacBook-Pro.local".
    2. You have two simultaneous connections to the same local network: probably Ethernet and Wi-Fi. If applicable, disconnect the Ethernet cable or turn off Wi-Fi.
    3. A Mac wakes from sleep due to network traffic. This is due to a bug in OS X that may only affect some models.
    4. A device that gets its network address from the router wakes from sleep, and the address it was using before has been assigned to another device.
    5. A third-party wireless router has incompatible settings or firmware. In that case, refer to the manufacturer or ISP for support. Restarting the router may help, temporarily.
    6. See also this support article.
    Rename the computer in the Sharing preference pane.

  • "New"iPad with dust between the glas and the display?

    Hello,
    i bought an iPad 3(32gb wlan)on the first day and it had dust between the glas and the display.
    today i got a new one and it has the same "problem"
    My questions is does someone else bought an iPad with an dusty screen?

    My second was totally clean, the first one had dust on the surface of the screen. Not inside it.

  • Interesting Differences Between the iPad and Android Viewing Experience

    Well, interesting to me, anyway. 
    Here's some things I've noticed:
    Image Sequence
    The Android is the clear winner here, as the image sequence doesn't spin out of control when you lift up your finger like it does on the iPad.  In fact, the viewing experience on the iPad is truly wretched and I've had to add notes under the view window telling people to keep their finger on the image when swiping in order to maintain control.  I was getting complaints.  Adobe, what's the issue here?  Can the iPad viewer be brought under control?
    Reset the entire Folio to the top-most page of every article
    Tapping 3 times on the folio name in the viewer will reset each article to the top-most page with viewing on the iPad.  Android?  No such luck.  Bit of a pain, that.
    InLine Video
    I realize this isn't a feature for Android yet, but it truly can't get here fast enough.  Ouch.  Pressing on the main Android menu back button twice (fast) will exit the fullscreen video and get you back to the page, but still....  Eeew.
    Reset Entire Folio After Folio Update
    With the iPad, after a folio update the entire thing is reset to the cover page.  With Android, it stays where you left off.  Not saying one is better than the other, but we sure do need a main FOLIO RESET button somewhere.  And bookmarks.  lol.
    No Folio Instruction Sheet on Android
    I know that Apple requires some sort of content to be contained within an app before approval, but not having that folio on the Android sure is nice.  Again, wonder if there's a way to just write some code into the viewer to fool iTunes?
    Installing after download
    I'd say it's twice as fast on the iPad vs the Android.  I've got a Xoom, but this is probably an app issue more than an OS or hardware issue.  ?
    Anyone noticed something else?

    iPad charger is 2amps.
    iPhone is 1 amp.
    The iPhone charger will charge the iPad, but at a slower rate.

  • TS1702 I have recently begun to use Pages and want to transfer a document between the iPad and my PC. I can transfer to the iPad, but not the other way, and am told I do not have sufficient 'privileges'. What does this mean? Also can't use iCloud with Pag

    I have recently begun to use Pages and want to transfer a document between the iPad and my PC. I can transfer to the iPad, but not the other way, and am told I do not have sufficient 'privileges'. What does this mean? Also I can't use iCloud with Pages between the iPad and PC,  although I purchased extra storage in order to do this.

    If you have a PC, you don't have Pages on it. You can transfer Pages presentations to/from iCloud via http://www.icloud.com , however -- you just won't have an app on your PC to deal with Pages documents. Make sure that you have your iCloud account properly configured on your iPad.

  • [svn:osmf:] 10655: Removing the hack we came up with for using the MAST plugin in the Flex unit tests .

    Revision: 10655
    Author:   [email protected]
    Date:     2009-09-28 13:52:01 -0700 (Mon, 28 Sep 2009)
    Log Message:
    Removing the hack we came up with for using the MAST plugin in the Flex unit tests.
    Modified Paths:
        osmf/trunk/framework/MediaFrameworkFlexTest/.actionScriptProperties
        osmf/trunk/framework/MediaFrameworkFlexTest/org/openvideoplayer/MediaFrameworkTests.as
    Removed Paths:
        osmf/trunk/framework/MediaFrameworkFlexTest/org/openvideoplayer/mast/
        osmf/trunk/plugins/MASTLib/

    Hi OMAW8,
    It would be better if you could share us the detailed error message in English.
    Do you mean that you could run your test in your build agent machine? If so, I doubt that it would be related to the TFS build. I mean that maybe it is not the test issue.
    Please share the detailed error in English, and then post this issue to the TFS-build forum would be better for this issue since it works well in build agent machine.
    Form link:
    https://social.msdn.microsoft.com/Forums/vstudio/en-US/home?forum=tfsbuild
    Reference:
    https://msdn.microsoft.com/en-us/library/hh691189.aspx
    Best Regards,
    Jack
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • How can I get the phone numbers in contacts to appear with dashes between the first 3 numbers, the next 3 numbers, and the last 4 numbers?  Until very recently it did so.  Contacts on my macbook pro does show up this way.  I do have a mobile me account an

    How can I get the phone numbers in contacts to appear with dashes between the first 3 numbers, the next 3 numbers, and the last 4 numbers?  Until very recently
    it did so.  Contacts on my macbook pro does show up this way.  I do have a mobile me account and in the past syncing was no problem.  What setting has changed?

    The phone number format as well as the date language and format and the time format are controlled by the Region Format setting. Go to Settings > General >International > Region Format.  When you change a region format, you can go back one page (to International) and see an example of the date/time/phone number format that your selected region format will produce.

  • After saving a PDF with a Spot UV layer, all of the highlights and detail under the spot color are flattened in Overprint Preview. What am I missing here?

    I'm attempting to print some business cards with a Spot UV coating. I have a layer above the artwork with a spot color (set to green per the printer's request). Underneath is a logo, essentially a red circle with some highlights and depth. My issue is that, after exporting a PDF, all of the highlights and detail on the red circle disappear in Overprint Preview (it's there when I hide the Spot UV layer, but missing when I hide the Spot Color). What can I do to retain that information?
    Thanks!

    Let me know if you need different screen grabs. Thanks in advance.

  • Displaying a fraction with a horizontal bar between the denominator and numerator

    Hello guys
    I have a dynamic textfield and am going to display textual content in it dynamically.
    But I have a fraction in that textual part and I want to display that fraction as a "typical fraction with a horizontal bar between the denominator and numerator". Hope you understand what I am asking.
    Please look at the attached image.
    Thanks for your input.
    cheers

    @dmennenoh
    Thanks for your input.
    So its kind of superimposing Sprite or MovieClip that has a fraction.Basically I have to make two textfields and put them together over a horizontal bar so that it looks like a fraction and then place it over a big textfield where the fraction should be.
    Its a very long process.
    OMG, isn't there any other easy way to do this?

  • Does anyone know if there is any difference at all in the display between the 4 and the 4s.  I use my 4 with no problems but have issues with the 5 - makes me feel ill.  Any help appreciated before I make an expensive mistake

    Can anyone tell me if there is any difference at all in the display between the 4 and 4s.  It appears they are the same from the specs but I dont want to make an expensive mistake.  I can use the 4 with no problems but the 5 makes me feel ill and I am hoping I can upgrade to a 4s with no issues. Any help appreciated.

    In a technical sense, the differences between the displays on the iPhone 4 vs 4s are vast.  I'm mean, they are both attached to 70 - 90% of the internal components and far from interchangeable.  There are no differences however, that are noticeable by the user.

  • How come there isn't a comma between the city and state when I go to make an envelope with an address book contact?

    How come there isn't a comma between the city and state when I go to make an envelope with an address book contact?

    On an envelope, there's not supposed to be. The US Postal Serveice prefers no punctuation, which can interfere with machine sorters. USPS Address Format

  • Setting the ALV Hierarchy tree with grid line between the columns and rows

    Hi Experts,
    I would like to ask if there is any suggestion on setting the ALV hierarchy tree to be separated by grid line between the columns and rows just like how it is display the same way in normal ALV grid.
    Thanks in advance.

    Hi Lin,
    The requirement which you have stated is not possible.
    Lin,
    Also i have a query regarding BADI ZME_PROCESS_REQ_CUST, which you had raised on SDN. You have marked the question as solved/answered.
    Changing the data of a customize field in purchase requisition
    Could you please let me know, the steps you did to update the screen fields through the BADI.
    I would really appreciate your reply, because i am facing exactly the same problem which you have mentioned.
    Thanks,
    Best regards,
    Prashant

  • Can't establish wireless connection between the printer and computer.

    I recently upgraded my wireless to an Apple AirPort Time Capsule. I'm able to set up the printer via USB cable. And I'm able to set up the printer on the network via the Airport WPA utility. However I cannot establish a wireless connection between the computer and the printer. When I go to the printers window  in my system prefereces, there is no wireless printer available to add in the "available printers" menu. Only the USB version printer is listed and of course when I disconnect the USB cable it shows as offline.I've tried all the fixes on HP's support pages. I've tried reinstalling the printer on both the router and the computer numerous times. The only thing I haven't done is reinstall the printer using the "Install Wizard" software that is supposed to come with the printer - (mine never came with it in the first place and of course HP doesn't have it available for download). And when I reset the printer to factory settings, then connect it to the computer via the USB, there is no installation software that pops up. Cant even find the **bleep** thing in "Finder". (I'm assuming that it should show up as some sort of external device.) I've checked to make sure both computer and printer are on the same network. (sometimes my computer will grab a connection with the next nearest network.) I've checked all the settings for the printer via the HTML configuration utility. I've even updated my Macbook software and restarted it multiple times. Note: the printer actually worked for a bit when I first switched routers, but the printer's wireless function went offline several times and then quit  altogether. Really frustrated that I bought another HP product thinking this time things would be different. HP is no help unless you want to pay $$ for a phone call. I'm about ready to take this thing out in the desert to use for target practice and never buy another HP product ever again.

    Hi , I saw your post regarding the problems you are having with your LaserJet Pro P1102w Printer not showing on your Macintosh computer. I may have found some resources for you. 
    I have a few questions for you, so I can offer some additional assistance:Before you upgraded to the Apple AirPort Time Capsule, was the printer working wirelessly without any issues?
    When you say; 'I reset the printer to factory settings', how where you trying to do this? 
    I found some instructions from this post: How do I reset my Laserjet p1102w to its defaults, copied here for you:
    To restore the printer back to factory settings, turn the printer off, hold down the wireless button and the cancel button (x button) then turn the printer back on and don't release the two buttons until the printer stops making noise. (When they say turn the printer off, I think they mean unplug the power cable.)
    "I've checked to make sure both computer and printer are on the same network."  Do you know if you are able to access the printers Embedded Web Server (EWS)?To access the EWS - Make sure that the Ready light () is on and that the printer is idle and silent.Press and hold the Cancel button (), and release it when the Ready light () begins blinking.The configuration page prints.Type the IP address or host name of the product in the address field of a supported Web browser, and then press Enter on your keyboardLet me know if this page loads 
    To answer a few more items you have listed:... When I go to the printers window in my system preferences, there is no wireless printer available to add in the "available printers" menu.This could be an issue with your print system, I recommend resetting the printing system and then Repair Disk Permissions - after that try to add the printer again.
    ... the "Install Wizard" software that is supposed to come with the printer - (mine never came with it in the first place and of course HP doesn't have it available for download)HP provides their software/drivers to Apple to be released through your Apple software updates. You can review this document on how to Install a Mac Printer Driver Using Apple Software Update. Which leads into your next point...
    ... there is no installation software that pops upWhen you connect the USB cable your mac may still recognize the printer software as being already installed - check for apple updatesOn the Mac, click the Apple menu (), and then click Software Update, or click About this Mac, and then click Software Update. A list of available updates displays.
    ... Not seeing the printer in "Finder" From what I understand most printers will not show in Finder unless you install a memory card into a supported port on certain printer models, only then will it read it like an external device. A few more things you can check are that the new settings in the Apple AirPort Time Capsule are setup to allow the printer to communicate. There are several of these settings listed in this document; Tips and Workarounds for Common Wireless Network Printer Issues.  HP regularly releases firmware updates that may also correct the problem you are experiencing. You can click on this link to Getting Printer Updates for HP LaserJet Pro P1102w Printer.  I did find 2 more documents that may offer some additional information as well;HP LaserJet Pro P1102w Printer - Connecting the Printer After Changing Your Wireless NetworkAn 'Unable to Find Printer' Error Displays for the HP LaserJet Pro P1102w Printer  Please let me know if any of these steps resolved your issue, or the details of what happened.  I look forward to hearing from you, hopefully with good news!   Thanks, 

  • What are the functional differences between the iPhone and the iPod Touch, barring of course the differences in service requirements.

    What are the functional differences between the iPhone and the iPod Touch, barring of course the differences in service requirements.

    For one, their form factors are slightly different as the iPhone has a bit more squarish body whereas the iPod Touch has a tapered back to it. 
    The iPhone also has much better front and rear cameras. Exact details as to the difference in megapixels depends on whether or not you talking about the iPhone 4 or 4S.  If you would like to get more details, you can always view
    each models specs on Apple's online store.
    See here for a better explanation.
    http://en.wikipedia.org/wiki/IPod_Touch#Comparison_to_the_iPhone
    I'm sure others will chime in with other things as well.
    B-rock

  • My SD video keeps jumping between the upper and lower frames. So the video starts frame blending and blurring in and out.

    My SD video keeps jumping between the upper and lower frames.  So the video starts frame blending and blurring in and out.  The sequence settings are set to
    Editing Mode: DV NTSC 29.97 frames/second. 
    Pixel Aspect Ration: D1/DV NTSC (0.9091)
    Fileds: Lower Field First
    Display Format: 30fps Non-Drop-Frame Timecode
    720 x480

    What is the source of your video, and exactly what is inside your video?
    Report back with the codec details of your file, use the programs below... A screen shot works well to SHOW people what you are doing
    http://forums.adobe.com/thread/592070?tstart=30 for screen shot instructions
    Free programs to get file information for PC/Mac http://mediaarea.net/en/MediaInfo/Download

Maybe you are looking for

  • ITunes 9.2.1 doesn't see my iPhone 3G 4.0 on Windows 7 x64

    Hi everyone. I'm running Windows 7 x64 and have been having this problem since I updated my iTunes to 9.2. The problem is I plug my phone in, and iTunes doesn't see it. After plugging it in, iTunes seems to struggle a bit, lags, before finally runnin

  • Server 2008 R2 with WSUS need to specify location for Feature install for Server 2012 and Windows 8

    Having a problem where we need to add .net 3.5, amongst other things, in server 2012 and windows 8.1.  We're using WSUS on server 2008 R2, so when I go to add roles or features, I'm not able to as it tries to use Windows Update but it's set to use WS

  • Drag and Drop disappear issue

    Hello, I'm making a game in which I have some drag and drop items that they can be multiplied as many as you want. This items have to stay in the scene and I also have a bin in the menu where If you drag them they have to disappear.The problem is tha

  • Aging calculation in report

    Hi Friends, I have a field 'CREATION_DATE' in the data provider. I have to populate the 'Aging' field as follows... AGING = Days between Current Date and Creation date. can anyone please help me on this. Thanks in Advance. Regards, Ravish

  • Find out USA Model number of Satellite A80-127

    Hello, I have a Toshiba SA80 127 . Is there any way i can find out the model number of the US version of this Laptop ? since i probably need some repairs/replacements on parts (cooling fan/ LCD). Any suggestions will be helpful. Thanks karthik