I am working on Windows 8 Phone application,I have 2 things here one is Library project and other is normal app,Let me first explain my code:
In Library project<
Now I understand, you want to call overriden values from your project in your library.
You cannot do that with classical C# mechanisms, for that you need dependency injection. Something along these lines:
// library
public interface IA
{
List<string> ListOfEmployees();
}
public class ABase : IA
{
public virtual List<string> ListOfEmployees() {}
}
public static class Repository
{
private static IA _a;
public static IA A
{
get { return _a = _a ?? new ABase(); }
set { _a = value; }
}
}
// in your app
class Properties : ABase
{
public override List<string> ListOfEmployees() { /* ... */ }
}
Repository.A = new Properties();
Change the override keyword to new and you'll get the behaviour you're after. Check out this link for more information on when to use which.