Example #1
0
        protected void ShowAlertDialogFragment(string aMessage, string aTitle, int aIcon)
        {
            if (SupportFragmentManager.IsDestroyed)
            {
                Log.Error(TAG, "Activity has been already destroyed");
                return;
            }
            AlertDialogFragment frag = AlertDialogFragment.NewInstance(aMessage, aTitle, aIcon);

            SupportFragmentManager.BeginTransaction().Add(frag, NOTIFICATION_FRAGMENT_TAG + frag.GetHashCode()).Commit();
        }
Example #2
0
        private void MainViewModel_PropertyChanged(object sender, System.ComponentModel.PropertyChangedEventArgs e)
        {
            System.Diagnostics.Debug.WriteLine($"MainViewModel_PropertyChanged {e.PropertyName}");

            switch (e.PropertyName)
            {
            case nameof(MainViewModel.CurrentViewModelName):
                var fragment = GetFragmentFromName(MainViewModel.CurrentViewModelName);
                SupportFragmentManager.BeginTransaction().Replace(Resource.Id.frameLayoutContent, fragment).Commit();
                break;

            case nameof(MainViewModel.AlertMessage):
                var dialog = AlertDialogFragment.NewInstance(MainViewModel.AlertMessage);
                dialog.Show(SupportFragmentManager, nameof(AlertDialogFragment));
                break;

            default:
                System.Diagnostics.Debug.WriteLine(" unknown.");
                break;
            }
        }