如何在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);
}
答案 0 :(得分:1)
您可以通过Activity
从片段中获取getActivity()
,这样就可以了
您片段中的getActivity().getSupportFragmentManager()
答案 1 :(得分:1)
创建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");