brumScouse
brumScouse

Reputation: 3216

It feasible to use MVP to differentiate the presenter for a control used in 2 contexts

I have a WinForms UserControl which I am using in 2 different applications. A Word Add In and another WinForms application. I would like to be able to differ the implementation of say a check in operation based on which application I am in, as there are unique concerns in both applications.

I am struggling however with what to do with the UI concerns which are specific to each application. For example, I want to check the active documents in the Word Add in, but obviously dont want to do this in the WinForms app. I have resolved the fact that I can inject the presenter but I am aware I should keep UI logic out of there. Do I need another layer or do I need to write 2 different versions of the control, which share alot similarities.

Upvotes: 0

Views: 84

Answers (1)

VahidNaderi
VahidNaderi

Reputation: 2488

You'd better to abstract out common functions in a separate project and create 2 different implementation for that abstraction.

Upvotes: 1

Related Questions