async public System.Threading.Tasks.Task BtnMapFragmentClickAsync() { MapFragment = new GoogleMapFragment(Resource.Layout.FrgMap, _mainActivity , _stateClass._person,this); await System.Threading.Tasks.Task.Delay(0); _mainActivity.FragmentManager .BeginTransaction() .SetCustomAnimations (Android.Resource.Animator.FadeIn,Android.Resource.Animator.FadeOut) .Replace(Resource.Id.frameContent, MapFragment) .AddToBackStack (null) .Commit(); // Configure the buttons if (MainActivity.User.NetworkStatus == DataAccessLayer.NetworkState.Disconnected) ConfigureButtons(false, false, false, false, false); else ConfigureButtons(false, false, false, false, permission.UpDownload); }
public void Restore(MainActivity mainActivity) { // First assign the new mainActivity _mainActivity = mainActivity; MapFragment = new GoogleMapFragment(Resource.Layout.FrgMap, _mainActivity , _stateClass._person,this); _mainActivity.FragmentManager .BeginTransaction() .SetCustomAnimations (Android.Resource.Animator.FadeIn,Android.Resource.Animator.FadeOut) .Replace(Resource.Id.frameContent, MapFragment) .AddToBackStack (null) .Commit(); // Then we have to get reference to the new controls _btnNew = _mainActivity.FindViewById<ImageButton>(Resource.Id.btnNew); _btnEdit = _mainActivity.FindViewById<ImageButton>(Resource.Id.btnEdit); _btnSave = _mainActivity.FindViewById<ImageButton>(Resource.Id.btnSave); _btnDelete = _mainActivity.FindViewById<ImageButton>(Resource.Id.btnDelete); _btnOffline = _mainActivity.FindViewById<ImageButton>(Resource.Id.btnOffline); // then we have to get a reference to the new controls }