我有:
public override void OnBackPressed ()
{
base.OnBackPressed ();
}
Run Code Online (Sandbox Code Playgroud)
Xamarin是否具有BackStackEntryCount,我该如何使用它?
例如,我单击MainMenu-> Study-> Categories-> FirstCategory,如果单击Back,我想要分类.
我需要上一个工作日:
public DateTime GetPreviousWorkDay(DateTime date)
{
DateTime prevDay = date.AddDays(-1);
bool isHoliday = IsHoliday(prevDay);
while (isHoliday || prevDay.DayOfWeek == DayOfWeek.Saturday || prevDay.DayOfWeek == DayOfWeek.Sunday)
{
prevDay = prevDay.AddDays(-1);
isHoliday = IsHoliday(prevDay);
}
return prevDay;
}
Run Code Online (Sandbox Code Playgroud)
这种方法安全吗?它可以是无限循环吗?有更简单的方法吗?
我需要使用SetOnTouchListener:
LinearLayout cardLinearLayout = FindViewById<LinearLayout> (Resource.Layout.CardList);
cardLinearLayout.SetOnTouchListener (this);//Can't use THIS, must be argument with IOnTouchListener type. Where can I get this argument?
Run Code Online (Sandbox Code Playgroud)

我想将它用于ViewFlipper.也许存在其他方式.
我为什么要这样mainLayout==null?
protected override void OnCreate (Bundle bundle)
{
base.OnCreate (bundle);
SetContentView (Resource.Layout.Main);
LinearLayout mainLayout = FindViewById<LinearLayout> (Resource.Layout.Main);//return null
mainLayout.Touch+=(s,e)=>
{
//something
}
}
Run Code Online (Sandbox Code Playgroud)
如何获取MainLayout或如何添加事件处理程序Touch?
Resource.designer.cs:
public partial class Layout
{
public const int Main = 2130903041;
//other
}
Run Code Online (Sandbox Code Playgroud) android nullreferenceexception xamarin.android android-linearlayout xamarin