2016-03-22 23:02:25 +03:00
|
|
|
|
using System;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
|
|
|
|
|
using Xamarin.Forms;
|
|
|
|
|
using System.Collections.ObjectModel;
|
|
|
|
|
using NUnit.Framework;
|
|
|
|
|
|
|
|
|
|
namespace Xamarin.Forms.Xaml.UnitTests
|
|
|
|
|
{
|
|
|
|
|
public class AttachedBP
|
|
|
|
|
{
|
|
|
|
|
public static readonly BindableProperty AttachedBPProperty = BindableProperty.CreateAttached (
|
|
|
|
|
"AttachedBP",
|
|
|
|
|
typeof(GenericCollection),
|
|
|
|
|
typeof(AttachedBP),
|
|
|
|
|
null);
|
2016-09-08 21:51:01 +03:00
|
|
|
|
|
|
|
|
|
public static GenericCollection GetAttachedBP(BindableObject bindable)
|
|
|
|
|
{
|
|
|
|
|
throw new NotImplementedException();
|
|
|
|
|
}
|
2016-03-22 23:02:25 +03:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public class GenericCollection : ObservableCollection<object>
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public partial class GenericCollections : ContentPage
|
|
|
|
|
{
|
|
|
|
|
public GenericCollections ()
|
|
|
|
|
{
|
|
|
|
|
InitializeComponent ();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public GenericCollections (bool useCompiledXaml)
|
|
|
|
|
{
|
|
|
|
|
//this stub will be replaced at compile time
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[TestFixture]
|
|
|
|
|
public class Tests
|
|
|
|
|
{
|
|
|
|
|
[TestCase (false)]
|
|
|
|
|
[TestCase (true)]
|
|
|
|
|
public void SupportsCrookedGenericScenarios (bool useCompiledXaml)
|
|
|
|
|
{
|
|
|
|
|
var p = new GenericCollections ();
|
|
|
|
|
Assert.AreEqual ("Foo", (p.label0.GetValue (AttachedBP.AttachedBPProperty) as GenericCollection) [0]);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|