Hi,try this solution:
public void InfoIsVisible(bool visibility)
{
if (visibility == true)
{
proxy.Abort();
loadInfos();
txtConnection.Visibility = Visibility.Visible;
error.Text("Msg state : " + txtConnection.Visibility.ToString());
error.Show();
}
else
{
MainPage m = (MainPage)Application.Current.RootVisual;
m.txtConnection.Visibility = Visibility.Collapsed;
}
}