1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
|
using System.Diagnostics;
using Xamarin.Forms.CustomAttributes;
using Xamarin.Forms.Internals;
using Xamarin.Forms.Maps;
namespace Xamarin.Forms.Controls
{
[Preserve (AllMembers=true)]
[Issue (IssueTracker.Github, 886, "Map scrolling problems", PlatformAffected.Android)]
public class Issue886 : ContentPage
{
public Issue886 ()
{
var isScrollEnabledSwitch = new Switch {
IsToggled = true
};
var isScrollEnabledLabel = new Label {
Text = "Scroll Enabled"
};
var isScrollEnabledLabelOn = new Label {
Text = isScrollEnabledSwitch.IsToggled.ToString ()
};
var isZoomEnabledSwitch = new Switch {
IsToggled = true
};
var isZoomEnabledLabel = new Label {
Text = "Zoom Enabled"
};
var isZoomEnabledLabelOn = new Label {
Text = isZoomEnabledSwitch.IsToggled.ToString ()
};
var map = new Map ();
isScrollEnabledSwitch.Toggled += (sender, e) => {
isScrollEnabledLabelOn.Text = e.Value.ToString ();
map.HasScrollEnabled = e.Value;
};
isZoomEnabledSwitch.Toggled += (sender, e) => {
isZoomEnabledLabelOn.Text = e.Value.ToString ();
map.HasZoomEnabled = e.Value;
};
Content = new StackLayout {
Children ={
new StackLayout {
Orientation = StackOrientation.Horizontal,
Children = {
isScrollEnabledSwitch,
isScrollEnabledLabel,
isScrollEnabledLabelOn
}
},
new StackLayout {
Orientation = StackOrientation.Horizontal,
Children = {
isZoomEnabledSwitch,
isZoomEnabledLabel,
isZoomEnabledLabelOn
}
},
map
}
};
}
}
}
|