在片段中显示对话框片段
Show Dialog Fragment in Fragment
如何在MvxFragment中显示MvxDialogFragment。不能使用 FragmentMaganer 和其他解决方案。
没有工作
public void ShowFragmentLatestInvoices()
{
var transaction = FragmentManager.BeginTransaction();
var Manager = FragmentManager.BeginTransaction ();
LatestInvoicesFragment LatestInvoicesFragment = new LatestInvoicesFragment();
LatestInvoicesFragment.DataContext = ViewModel.InvoiceVM;
LatestInvoicesFragment.Show(SupportFragmentManager, "LatestInvoices_fragment");
OnAttachFragment (LatestInvoices);
}
您可以通过 getActivity()
从片段中到达 Activity
,因此您可以
getActivity().getSupportFragmentManager()
来自你的片段
创建private MvxFragmentActivity myContext;
添加myContext = (MvxFragmentActivity)this.Activity;
并将SupportFragmentManager
替换为myContext.SupportFragmentMannager
var FragmentTransactions = FragmentManager.BeginTransaction ();
var transaction = FragmentManager.BeginTransaction();
var Manager = FragmentManager.BeginTransaction ();
LatestInvoicesFragment LatestInvoicesFragment = new LatestInvoicesFragment();
LatestInvoicesFragment.Show(myContext.SupportFragmentManager, "LatestInvoices_fragment");
如何在MvxFragment中显示MvxDialogFragment。不能使用 FragmentMaganer 和其他解决方案。
没有工作
public void ShowFragmentLatestInvoices()
{
var transaction = FragmentManager.BeginTransaction();
var Manager = FragmentManager.BeginTransaction ();
LatestInvoicesFragment LatestInvoicesFragment = new LatestInvoicesFragment();
LatestInvoicesFragment.DataContext = ViewModel.InvoiceVM;
LatestInvoicesFragment.Show(SupportFragmentManager, "LatestInvoices_fragment");
OnAttachFragment (LatestInvoices);
}
您可以通过 getActivity()
从片段中到达 Activity
,因此您可以
getActivity().getSupportFragmentManager()
来自你的片段
创建private MvxFragmentActivity myContext;
添加myContext = (MvxFragmentActivity)this.Activity;
并将SupportFragmentManager
替换为myContext.SupportFragmentMannager
var FragmentTransactions = FragmentManager.BeginTransaction ();
var transaction = FragmentManager.BeginTransaction();
var Manager = FragmentManager.BeginTransaction ();
LatestInvoicesFragment LatestInvoicesFragment = new LatestInvoicesFragment();
LatestInvoicesFragment.Show(myContext.SupportFragmentManager, "LatestInvoices_fragment");