SystemBackdrop.OnTargetConnected 메서드

정의

이 개체가 유효한 컨테이너에 연결되면 호출됩니다. 예를 들어 에 설정된 경우입니다 Window.SystemBackdrop.

protected:
 virtual void OnTargetConnected(ICompositionSupportsSystemBackdrop ^ connectedTarget, XamlRoot ^ xamlRoot) = OnTargetConnected;
void OnTargetConnected(ICompositionSupportsSystemBackdrop const& connectedTarget, XamlRoot const& xamlRoot);
protected virtual void OnTargetConnected(ICompositionSupportsSystemBackdrop connectedTarget, XamlRoot xamlRoot);
function onTargetConnected(connectedTarget, xamlRoot)
Protected Overridable Sub OnTargetConnected (connectedTarget As ICompositionSupportsSystemBackdrop, xamlRoot As XamlRoot)

매개 변수

connectedTarget
ICompositionSupportsSystemBackdrop

배경의 대상입니다.

xamlRoot
XamlRoot

배경 대상의 XAML 루트입니다.

예제

전체 예제 는 SystemBackdrop 을 참조하세요.

protected override void OnTargetConnected(ICompositionSupportsSystemBackdrop connectedTarget, XamlRoot xamlRoot)
{
    // Call the base method to initialize the default configuration object.
    base.OnTargetConnected(connectedTarget, xamlRoot);

    // This example does not support sharing MicaSystemBackdrop instances.
    if (micaController is not null)
    {
        throw new Exception("This controller cannot be shared");
    }

    micaController = new MicaController();
    // Set configuration.
    SystemBackdropConfiguration defaultConfig = GetDefaultSystemBackdropConfiguration(connectedTarget, xamlRoot);
    micaController.SetSystemBackdropConfiguration(defaultConfig);
    // Add target.
    micaController.AddSystemBackdropTarget(connectedTarget);
}

설명

이 메서드는 이 SystemBackdrop이 유효한 컨테이너에 연결되면 호출됩니다. 즉, ICompositionSupportsSystemBackdrop을 구현하는 개체의 SystemBackdrop 속성(예: Window.SystemBackdrop)에 할당됩니다.

기본 ISystemBackdropController 및 해당 SystemBackdropConfiguration을 만들고 구성하려면 이 메서드를 재정의합니다.

적용 대상

추가 정보