none
mvvm class best practices RRS feed

  • General discussion

  • image 1

    i have this CollectNamesPage (image1) and i want to create CollectNamesPageMV class, my qustions is:

    q1: the rule: every page/window should have one page/windowMV class right?

    q2: can MV class contains nested classes?

    ______________________________________________________

    and i have created a CollectNamesPageMV class here;

     public class CollectNamesVM : ViewModelBase
        {
            #region Properties
    
            #endregion
    
            #region Constructor
    
            public CollectNamesVM()
            {
    
            }
    
    
            #endregion
    
            #region Classes
    
            class Open : ViewModelBase
            {
    
                
            }
    
            class Options : ViewModelBase
            {
                
            }
    
            class Preview : ViewModelBase
            {
    
                
            }
    
            #endregion
    
        }

    is that a good idea?

    any suggesions will be appreciated






    • Changed type essamce Monday, December 23, 2019 12:05 PM
    • Edited by essamce Monday, December 23, 2019 1:12 PM
    Monday, December 23, 2019 6:27 AM

All replies

  • You seem to have a misunderstand of how the MVVM UI design pattern works.

    https://www.codeproject.com/Articles/228214/Understanding-Basics-of-UI-Design-Pattern-MVC-MVP

    The rule: every page/window should have onepage/windowMV class right?

    Every view has a view model

    can MV class contains child classes?

    Concerning the view, no.

    https://www.tutorialspoint.com/mvvm/mvvm_introduction.htm

    You should post to the WPF forum that mainly uses the MVVM UI design pattern, although MVVM can be used with Windows form and ASP.NET Web form too.

    https://social.msdn.microsoft.com/Forums/vstudio/en-US/home?forum=wpf

    Monday, December 23, 2019 8:44 AM
  • hi

    sorry i missed typing q1

    q1: can MV class contains nested classes? 


    • Edited by essamce Monday, December 23, 2019 1:11 PM
    Monday, December 23, 2019 1:09 PM
  • hi

    sorry i missed typing q1

    q1: can MV class contains nested classes? 


    No
    Monday, December 23, 2019 1:12 PM