MVVM Structure for app

Good day,
I'm starting with MVVM patter for my app. I would like to learn this by re-creating my old app (vb.net winforms). I know that I need model, viewmodel and view and I understand what for. I'm trying to create a mvvm structure for my app and I'm lost a little
bit. My app has few levels - User - Admin - FPOC (first point of contact). User is able to save records to the database and retrieve it, Admin is able to review all the records and FPOC is able to review and change all of them. What I would like to understand
here is - should I create for e.g. Class Library for each profile and create model and viemodel there and call it from main view or should I create a folders and prepare classes for each profile in one project? All profiles are using SQL database connection
to obtain datab from the tables.
There are many examples but, most of them are based only on Person/Customer and I have no idea how could I create structure for my application.
Thank you for suggestions

MVVM is a UI desing pattern and it should not affect the structure of your domain or business objects in any way. All domain/business logic belongs to the model.
The logic of saving and retrieving data should be encapsulated in a data access library (class library) and should not have any dependencies whatsoever upon any view model or view.
If you want to learn how to restructure an application that was written in "traditional" way with event-handlers in the code-behind to an MVVM application there is a video available here:
http://blog.lab49.com/archives/2650.
>>What I would like to understand here is - should I create for e.g. Class Library for each profile and create model and viemodel there and call it from main view or should I create a folders and prepare classes for each profile in one project?
The model and view model classes generally don't belong in the same class library. A model class shouldn't know anything about a view model. You could define your model classes in a separate class library and then add a reference to this class library from
the project in which you define the view model classes. Keep your data access logic in the model project, or better yet in a DAL (data access library) that may be referenced from the model library.
Hope that helps.
Please remember to close your threads by marking helpful posts as answer and then start a new thread if you have a new question.

