I meet one problem that i can\'t solve now. I have the following:
UnityHelper.DefaultContainer.RegisterInstance(typeof(IMyInterface), \"test\", instance);
>
I had a similar requirement whereby I wanted to temporarily store objects in the unity container and found this was not possible (or at least easily possible). If your objective is to have a temporary storage place easily available to unity, then create a temporary storage service.
public class TemporaryStorageService : ITemporaryStorageService
{
public void Deposit(Object o, string key)
{
System.Windows.Application.Current.Properties[key] = o;
}
public T Withdraw(string key)
{ T o = (T)System.Windows.Application.Current.Properties[key];
System.Windows.Application.Current.Properties.Remove(key);
return o;
}
}
Register your service with Unity. Then when you wish to store an object you call the Deposit Method and when you wish to remove the object you call the Withdraw method. A fuller explanation can be found here