Question

I am new to MVVM, I am trying to use CINCH v2 MVVM framework by Sacha Barber and I have doubts of how to extend one of the framework services in the correct way, I hope I can get some advice from your experiences.

I am writing a WPF app, using MVVM. I decided to try CINCH v2 as my framework. In my view I need to open a file dialog box and allow the selection of multiple files. CINCH has some nice UI services, among them the OpenFileService that implements the IOpenFileService interface. My problem is that this service only opens one file at a time, and I need to allow multiple to open multiple files. It is as simple as using the Multiselect property from the Microsoft.Win32.Openfiledialog class.

So I added a new interface in my project that implements the IOpenFileService from Cinch and extend it, hoping that I will be able to use the testing services provided by the framework

public interface IOpenFileServiceExtension : IOpenFileService 
{
   bool? Multiselect { get; set; }
   String DefaultExt { get; set; }
}

Then I created a service in my project that implements this new interface and add the extended functionality.

This solution works, but I have some doubts as how proper it is:

1.- In my interface project I need to make a reference to the Cinch library. I am not sure if that is a problem, but I felt strange

2.- Is this the right way of solving this problem or is there another way?

Thanks for your advice.

No correct solution

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top