Generic Interface with property

Posted by pranay on Stack Overflow See other posts from Stack Overflow or by pranay
Published on 2010-04-28T17:48:35Z Indexed on 2010/04/28 17:57 UTC
Read the original article Hit count: 228

Filed under:

i have one interface

/// <summary>
/// Summary description for IBindable
/// </summary>
public interface IBindable<T>
{
    // Property declaration:
    T Text
    {
        get;
        set;
    }
}

Now i want to implement this interface in my class

    public class MyTextBox :IBindable<string>
    {
  //now i how can i implement Text peroperty here 
}

I don't want to implement it like

string IBindable<string>.Text
{  get { return "abc";} set { //assigne value } }

i want to implement it like

   public string Text
   {get{} set {}}

© Stack Overflow or respective owner

Related posts about c#