次の方法で共有


CommandMapperExtensions.ReplaceMapping<TVirtualView,TViewHandler> メソッド

定義

コマンド マッピングを置き換えますが、型が一致しない場合は、前のマッピングを呼び出します。

public:
generic <typename TVirtualView, typename TViewHandler>
 where TVirtualView : Microsoft::Maui::IElement where TViewHandler : Microsoft::Maui::IElementHandler[System::Runtime::CompilerServices::Extension]
 static void ReplaceMapping(Microsoft::Maui::ICommandMapper<Microsoft::Maui::IElement ^, Microsoft::Maui::IElementHandler ^> ^ commandMapper, System::String ^ key, Action<TViewHandler, TVirtualView, System::Object ^> ^ method);
public static void ReplaceMapping<TVirtualView,TViewHandler>(this Microsoft.Maui.ICommandMapper<Microsoft.Maui.IElement,Microsoft.Maui.IElementHandler> commandMapper, string key, Action<TViewHandler,TVirtualView,object?> method) where TVirtualView : Microsoft.Maui.IElement where TViewHandler : Microsoft.Maui.IElementHandler;
static member ReplaceMapping : Microsoft.Maui.ICommandMapper<Microsoft.Maui.IElement, Microsoft.Maui.IElementHandler> * string * Action<'ViewHandler, 'VirtualView, obj (requires 'ViewHandler :> Microsoft.Maui.IElementHandler and 'VirtualView :> Microsoft.Maui.IElement)> -> unit (requires 'VirtualView :> Microsoft.Maui.IElement and 'ViewHandler :> Microsoft.Maui.IElementHandler)
<Extension()>
Public Sub ReplaceMapping(Of TVirtualView As IElement, TViewHandler As IElement) (commandMapper As ICommandMapper(Of IElement, IElementHandler), key As String, method As Action(Of TViewHandler, TVirtualView, Object))

型パラメーター

TVirtualView

クロスプラットフォーム型。

TViewHandler

ハンドラーの型。

パラメーター

commandMapper
ICommandMapper<IElement,IElementHandler>

マッピングを変更するコマンド マッパー。

key
String

コマンドの名前。

method
Action<TViewHandler,TVirtualView,Object>

コマンドが更新されたときに呼び出す変更されたメソッド。

適用対象