Similar Messages

  • Mail.app:  non-parallel structure for incoming versus outgoing servers

    Manual setup of POP accounts has a non-parallel structure for incoming versus outgoing servers.
    To review:  for each account you must enter setup data for a single POP  (incoming) server, but you are offered multiple choices for SMTP (outgoing)  servers, and Mail.app supports sharing a single SMTP server setup among multiple accounts.
    Why?
    Why not just offer distinct setups for each account in each direction?   There must be a good reason for all this extra structure…. yes?
    More specifically:  What are implications for multiple accounts, e.g.
          [email protected]
          [email protected]
    using the same outgoing server?   It seems to me that Mail.app encourages you use a single SMTP server setup for both, am I correct?    But this seems to undermine proper security. I think  each account should uses its own credentials for both incoming and outgoing, yes?  
    In Mail.app V8.2, shipped with MacOS 10.10.2, Mail.app offers an opportunity to set up a second distinct SMTP server (in the above example, for [email protected]) but the text boxes for username and password refuse to accept text.  Is this just my experience, a local problem?  Or is it observed by others?  If so… a new way of enforcing sharing of SMTP setups, or  a bug?
    I'm very curious about the long-term Mail.app design philosophy in this regard, but this is not just curiosity:  I'm having trouble with multiple email accounts after upgrading to 10.10.2  In each case, when I try to set up multiple accounts on a single mail server.
    I've done quite a bit of searching for explanations of mail.app's design, without success.  It is very possible I've missed some relevant explanations.  If so, please provide links and accept my apologies.
    TIA

    Manual setup of POP accounts has a non-parallel structure for incoming versus outgoing servers.
    To review:  for each account you must enter setup data for a single POP  (incoming) server, but you are offered multiple choices for SMTP (outgoing)  servers, and Mail.app supports sharing a single SMTP server setup among multiple accounts.
    Why?
    Why not just offer distinct setups for each account in each direction?   There must be a good reason for all this extra structure…. yes?
    More specifically:  What are implications for multiple accounts, e.g.
          [email protected]
          [email protected]
    using the same outgoing server?   It seems to me that Mail.app encourages you use a single SMTP server setup for both, am I correct?    But this seems to undermine proper security. I think  each account should uses its own credentials for both incoming and outgoing, yes?  
    In Mail.app V8.2, shipped with MacOS 10.10.2, Mail.app offers an opportunity to set up a second distinct SMTP server (in the above example, for [email protected]) but the text boxes for username and password refuse to accept text.  Is this just my experience, a local problem?  Or is it observed by others?  If so… a new way of enforcing sharing of SMTP setups, or  a bug?
    I'm very curious about the long-term Mail.app design philosophy in this regard, but this is not just curiosity:  I'm having trouble with multiple email accounts after upgrading to 10.10.2  In each case, when I try to set up multiple accounts on a single mail server.
    I've done quite a bit of searching for explanations of mail.app's design, without success.  It is very possible I've missed some relevant explanations.  If so, please provide links and accept my apologies.
    TIA

  • What should be directory structure for Custom MDS files?

    Hi,
    I have personalize a page and then exported the personalization.
    Now my requirment is to migrate this personalization to other server, for which clients want steps specific to UNIX.
    My doubt is where should I copy these files on the server to import the personalization using XMLImporter command? ( Client do not have JDev on his server, so can not use impot command)
    my custom_top structure is like '/u02/int/applmgr/CUSTOM/xbol/11.5.0'
    The customization is part of product 'OTA'
    I am confused about where to put(Directory structure on custom top) customization and other MDS file to import using XMLImport.
    This customization is also using a Custom LOV for which, I have given the path xbol/oracle/apps/ota/admin/enrollment/webui/XbolGradeRN.
    For now I have transfered the file from window based JDeveloper and things are working fine. I need the UNIX directory structure for MDS files.
    Please help to clear my this doubt.
    Regards,
    Adarsh

    There is nothing specific to UNIX since the files are never picked from the file system on a production instance. You can place them under a temp directory with the proper package structure, the same way you exported personalizations for the seeded pages and the same custom package structure for your new pages and run import command. It's only how you run your import command matters, if you have placed the files in the proper package under some temp directory just give the -rootdir to point to your temp directory and no -rootPackage option.

  • Directory Structure for Discoverer

    Hi,
    I have couple of queries...
    1. What is the directory structure for discoverer on Unix in Application Server?
    2. Is there any extention for the woekbook saved in the database like .dis?
    I am working on discoverer 10g with Oracle Apps.
    Thanks...

    1. On a Solaris machine where I have Discoverer 10g (9.0.4.3) installed the directory structure for the Oracle home looks like this:
    $ cd h9043
    $ pwd
    $ /home2/h9043
    $ ls
    Apache install.platform opmn srvm
    BC4J inventory oracore sso
    JRE j2ee ord syndication
    OPatch javacache otrace sysman
    assistants javavm oui tk
    bibeans jdbc owm tools
    bin jdk perl uat
    browser jinit plsql uddi
    cfgtoollogs jis portal uix
    chgip jlib precomp ultrasearch
    config jpi procbuilder90 upgrade
    dbs jre rdbms ut
    dcm jsp relnotes vbroker4
    diagnostics lbs reports wcs
    discoverer ldap root.sh webcache
    error.txt lib root.sh.old webservices
    forms90 mesg slax wireless
    guicommon9 mp soap xdk
    iaspt network sqlj zrc
    install ocommon sqlplus
    2. The ability to save workbooks to a file system is available only on Discoverer Dekstop, which runs on Windows.
    Thanks
    Abhinav
    Oracle Business Intelligence Product Management
    BI on Oracle: http://www.oracle.com/bi/
    BI on OTN: http://www.oracle.com/technology/products/bi/
    Documentation: http://docs.oracle.com/
    Discoverer: http://www.oracle.com/technology/products/discoverer/
    BI Software: http://www.oracle.com/technology/software/products/ias/devuse.html
    BI Samples: http://www.oracle.com/technology/products/bi/samples/
    Blog: http://oraclebi.blogspot.com/

  • Is there a suggested directory structure for iTunes?

    Is there a suggested directory structure for iTunes? I have moved my library around several times (what with new machines, etc.) and I find that I have two app libraries in different locations and I think it is the problem behind a refusal to sync issue I'm having with my iPad.
    Any help would be gladly appreciated!
    Luke
    (Screen grabs a great help)

    I'll see your Tb and raise you some - the truth is, almost every major revision and data migration from MBP to MBP and now back to a MP has caused replication of folders in the strangest of places, none of which I have consciously created - I mean, why would anyone except out of self-focused spite want to create three different sets of apps folders - to say nothing of the interminable Compilations folders that sprout from no where in particular!
    I could understand the issue if I was careless or a complete neophyte,  I only moved to the Apple platform about 6 years ago, (even though I've been using the platform since 1987) when I went to work for the company.
    iTunes I think is a little like a cat - it recognises my lingering, subyle antipathy and rolls all over me just to mess with my head!
    Thanks for the information, none-the-less, greatly appreciated.

  • Can anyone recommend a good UPK library structure for Oracle financials 11.5.10.2 (using UPK 11.1)?

    Hi, Can anyone recommend a good UPK library structure for Oracle financials 11.5.10.2 (using UPK 11.1) please?

    If you are using the application server that comes with Oracle Applications - you probably need to use the JDeveloper version that comes with that one too. (The OAF forum will have more info on this).
    If you are using JDeveloper 10.1.3 then you can use a stand alone OC4J 10.1.3 to deploy your applications - and save yourself the hassle of messing up with your apps server.

  • Use one account for apps and other for itunes match

    Hello everybody
    My question today is quite simple. I use one account for apps and tv shows, but inwant to use a different itunes account for purchasing itunes match. How can I use them both on my devices? Will it be asking for my user-pass each time i play a song? What other thing should i consider?
    Thank you in advance

    I would strongly recommend you not do this.  You will regret it.
    I have played with this issue a lot.  You have to remain signed into match in order for it to show up on your phone. If you sign out to purchase an app or redownload one from your appstore id you use then match will be removed from your phone and when you go into your music app the icloud will not be there.  You then have to go sign back out of the store id you used for your app purchase and then sign back into match and everything will have to go though the download to your device process again.  This really is not what you want to do.
    Sign up to match with the apple id that you know you will use the most or has the most purchased items and use that for all purchases, i.e. books, apps, movies, and music.  You don't want to go though the other process.
    Plus apple will start not letting you sign into match because you signed out and back in, in to short a period of time.
    all store purchases on an iphone are linked to the store id.  if you sign out of your match id on the appstore and sign into another account to purchase an app then itunes match will sign out in the music app.  You can't have two store id's signed into your iphone at the same time.  They are all linked together.

  • Changing ITunes Account for Apps

    How do I change my Itunes account for apps? When I go to update my apps, it still has my old account (my password does not work) and I have since created a new account (divorce issues). I have made a new password request for my old account and I do not get an email from Apple to do so. Everything else on my iphone is under my new account (Itunes, store, etc).
    VERY FRUSTRATING!

    How do I change my Itunes account for apps?
    You can't. Apps are DRM protected & tied to the account used to originally purchase them. Contact iTunes support & request they add the apps in question to your download queue for your new account. Explain the situation & most likely, they will do so:
    http://www.apple.com/support/itunes/

  • Itunes have taken money from my account for apps i havnt purchased and no nothing about

    just been on my bank online and noticed that within 2 days £310 has come out of my bank for apps i have never used and didnt even no i had, i have a 9yr old daughter who uses my ipad but she doesnt know my password how the **** has this happened and will itunes refund me?? anyone please help??????????????

    Either someone in your household has been buying content or someone has hacked your account.
    You need to change your password immediately.
    You need to talk to your cardholder about reimbursement.
    You can let Apple know about the problem:  http://www.apple.com/support/itunes

  • ITunes Account for Apps

    Hi
    Im trying to sign for a publisher account to download the iTues producer when I enter my info and cause Im a registered
    app developer it gives me a message that this account is already asociated with app developing account so do i need 2
    separate accounts one for apps and one for ibook publishing ?

    Different accounts use different "usernames" which is in fact an email address.  And yes each account can purchases apps, music, books etc,.   BUT.... Apple require that  a different account is required for:-
    Free Books.
    Paid Books
    Developer account.
    Although its at first it was OK to use a "standard" iTunes Account to open a free iBook account - its no longer allowed, so maybe the  iTunes account also now needs to be a separate account from others.

  • Build XML for Custom Nested Accordian (like Tree View Structure) for SharePoint List Data

    Expected output in Xml:
    <?xml version="1.0" encoding="utf-8" ?>
    - <TopRoot>
    - <Root id="1" Name="Department">
    - <Type id="2" Name="IT">
    - <SubType id="3" Name="Technology">
      <SubSubType id="4" Name="Sharepoint" />
      <SubSubType id="5" Name="ASP.NET" />
      <SubSubType id="6" Name="HTML 5" />
      </SubType>
      </Type>
    </Root>
    </TopRoot>
    List Details:
    list details for storing category / sub category data and code to build tree structure for the same.
    1.Create Custom List named “CategoryDetails”:
    2.Create Column “Category Name” of type single line of text. Make it as required field and check Yes for Enforce Unique values.
    3.Create column “Parent Category” of type lookup. under Additional Column Settings.
    Get information dropdown, select “CategoryDetails”.
    4.Choice column ["SRTypeName"] 1.Root,2.SRTYPE,3.SubSRTYPE, 4.SUBSUBSRTYPE
    In this column dropdown, select “Category Name”:  
    Referance:
    http://www.codeproject.com/Tips/627580/Build-Tree-View-Structure-for-SharePoint-List-Data    -fine but don't want tree view just generate xml string
    i just follwed above link it work perferfectly fine for building tree view but i don't want server control.
    Expected Result:
    My ultimate goal is to generate xml string like above format without building tree view.
    I want to generate xml using web service and using xml i could convert into nested Tree View Accordian in html.
    I developed some code but its not working to generate xml /string.
    My modified Code:
    public const string DYNAMIC_CAML_QUERY =
            "<Where><IsNull><FieldRef Name='{0}' /></IsNull></Where>";
            public const string DYNAMIC_CAML_QUERY_GET_CHILD_NODE =
            "<Where><Eq><FieldRef Name='{0}' /><Value Type='LookupMulti'>{1}</Value></Eq></Where>";
            protected void Page_Load(object sender, EventArgs e)
                if (!Page.IsPostBack)
                 string TreeViewStr= BuildTree();
                 Literal1.Text = TreeViewStr;
            StringBuilder sbRoot= new StringBuilder();
            protected string BuildTree()
                SPList TasksList;
                SPQuery objSPQuery;
                StringBuilder Query = new StringBuilder();
                SPListItemCollection objItems;
                string DisplayColumn = string.Empty;
                string Title = string.Empty;
                string[] valueArray = null;
                try
                    using (SPSite site = new SPSite(SPContext.Current.Web.Url))
                        using (SPWeb web = site.OpenWeb())
                            TasksList = SPContext.Current.Web.Lists["Service"];
                            if (TasksList != null)
                                objSPQuery = new SPQuery();
                                Query.Append(String.Format(DYNAMIC_CAML_QUERY, "Parent_x0020_Service_x0020_Id"));
                                objSPQuery.Query = Query.ToString();
                                objItems = TasksList.GetItems(objSPQuery);
                                if (objItems != null && objItems.Count > 0)
                                    foreach (SPListItem objItem in objItems)
                                        DisplayColumn = Convert.ToString(objItem["Title"]);
                                        Title = Convert.ToString(objItem["Title"]);
                                        int rootId=objItem["ID"].ToString();
                                        sbRoot.Append("<Root id="+rootId+"
    Name="+Title+">");
                                        string SRAndSUBSRTpe = CreateTree(Title, valueArray,
    null, DisplayColumn, objItem["ID"].ToString());
                                        sbRoot.Append(SRAndSUBSRTpe);
                                        SRType.Clear();//make SRType Empty
                                        strhtml.Clear();
                                    SRType.Append("</Root>");
                catch (Exception ex)
                    throw ex;
                return SRType.ToString();
             StringBuilder strhtml = new StringBuilder();
            private string CreateTree(string RootNode, string[] valueArray,
          List<SPListItem> objNodeCollection, string DisplayValue, string KeyValue)
                try
                    strhtml.Appends(GetSRType(KeyValue, valueArray, objNodeCollection);
                catch (Exception ex)
                    throw ex;
                return strhtml;
            StringBuilder SRType = new StringBuilder();
            private string GetSRType(string RootNode,
            string[] valueArray, List<SPListItem> objListItemColn)
                SPQuery objSPQuery;
                SPListItemCollection objItems = null;
                List<SPListItem> objNodeListItems = new List<SPListItem>();
                objSPQuery = new SPQuery();
                string objNodeTitle = string.Empty;
                string objLookupColumn = string.Empty;
                StringBuilder Query = new StringBuilder();
                SPList objTaskList;
                SPField spField;
                string objKeyColumn;
                string SrTypeCategory;
                try
                    objTaskList = SPContext.Current.Web.Lists["Service"];
                    objLookupColumn = "Parent_x0020_Service_x0020_Id";//objTreeViewControlField.ParentLookup;
                    Query.Append(String.Format
                    (DYNAMIC_CAML_QUERY_GET_CHILD_NODE, objLookupColumn, RootNode));
                    objSPQuery.Query = Query.ToString();
                    objItems = objTaskList.GetItems(objSPQuery);
                    foreach (SPListItem objItem in objItems)
                        objNodeListItems.Add(objItem);
                    if (objNodeListItems != null && objNodeListItems.Count > 0)
                        foreach (SPListItem objItem in objNodeListItems)
                            RootNode = Convert.ToString(objItem["Title"]);
                            objKeyColumn = Convert.ToString(objItem["ID"]);
                            objNodeTitle = Convert.ToString(objItem["Title"]);
                            SrTypeCategory= Convert.ToString(objItem["SRTypeName"]);
                           if(SrTypeCategory =="SRtYpe")
                              SRType.Append("<Type  id="+objKeyColumn+" Name="+RootNode+ ">");
                             if (!String.IsNullOrEmpty(objNodeTitle))
                              SRType.Append(GetSRType(objKeyColumn, valueArray, objListItemColn));
                          if(SrTypeCategory =="SRSubTYpe")
                              SRType.Append("<SRSubType  id="+objKeyColumn+" Name="+RootNode+
    ">");  
                             if (!String.IsNullOrEmpty(objNodeTitle))
                              SRType.Append(GetSRType(objKeyColumn, valueArray, objListItemColn));
                          if(SrTypeCategory =="SubSubTYpe")
                              SRType.Append("<SubSubType  id="+objKeyColumn+" Name="+RootNode +"
    ></SubSubType");  
                        SRType.Append("</SubType>");
                        SRType.Append("</Type>");
                catch (Exception ex)
                    throw ex;
                return SRType.ToString();
                // Call method again (recursion) to get the child items

    Hi,
    According to your post, my understanding is that you want to custom action for context menu in "Site Content and Structure" in SharePoint 2010.
    In "SiteManager.aspx", SharePoint use MenuItemTemplate class which represent a control that creates an item in a drop-down menu.
    For example, to create or delete the ECB menu for a list item in
    "Site Content and Structure", we can follow the steps below:
    To add the “My Like” menu, we can add the code below:      
    <SharePoint:MenuItemTemplate
    UseShortId=false
    id="OLListItemLike"
    runat="server"
    Text="My Like"
    ImageUrl="/_layouts/images/DelItem.gif"
    ClientOnClickNavigateUrl="https://www.google.com.hk/"
    />
    To remove the “Delete” menu, we can comment the code below:
    <SharePoint:MenuItemTemplate
    UseShortId=false
    id="OLListItemDelete"
    runat="server"
    Text="<%$Resources:cms,SmtDelete%>"
    ImageUrl="/_layouts/images/DelItem.gif"
    ClientOnClickScript="%SmtObjectDeleteScript%"
    />            
    The result is as below:
    More information:
    MenuItemTemplate Class (Microsoft.SharePoint.WebControls)
    MenuItemTemplate.ClientOnClickScript property (Microsoft.SharePoint.WebControls)
    Best Regards,
    Linda Li
    Linda Li
    TechNet Community Support

  • How can I change the default apple ID for app store. I bought the macbook from my school when I left and I'm the ID in place of mine is the computer departments one. How can i change it to mine?? Thanks

    How can I change the default apple ID for app store. I bought the macbook from my school when I left and I'm the ID in place of mine is the computer departments one. How can i change it to mine?? Thanks

    http://support.apple.com/kb/ht5621

  • I changed my AppleID a long time ago to an email that I no longer use and I have updates for apps that I can't update because my old email is filled in to where i sign in and it wont let me change it to my new one???

    I changed my AppleID a long time ago to an email that I no longer use and I have updates for apps that I can't update because my old email is filled in to where i sign in and it wont let me change it to my new one???

    The problem with those two apps is that they are supposed to be in your Apple ID and you didn't set up the Mac properly/completely when you got it.
    You might try deleteing them and using OS X Recovery to install them again.
    OS X Recovery -
    http://support.apple.com/kb/HT4718
    After that, before you open any iLife apps go to your Mac App Store account, to the Purchased pane and Accept them into your account.

  • TS1702 I have an Iphone 5  6.01.  I have a notice on my app store that I have an update. Tried to update, but it won't.  Connected to Itunes and tried to download update for App.  I can't do that either.  It won't let me update any of the apps.  What is w

    I have an Iphone 5  6.01.  I have a notice on my app store that I have an update. Tried to update, but it won't.  Connected to Itunes and tried to download update for App.  I can't do that either.  It won't let me update any of the apps.  What is wrong?

    My husband and I are using the same iTunes account on all mac & pc computers, but the libraries are different on each machine.  We always manually manage our music (no auto sync).  iTunes is up to date on the PCs.  My husband uses our joint iTunes account on his pc, but once again, has a different collection in his library from those on the other machines.  He can't load any music from his PC to his iphone 4.  I can load music from my mac library to my iphone 4s, but cannot load from my pc library to my iphone 4s.  How can I switch my main library that it syncs with from the mac to the pc?
    Thanks

  • TS2446 I just got my iPad,  I have an iPod. When I go to put apps on it says my apple I'd Is disabled. I have reset the passwords. Somehow I have two id's?  I've gone into settings for apps signed out and back in with the new p.w.  I can't think of what e

    I just got my iPad,  I have an iPod. When I go to put apps on my new ipad it says my apple ID Is disabled. I have reset the passwords. Somehow I have two id's?  I've gone into settings for apps signed out and back in with the new p.w.  I can't think of what else to do to get the disabled block off.  Any ideas?? Thanks

    See this Apple document for help...
    http://support.apple.com/kb/ts2446

Maybe you are looking for

  • Re: problem in sap standard

    Hello,       What is the note number.

  • SRRELROLES TABLE COMPARISION BETWEEN SRM AND ECC

    Hi all i would like to compare both tables SRRELROLES  in ecc and srm for any one of SRM Business objects and linked ECC Business Objects for ALL the records not one records. how .any clue is appreciated. i followed peter methid but not works for me

  • Footer goes away?!?!

    Hi all, When I export as a pdf, my footer does not show up or print. However, if I print and choose pdf, or print directly to a printer, the footer prints. Am I doing anything wrong? Thanks, Joe

  • ERROR WHEN SENDING EMAIL (REPORTS)

    Hi all, Sorry to write about Reports here, but the Reports Forum is slow today, nobody answers the questions... if anyone here could help me i would thank a lot. I am trying to send the report by email, i already modified the file rwbuider.config, bu

  • User exit in CO

    Dear Experts: I need your help. In our company, we use F-02 "Post with reference" to post the FI document. And, the post value will also show in KE24(CO reporting). For some reasons, I need to modify the value field in COPADATA by multiply -1. I try