private static void AddListViewBaseItemAnimationDetails(DependencyObject d) { if (!(d is Windows.UI.Xaml.Controls.ListViewBase listViewBase)) { return; } var elementName = GetListItemElementName(d); var key = GetListItemKey(d); if (string.IsNullOrWhiteSpace(elementName) || string.IsNullOrWhiteSpace(key)) { return; } var props = new ConnectedAnimationProperties() { Key = key, IsListAnimation = true, ElementName = elementName, ListViewBase = listViewBase }; _connectedAnimationsProps.Add(props); }
private static void OnKeyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) { SetupFrame(); if (e.OldValue is string oldKey) { var item = _connectedAnimationsProps.Where(i => i.Key == oldKey).FirstOrDefault(); if (item != null) { _connectedAnimationsProps.Remove(item); } } if (d is FrameworkElement element && e.NewValue is string newKey) { var animation = new ConnectedAnimationProperties() { Key = newKey, Element = element, }; _connectedAnimationsProps.Add(animation); } }