Step 7. Displaying a Roles Window
When you create a new MM .NET WPF application, a RoleWindow 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:
- Open the RoleWindow.xaml.cs/vb in Visual Studio and add a reference to your business object project's namespace
- Next, uncomment the following lines of code:
In C#:
//protected Role RoleController; //this.RoleController = (Role)this.RegisterPrimaryBizObj(new Role()); //this.DataContext = this.RoleController.GetAllEntities(); //((IEditableCollectionView)CollectionViewSource.GetDefaultView(this.DataContext)).NewItemPlaceholderPosition = // NewItemPlaceholderPosition.None;
And in VB .NET:
'Protected RoleController As Role 'Me.RoleController = CType(Me.RegisterPrimaryBizObj(New Role()), Role) 'Me.DataContext = Me.RoleController.GetAllEntities() 'CType(CollectionViewSource.GetDefaultView(Me.DataContext), _ ' IEditableCollectionView).NewItemPlaceholderPosition = NewItemPlaceholderPosition.None
- Add a menu item to your project that launches the Role window
- Open your WPF project in Expression Blend
- In the Project panel, double-click RoleWindow.xaml to open it in the design surface.
- In the Objects and Timeline panel, select the Window element:

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

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

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