この機能の実装は次のとおりです。
フォーム ファクタ自体は次のように定義されます。
public MvxTouchFormFactor FormFactor
{
get
{
switch (UIDevice.CurrentDevice.UserInterfaceIdiom)
{
case UIUserInterfaceIdiom.Phone:
if (UIScreen.MainScreen.Bounds.Height*UIScreen.MainScreen.Scale >= 1136)
return MvxTouchFormFactor.TallPhone;
return MvxTouchFormFactor.Phone;
case UIUserInterfaceIdiom.Pad:
return MvxTouchFormFactor.Pad;
default:
throw new ArgumentOutOfRangeException();
}
}
}
つまり、現在と同じでPhone
はないことがわかりますTallPhone
ここでの最も簡単な方法は、おそらく独自の条件付き属性を記述することだと思います-これは非常に簡単です- がどのようMvxFormFactorSpecificAttribute
に定義されているかを見て、それを独自の属性の基礎として使用してください:
[AttributeUsage(AttributeTargets.Class)]
public class MyFormFactorSpecificAttribute
: MvxConditionalConventionalAttribute
{
public override bool IsConditionSatisfied
{
get
{
// put your logic here - could use Mvx.Resolve<IMvxTouchPlatformProperties>()
return TODO;
}
}
}
あなたの属性が他のユーザーにとって良いと思われる場合は、ここで MvvmCross にプル リクエストを返して改善を求める可能性があります。
または、競合するビューを としてマークし、Unconventional
手動で View-ViewModel ルックアップに追加することもできます。Setup
申し訳ありませんが、この領域にはいくつかの混乱があります。たとえば、この種の機能は将来のある時点で機能MvxTouchPlatformProperties
に置き換えられると予想/希望しているため、既に廃止済みとしてマークしています。CrossCore