I\'m binding an UI to an interface (which is implemented by several presenters, not accessible from the UI assembly).
I really like d:DesignInstance in designer beca
@Olivier: This is one of the best scenarios where you can make use of "Adapter Design Pattern"
Note: I have no idea on Resharper, I am a C# & .NET developer. but I understand there is compatibility problem based on your explanation. below is the possible solution that you can try.
sample code:
class Program
{
static void Main(string[] args)
{
// create an object of your adapter class and consume the features.
AdapterInterfaceUI obj = new AdapterInterfaceUI();
// Even though you have written an adapter it still performs the operation in base class
// which has the interface implementation and returns the value.
// NOTE : you are consuming the interface but the object type is under your control as you are the owner of the adapter class that you have written.
Console.WriteLine(obj.DisplayUI());
Console.ReadKey();
}
}
#region code that might be implemented in the component used.
public interface IinterfaceUI
{
string DisplayUI();
}
public class ActualUI : IinterfaceUI
{
//Factory pattern that would be implemented in the component that you are consuming.
public static IinterfaceUI GetInterfaceObject()
{
return new ActualUI();
}
public string DisplayUI()
{
return "Interface implemented in ActualUI";
}
}
#endregion
#region The adapter class that you may need to implement in resharper or c# which ever works for you.
public class AdapterInterfaceUI : ActualUI, IinterfaceUI
{
public string DisplayUI()
{
return base.DisplayUI();
}
}
#endregion
I think this solution will help you out.