private void ChangeStyleButtonClick(object sender, RoutedEventArgs e)
        {
            MyListView.Style = Resources["MyStyle"] as Style;

            var scrollViewer = MyListView.FindFirstChild <ScrollViewer>();

            MyListView.ItemsSource = CreateItems();
        }
Exemple #2
0
        private void ChangeStyleButtonClick(object sender, RoutedEventArgs e)
        {
#if NETFX_CORE
            MyListView.Style = Resources["MyStyle"] as Style;
#else
            MyListView.Style = StaticResources.FindResource("MyStyle") as Style;
#endif
            var scrollViewer = MyListView.FindFirstChild <ScrollViewer>();

            MyListView.ItemsSource = CreateItems();
        }
        private void OnLoaded(object sender, RoutedEventArgs e)
        {
#if !XAMARIN_IOS && !UNO_REFERENCE_API
            var sv = MyListView.FindFirstChild <ScrollViewer>();
            sv.ViewChanged += (o, e2) =>
            {
                var t = Dispatcher.RunAsync(Windows.UI.Core.CoreDispatcherPriority.Normal, () =>
                {
                    var panel = MyListView.ItemsPanelRoot as ItemsStackPanel;
                    FirstCacheIndexTextBlock.Text = $"FirstCacheIndex: {panel.FirstCacheIndex}";
                    LastCacheIndexTextBlock.Text  = $"LastCacheIndex: {panel.LastCacheIndex}";
                });
            };
#else
            FirstCacheIndexTextBlock.Text = "Not implemented";
            LastCacheIndexTextBlock.Text  = "Not implemented";
#endif
        }
        private void ChangeViewButtonClick(object sender, RoutedEventArgs e)
        {
            var scrollViewer = MyListView.FindFirstChild <ScrollViewer>();

            scrollViewer.ChangeView(null, 1020, null);
        }