Exemple #1
0
 public void ValidateGetSetItemsSource()
 {
     RunOnUIThread.Execute(() =>
     {
         ItemsRepeater repeater = new ItemsRepeater();
         var dataSource         = new ItemsSourceView(Enumerable.Range(0, 10).Select(i => string.Format("Item #{0}", i)));
         repeater.SetValue(ItemsRepeater.ItemsSourceProperty, dataSource);
         Verify.AreSame(dataSource, repeater.GetValue(ItemsRepeater.ItemsSourceProperty) as ItemsSourceView);
         Verify.AreSame(dataSource, repeater.ItemsSourceView);
     });
 }
Exemple #2
0
        public void ValidateGetSetBackground()
        {
            RunOnUIThread.Execute(() =>
            {
                ItemsRepeater repeater = new ItemsRepeater();
                var redBrush           = new SolidColorBrush(Colors.Red);
                repeater.SetValue(ItemsRepeater.BackgroundProperty, redBrush);
                Verify.AreSame(redBrush, repeater.GetValue(ItemsRepeater.BackgroundProperty) as Brush);
                Verify.AreSame(redBrush, repeater.Background);

                var blueBrush       = new SolidColorBrush(Colors.Blue);
                repeater.Background = blueBrush;
                Verify.AreSame(blueBrush, repeater.Background);
            });
        }