Hi,
I noticed that when I click on a tab, any of the three, the event runs twice.
Why?
Where am I wrong?
Thank you
This is my code behind:
private void SfTabView_SelectionChanged(object sender, Syncfusion.XForms.TabView.SelectionChangedEventArgs e)
{
if (e.Index == 0)
{
LbTitle.Text = "HOME";
BindingContext = new ClientiViewModel();
Device.StartTimer(TimeSpan.FromSeconds(1), () =>
{
var data = BindingContext as ClientiViewModel;
foreach (var clientis in data.PropertyClientis)
{
data.IsActive = false;
}
return false;
});
return;
}
if (e.Index == 1)
{
LbTitle.Text = "PRODUCT";
BindingContext = new ProdottiViewModel();
Device.StartTimer(TimeSpan.FromSeconds(1), () =>
{
var data = BindingContext as ProdottiViewModel;
foreach (var prodottis in data.PropertyProducts)
{
data.IsActive = false;
}
return false;
});
Parametri.ActiveMenuImprese = false;
}
if (e.Index == 2)
{
LbTitle.Text = "NOTIZIE";
BindingContext = new NewsViewModel();
Device.StartTimer(TimeSpan.FromSeconds(1), () =>
{
var data = BindingContext as NewsViewModel;
foreach (var notizies in data.Notizies)
{
data.IsActive = false;
}
return false;
});
Parametri.ActiveMenuImprese = false;
}
}