Esempio n. 1
0
 public void ShowAlert(string message)
 {
     RunOnUiThread(() =>
     {
         var fragment = AlertDialogFragment.NewInstance(message);
         fragment.Show(FragmentManager, nameof(AlertDialogFragment));
     });
 }
Esempio n. 2
0
        /// <summary>
        /// 引数をバンドルしてインスタンスを生成する.
        /// </summary>
        /// <param name="message">エラーメッセージ</param>
        /// <returns>フラグメント</returns>
        public static AlertDialogFragment NewInstance(string message)
        {
            // 引数をセットする
            var bundle = new Bundle();

            bundle.PutString(KEY_MESSAGE, message);
            var fragment = new AlertDialogFragment();

            fragment.Arguments = bundle;
            return(fragment);
        }
Esempio n. 3
0
 public void NavigateTo(string viewName)
 {
     RunOnUiThread(() =>
     {
         if (stringToPage.ContainsKey(viewName))
         {
             var next = Activator.CreateInstance(stringToPage[viewName]) as Fragment;
             FragmentManager.BeginTransaction().Replace(Resource.Id.frameLayoutContent, next).Commit();
         }
         else
         {
             var fragment = AlertDialogFragment.NewInstance($"{viewName}の画面がありません。");
             fragment.Show(FragmentManager, nameof(AlertDialogFragment));
         }
     });
 }