다음을 통해 공유


Windows에서 RefreshView 끌어오기 방향

이 .NET 다중 플랫폼 앱 UI(.NET MAUI) Windows 플랫폼별을 사용하면 데이터를 표시하는 스크롤 가능한 컨트롤의 RefreshView 방향과 일치하도록 끌어오기 방향을 변경할 수 있습니다. 바인딩 가능한 속성을 열거형 값으로 설정 RefreshView.RefreshPullDirection 하여 XAML에서 RefreshPullDirection 사용합니다.

<ContentPage ...
             xmlns:windows="clr-namespace:Microsoft.Maui.Controls.PlatformConfiguration.WindowsSpecific;assembly=Microsoft.Maui.Controls">
    <RefreshView windows:RefreshView.RefreshPullDirection="LeftToRight"
                 IsRefreshing="{Binding IsRefreshing}"
                 Command="{Binding RefreshCommand}">
        <ScrollView>
            ...
        </ScrollView>
    </RefreshView>
 </ContentPage>

또는 흐름 API를 사용하여 C#에서 사용할 수 있습니다.

using Microsoft.Maui.Controls.PlatformConfiguration.WindowsSpecific;
...
refreshView.On<Microsoft.Maui.Controls.PlatformConfiguration.Windows>().SetRefreshPullDirection(RefreshPullDirection.LeftToRight);

이 메서드는 RefreshView.On<Microsoft.Maui.Controls.PlatformConfiguration.Windows> 이 플랫폼별이 Windows에서만 실행되도록 지정합니다. RefreshView.SetRefreshPullDirection 네임스페이 Microsoft.Maui.Controls.PlatformConfiguration.WindowsSpecific 스의 메서드는 열거형에서 RefreshPullDirection 가능한 4개의 값을 제공하는 끌어오기 방향을 RefreshView설정하는 데 사용됩니다.

  • LeftToRight 는 왼쪽에서 오른쪽으로 끌어오면 새로 고침이 시작됨을 나타냅니다.
  • TopToBottom 는 위에서 아래로 끌어오면 새로 고침이 시작되고 기본 끌어오기 방향임을 RefreshView나타냅니다.
  • RightToLeft 는 오른쪽에서 왼쪽으로 끌어오면 새로 고침이 시작됨을 나타냅니다.
  • BottomToTop 는 아래쪽에서 위쪽으로 끌어오면 새로 고침이 시작됨을 나타냅니다.

또한 메서드를 GetRefreshPullDirection 사용하여 현재를 반환 RefreshPullDirectionRefreshView할 수 있습니다.

그 결과 데이터를 표시하는 스크롤 가능한 컨트롤의 방향과 일치하도록 끌어오기 방향을 설정하기 위해 지정된 RefreshPullDirectionRefreshView방향이 적용됩니다. 다음 스크린샷은 끌어오기 RefreshView 방향의 스크린샷을 LeftToRight 보여줍니다.

Screenshot of a RefreshView with a left to right pull direction, on Windows.

참고 항목

끌어오기 방향을 변경하면 화살표가 끌어오기 방향에 적합한 위치에서 시작되도록 진행률 원의 시작 위치가 자동으로 회전합니다.