1

I am developing an application in WPF using the PRISM framework in the modularity concept. So I have different modules each module have one DataGrid view. I need to have one common module that is a common view. That common view contains one Data Grid View. And that should be referred in all modules if need.

Sample Description Picture: screenshot 1

If anyone implemented this concept, please help me to let me know.

[Edit] Here common view is a WPF UserControl. I Have 5 master tables like 1.GroupMaster 2.Categories 3.Location 4.Product 5.Customer.

Each table have a common column field "Name".

So instead of creating DataGrid View control for each form(WPF UserControl), I want to create a WPF UserControl. And view it in another UserControl like GroupMaster or Categories.

When I double click that "Name", that corresponding Model class should be called to edit.

Actually I using Prism Framework with RegionManager to control the WPF UserControl to show it in a MainRegion. But I want to know about the BaseClass Creation and How to pass the Model Class?

Sample Form View

Thank you

Arulraj J
  • 11
  • 3
  • 1
    Perhaps a UserControl? – Clemens Nov 18 '19 at 08:40
  • How common is "common? Do your want to display the exact same thing simultaneously in two places (if you change a column width in one place, the other place changes too), or is this about starting both view areas with the same layout but let the user change them individually? – grek40 Nov 18 '19 at 09:01
  • you need to inject your views into a shell view, PRISM framwork will help you, take a look at how you can configure a container and inject view in a Prsim region manager – Erwin Draconis Nov 18 '19 at 09:05
  • What prevents you from creating an assembly referenced by both modules with the shared control in it? Having "modules" does not mean you may not have "regular" assemblies, in fact, most of the interfaces implemented in your modules will be defined in assemblies that do not contain modules themselves. – Haukinger Nov 18 '19 at 10:49
  • From the question: *"When I double click that "Name", that corresponding Model class should be called to edit."* - honestly, I don't understand what you expect to happen there. I don't think the Visual Studio XAML designer opens the "Model" when I click on things. Maybe you use the terms different than what I would understand. – grek40 Nov 20 '19 at 06:04

1 Answers1

0

You should create a Core project that all of your modules see that

enter image description here

after that in this project you create your custom DataGrid.

and use CustomDataGrid in your modules

<usercontrols:CustomDataGrid></usercontrols:CustomDataGrid>

I think you don't need any Region in UserControl.

Mahdi Asgari
  • 272
  • 1
  • 13
  • I will try this Mr.Mahdi. But I have two common Database Column Field like "ID and NAME". I want to show that in that grid. So based on the Module 1 and 2, the CustomDataGrid will show the data in it. How to pass the Database Column field based on Module 1 and Module 2.? I hope you understand me. – Arulraj J Dec 20 '19 at 10:30
  • excuse me I don't understand what's your problem, you want to create some "DataGrids" with the same Id and Name values in Columns? – Mahdi Asgari Dec 21 '19 at 14:58