Added few tests for Selector in Wasm

This commit is contained in:
Carl de Billy 2018-10-30 14:41:58 -04:00
Родитель a5e70bf885
Коммит 5fd4e25185
3 изменённых файлов: 24 добавлений и 3 удалений

Просмотреть файл

@ -29,6 +29,13 @@
<StackPanel Margin="0, 40">
<ToggleSwitch />
<Slider VerticalAlignment="Bottom" Value="0.5" Minimum="-1" Maximum="1.5" StepFrequency="0.1" />
<ListView x:Name="list">
<ListView.ItemsPanel>
<ItemsPanelTemplate>
<StackPanel Orientation="Horizontal" />
</ItemsPanelTemplate>
</ListView.ItemsPanel>
</ListView>
</StackPanel>
</Grid>
</ScrollViewer>

Просмотреть файл

@ -1,5 +1,6 @@
using System;
using Uno.UI.Samples.Controls;
using Windows.UI;
using Windows.UI.Xaml;
using Windows.UI.Xaml.Controls;
using Windows.UI.Xaml.Input;
@ -21,6 +22,11 @@ namespace SamplesApp.Samples.RoutedEvents
btn.Click += (s, e) => btn.Content = $"{btn.Content}.Clk";
btn.Tapped += (s, e) => btn.Content = $"{btn.Content}+T";
list.Items.Add("A");
list.Items.Add("B");
list.Items.Add("C");
list.Items.Add("D");
}
private void HookEvents(Grid grid, TextBlock textBlock)
@ -69,18 +75,21 @@ namespace SamplesApp.Samples.RoutedEvents
grid.PointerExited += (s, e) => textBlock.Text += ">>";
var blue = new SolidColorBrush(Colors.Blue);
var white = new SolidColorBrush(Colors.WhiteSmoke);
grid.PointerPressed += (s, e) =>
{
textBlock.Text += "_";
grid.BorderBrush = SolidColorBrushHelper.Blue;
grid.BorderBrush = blue;
};
grid.PointerReleased += (s, e) =>
{
textBlock.Text += "-";
grid.BorderBrush = SolidColorBrushHelper.WhiteSmoke;
grid.BorderBrush = white;
};
grid.BorderBrush = SolidColorBrushHelper.WhiteSmoke;
grid.BorderBrush = white;
grid.BorderThickness = new Thickness(3.5);
grid.GotFocus += (s, e) => textBlock.Text += ".F";

Просмотреть файл

@ -14,6 +14,11 @@ namespace Windows.UI.Xaml.Controls.Primitives
private void UpdateItemSelectedState(object item, bool updateTo)
{
if (item == null)
{
return;
}
var container = ContainerFromItem(item);
if (container is SelectorItem selectorItem)
{