Esempio n. 1
0
        private void WaterfallContent_Loaded(object sender, RoutedEventArgs e)
        {
            var WaterfallContent = sender as Controls.WaterfallContentPanel;

            if (ActualWidth < 700)
            {
                WaterfallContent.Colums = 3;
            }
            else if (ActualWidth < 900)
            {
                WaterfallContent.Colums = 4;
            }
            else if (ActualWidth < 1100)
            {
                WaterfallContent.Colums = 5;
            }
            else
            {
                WaterfallContent.Colums = 6;
            }
            if (clicked != null)
            {
                _ = Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
                {
                    try
                    {
                        var element = WaterfallListView.ContainerFromIndex(clicked.Value) as UIElement;
                        WaterfallListView.ScrollToItem(element);
                    }
                    catch
                    { }
                });
            }
        }
Esempio n. 2
0
        private void WaterfallContent_Loaded(object sender, RoutedEventArgs e)
        {
            var WaterfallContent = sender as Controls.WaterfallContentPanel;

            if (ActualWidth < 700)
            {
                WaterfallContent.Colums = 3;
            }
            else if (ActualWidth < 900)
            {
                WaterfallContent.Colums = 4;
            }
            else if (ActualWidth < 1100)
            {
                WaterfallContent.Colums = 5;
            }
            else
            {
                WaterfallContent.Colums = 6;
            }
            if (verticalOffset != null)
            {
                _ = Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
                {
                    try
                    {
                        WaterfallListView.ScrollToOffset(verticalOffset);
                    }
                    catch (Exception ex)
                    {
                        Trace.WriteLine($"[{nameof(this.WaterfallContent_Loaded)}]");
                        Trace.WriteLine(ex);
                    }
                });
            }
        }