Repository navigation
Closed
Labels
kind/bugSomething isn't workingplatform/wasm 🌐Categorizes an issue or PR as relevant to the WebAssembly platform
Description
MainPage.xaml:
<Page x:Class="UnoTest.MainPage"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="using:UnoTest"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d">
<Grid Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">
<Grid.RowDefinitions>
<RowDefinition />
<RowDefinition />
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition />
<ColumnDefinition />
</Grid.ColumnDefinitions>
<Grid Background="LightBlue">
<TextBlock x:Name="TextBlock"
Margin="20"
FontSize="50"
VerticalAlignment="Center"
HorizontalAlignment="Center"
Text="{Binding NumberOfClicks}" />
</Grid>
<Button Grid.Row="1"
Grid.ColumnSpan="2"
FontSize="35"
Foreground="White"
Background="Green"
Content="Click Me !"
VerticalAlignment="Center"
HorizontalAlignment="Center"
Command="{Binding ClickMeButtonCommand}" />
<ListView Grid.Row="0"
Grid.Column="1"
Background="Blue"
HorizontalAlignment="Stretch"
VerticalAlignment="Stretch"
ItemsSource="{Binding Numbers}">
<ListView.ItemTemplate>
<DataTemplate>
<TextBlock Text="{Binding}"
Foreground="White"
FontSize="20"
FontWeight="Bold" />
</DataTemplate>
</ListView.ItemTemplate>
</ListView>
</Grid>
</Page>
MainPage.xaml.cs:
using UnoTest.Shared.ViewModels;
using Windows.UI.Xaml.Controls;
namespace UnoTest
{
public sealed partial class MainPage : Page
{
public MainPage()
{
InitializeComponent();
DataContext = new MainPageViewModel();
}
}
}
MainPageViewModel.cs:
using System.Collections.ObjectModel;
using System.ComponentModel;
using System.Windows.Input;
using GalaSoft.MvvmLight;
using GalaSoft.MvvmLight.Command;
namespace UnoTest.Shared.ViewModels
{
#if __WASM__
[Bindable(true)]
#endif
public class MainPageViewModel : ViewModelBase
{
private int numberOfClicks = 0;
private ObservableCollection<int> numbers = new ObservableCollection<int>();
public MainPageViewModel()
{
ClickMeButtonCommand = new RelayCommand(OnClickMeButton);
}
public ICommand ClickMeButtonCommand { get; }
public int NumberOfClicks
{
get => numberOfClicks;
set
{
numberOfClicks = value;
RaisePropertyChanged(nameof(NumberOfClicks));
}
}
public ObservableCollection<int> Numbers => numbers;
private void OnClickMeButton()
{
NumberOfClicks += 1;
Numbers.Add(NumberOfClicks);
}
}
}
Result:
Eeach click adds a new element (int number) to the list which takes more and more time. After about only 10 clicks (only ten numbers on the list) adding next element (next click) takes about 1-2 seconds.
Additionally FireFox console shows many errors:
MvvmLight compiled to .Net Standard 2.0 has been used.
Metadata
Metadata
Assignees
Labels
kind/bugSomething isn't workingplatform/wasm 🌐Categorizes an issue or PR as relevant to the WebAssembly platform


Activity
jeromelaban commentedon Jun 16, 2018
The
ListViewimplementation in WASM is not virtualizing items at the moment, and is using a StackPanel. The iOS and Android do virtualize properly, though.[-]Wasm and ListView - adding a couple of int elements to the list slower and slower[/-][+][WASM] ListView is not virtualizing items[/+][-][WASM] ListView is not virtualizing items[/-][+]ListView is not virtualizing items[/+]Merge pull request unoplatform#46 from unoplatform/pj/wasm-fix
chore: MOAR LOGGING
chore: MOAR LOGGING