Skip to content

Commit e88ca39

Browse files
committed
feat: WinUI RefreshContainer
1 parent 73bcc96 commit e88ca39

File tree

7 files changed

+508
-0
lines changed

7 files changed

+508
-0
lines changed
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
namespace Microsoft.UI.Private.Controls
2+
{
3+
internal interface IRefreshContainerPrivate
4+
{
5+
IRefreshInfoProviderAdapter RefreshInfoProviderAdapter { get; set; }
6+
}
7+
}
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
#nullable enable
2+
3+
using Microsoft.UI.Private.Controls;
4+
using Uno.Disposables;
5+
using Windows.Foundation;
6+
using Windows.UI.Xaml.Controls;
7+
8+
namespace Microsoft.UI.Xaml.Controls
9+
{
10+
public partial class RefreshContainer
11+
{
12+
private Panel? m_root;
13+
private Panel? m_refreshVisualizerPresenter;
14+
private RefreshVisualizer? m_refreshVisualizer;
15+
private Deferral? m_visualizerRefreshCompletedDeferral;
16+
private RefreshPullDirection m_refreshPullDirection = RefreshPullDirection.TopToBottom;
17+
private IRefreshInfoProviderAdapter? m_refreshInfoProviderAdapter;
18+
private readonly SerialDisposable m_refreshVisualizerSizeChangedToken = new SerialDisposable();
19+
20+
private bool m_hasDefaultRefreshVisualizer = false;
21+
private bool m_hasDefaultRefreshInfoProviderAdapter = false;
22+
}
23+
}
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
using Windows.UI.Xaml;
2+
3+
namespace Microsoft.UI.Xaml.Controls
4+
{
5+
public partial class RefreshContainer
6+
{
7+
public RefreshPullDirection PullDirection
8+
{
9+
get => (RefreshPullDirection)GetValue(PullDirectionProperty);
10+
set => SetValue(PullDirectionProperty, value);
11+
}
12+
13+
public static DependencyProperty PullDirectionProperty { get; } =
14+
DependencyProperty.Register(nameof(PullDirection), typeof(RefreshPullDirection), typeof(RefreshContainer), new FrameworkPropertyMetadata(RefreshPullDirection.TopToBottom, OnPropertyChanged));
15+
16+
public RefreshVisualizer Visualizer
17+
{
18+
get => (RefreshVisualizer)GetValue(VisualizerProperty);
19+
set => SetValue(VisualizerProperty, value);
20+
}
21+
22+
public static DependencyProperty VisualizerProperty { get; } =
23+
DependencyProperty.Register(nameof(Visualizer), typeof(RefreshVisualizer), typeof(RefreshContainer), new FrameworkPropertyMetadata(null, OnPropertyChanged));
24+
25+
private static void OnPropertyChanged(DependencyObject sender, DependencyPropertyChangedEventArgs args)
26+
{
27+
var owner = (RefreshContainer)sender;
28+
owner.OnPropertyChanged(args);
29+
}
30+
}
31+
}

0 commit comments

Comments
 (0)