blob: 2ef5afac6c6a2000167614ca876674c161aca726 (
plain)
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
|
using System;
using Xamarin.Forms.CustomAttributes;
using Xamarin.Forms.Internals;
#if UITEST
using Xamarin.UITest;
using NUnit.Framework;
#endif
namespace Xamarin.Forms.Controls
{
[Preserve (AllMembers = true)]
[Issue (IssueTracker.Bugzilla, 36009, "Children of Layouts with data bound IsVisible are not displayed")]
public class Bugzilla36009 : TestContentPage // or TestMasterDetailPage, etc ...
{
[Preserve (AllMembers = true)]
public class SampleViewModel: ViewModelBase
{
public bool IsContentVisible {
get{ return GetProperty<bool> (); }
set{ SetProperty (value); }
}
}
protected override void Init ()
{
var boxview = new BoxView{ BackgroundColor = Color.Aqua, AutomationId = "Victory" };
var contentView = new ContentView {
Content = boxview
};
contentView.SetBinding (IsVisibleProperty, "IsContentVisible");
var layout = new AbsoluteLayout {
Children = { contentView }
};
Content = layout;
var vm = new SampleViewModel ();
BindingContext = vm;
vm.IsContentVisible = true;
}
#if UITEST
[Test]
public void Bugzilla36009Test ()
{
RunningApp.WaitForElement(q => q.Marked("Victory"));
}
#endif
}
}
|