I want to have a background task which gets called which gets triggered when I change from one network to another .Suppose i am connected to a mobile broadband and then switch to wifi , then it should get triggered .When it switches from wifi to mobile broadband
, it should trigger
I have wirtten code as :
var builder = new BackgroundTaskBuilder();
builder.Name = name;
builder.TaskEntryPoint = taskEntryPoint;
builder.SetTrigger(new SystemTrigger(SystemTriggerType.NetworkStateChange, false));
if (condition != null)
{
builder.AddCondition( new SystemCondition(SystemConditionType.InternetNotAvailable));
}
BackgroundTaskRegistration task = builder.Register();
But it works fine when i switch within interface but not from one interface to another