Step 6. Displaying a Users Window

When you create a new MM .NET WPF application, a UsersWindow is automatically added to the project for you. This is an application-level window derived from mmBusinessWindow that you can modify to your hearts content! To get its basic functionality working, follow these steps:

  1. Open the UsersWindow.xaml.cs/vb in Visual Studio and add a reference to your business object project's namespace

  2. Next, uncomment the following lines of code:

    In C#:

    //protected User User;
    //protected Role Role;

    //this.User = (User)this.RegisterPrimaryBizObj(new User());
    //this.Role = (Role)this.RegisterBizObj(new Role());
    //this.User.RegisterChildBizObj(this.Role);

    And in VB .NET:

    'Protected User As User
    'Protected Role As Role

    'Me.User = CType(Me.RegisterPrimaryBizObj(New User()), User)
    'Me.Role = CType(Me.RegisterBizObj(New Role()), Role)
    'Me.User.RegisterChildBizObj(Me.Role)

  3. Next, uncomment the code in the following methods:

    • Window_Loaded
    • mvrRoles_RefreshLists
    • mvrRoles_AddItem
    • mvrRoles_DeleteItem
    • mvrRoles_Delete

  4. Open your WPF project in Expression Blend

  5. In the Project panel, double-click UserWindow.xaml to open it in the design surface.

  6. In the Objects and Timeline panel, select the Window element:

  7. Go to the Properties panel, and under the Common Properties section, click the DataContext property's New button:

  8. This launches the Select Object dialog. Expand the node containing the namespace of your business objects, select the UserEntity class and click OK:

  9. Save changes to the window

© (c) 2026 Oak Leaf Enterprises, Inc., 1996-2026 • Updated: 06/28/12
Comment or report problem with topic