File tree Expand file tree Collapse file tree 4 files changed +77
-0
lines changed
Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared Expand file tree Collapse file tree 4 files changed +77
-0
lines changed Original file line number Diff line number Diff line change
1
+ <?xml version =" 1.0" encoding =" utf-8" ?>
2
+ <ContentPage xmlns =" http://xamarin.com/schemas/2014/forms"
3
+ xmlns : x =" http://schemas.microsoft.com/winfx/2009/xaml"
4
+ xmlns : d =" http://xamarin.com/schemas/2014/forms/design"
5
+ xmlns : mc =" http://schemas.openxmlformats.org/markup-compatibility/2006"
6
+ mc : Ignorable =" d"
7
+ Title =" Test 14350"
8
+ x : Class =" Xamarin.Forms.Controls.Issues.Issue14350" >
9
+
10
+ <RefreshView IsRefreshing =" {Binding IsRefreshing}" Command =" {Binding Refresh}" IsEnabled =" {Binding IsRefreshAllowed}" >
11
+ <ScrollView >
12
+ <StackLayout >
13
+ <Label Text =" Test for issue #14350" />
14
+ <Label Text =" Refreshing ..." IsVisible =" {Binding IsRefreshing}" BackgroundColor =" Orange" />
15
+ <Label Text =" Enable refresh:" IsVisible =" {Binding IsRefreshAllowed}" TextColor =" Green" />
16
+ <StackLayout >
17
+ <StackLayout Orientation =" Horizontal" >
18
+ <Label Text =" Refresh enabled:" HorizontalOptions =" FillAndExpand" />
19
+ <Switch IsToggled =" {Binding IsRefreshAllowed}" />
20
+ </StackLayout >
21
+ </StackLayout >
22
+ <StackLayout >
23
+ <Label Text =" Test steps (Android):" />
24
+ <Label Text =" 1. Swipe to refresh" />
25
+ <Label Text =" 2. Refresh/busy indicator appears at the top" />
26
+ <Label Text =" 3. Refresh/busy indicator should remain visible until content changes (refresh is finished).
27
+ due to issue #14350 the indicator vanishes too early if Command.CanExecute toggles (in this test after 1 second)." />
28
+ <Label Text =" 4. Repeat steps 1 to 3 multiple times" />
29
+ </StackLayout >
30
+ </StackLayout >
31
+ </ScrollView >
32
+ </RefreshView >
33
+ </ContentPage >
Original file line number Diff line number Diff line change
1
+ using System . ComponentModel ;
2
+
3
+ using Xamarin . Forms ;
4
+ using Xamarin . Forms . CustomAttributes ;
5
+ using Xamarin . Forms . Internals ;
6
+
7
+ namespace Xamarin . Forms . Controls . Issues
8
+ {
9
+ // Learn more about making custom code visible in the Xamarin.Forms previewer
10
+ // by visiting https://aka.ms/xamarinforms-previewer
11
+ [ DesignTimeVisible ( false ) ]
12
+ [ Preserve ( AllMembers = true ) ]
13
+ [ Issue ( IssueTracker . Github , 14350 ,
14
+ "[Bug] RefreshView to completes instantly when using AsyncCommand or Command with CanExecute functionality" ,
15
+ PlatformAffected . Android ) ]
16
+ public partial class Issue14350 : ContentPage
17
+ {
18
+ public Issue14350 ( )
19
+ {
20
+ #if APP
21
+ InitializeComponent ( ) ;
22
+ BindingContext = new ViewModelIssue8384 ( ) ;
23
+ #endif
24
+ }
25
+ }
26
+ }
Original file line number Diff line number Diff line change @@ -55,6 +55,7 @@ public bool Allow
55
55
56
56
private List < string > _items ;
57
57
private bool _isRefreshing ;
58
+ private bool _isRefreshAllowed = true ;
58
59
private MyCommand _refresh ;
59
60
60
61
static readonly List < string > FIRST_LIST = new List < string > ( ) {
@@ -78,6 +79,19 @@ public bool IsRefreshing
78
79
}
79
80
}
80
81
82
+ public bool IsRefreshAllowed
83
+ {
84
+ get
85
+ {
86
+ return _isRefreshAllowed ;
87
+ }
88
+ set
89
+ {
90
+ _isRefreshAllowed = value ;
91
+ OnPropertyChanged ( "IsRefreshAllowed" ) ;
92
+ }
93
+ }
94
+
81
95
public ViewModelIssue8384 ( )
82
96
{
83
97
Items = FIRST_LIST ;
Original file line number Diff line number Diff line change 1795
1795
<Compile Include =" $(MSBuildThisFileDirectory)Issue11795.xaml.cs" />
1796
1796
<Compile Include =" $(MSBuildThisFileDirectory)Issue14528.cs" />
1797
1797
<Compile Include =" $(MSBuildThisFileDirectory)Issue14286.xaml.cs" />
1798
+ <Compile Include =" $(MSBuildThisFileDirectory)Issue14350.xaml.cs" />
1798
1799
<Compile Include =" $(MSBuildThisFileDirectory)Issue14613.xaml.cs" />
1799
1800
<Compile Include =" $(MSBuildThisFileDirectory)Issue13930.xaml.cs" />
1800
1801
<Compile Include =" $(MSBuildThisFileDirectory)Issue11211.xaml.cs" />
2282
2283
</EmbeddedResource >
2283
2284
<EmbeddedResource Include =" $(MSBuildThisFileDirectory)Issue14286.xaml" >
2284
2285
<Generator >MSBuild:UpdateDesignTimeXaml</Generator >
2286
+ </EmbeddedResource >
2287
+ <EmbeddedResource Include =" $(MSBuildThisFileDirectory)Issue14350.xaml" >
2288
+ <Generator >MSBuild:UpdateDesignTimeXaml</Generator >
2285
2289
</EmbeddedResource >
2286
2290
<EmbeddedResource Include =" $(MSBuildThisFileDirectory)Issue14613.xaml" >
2287
2291
<Generator >MSBuild:UpdateDesignTimeXaml</Generator >
You can’t perform that action at this time.
0 commit comments