示例#1
0
        private async void StoresCollectionLoaded(object sender, RoutedEventArgs e)
        {
            if (_selectedStore == null)
            {
                return;
            }
            StoresCollection.ScrollIntoView(_selectedStore, ScrollIntoViewAlignment.Default);
            // undo focus
            StoresCollection.SelectedItem = null;
            StoresCollection.UpdateLayout();
            var storeImgBackConnectedAnimation =
                ConnectedAnimationService.GetForCurrentView().GetAnimation("StoreImgBackConnectedAnimation");

            if (storeImgBackConnectedAnimation != null)
            {
                await StoresCollection.TryStartConnectedAnimationAsync(storeImgBackConnectedAnimation, _selectedStore,
                                                                       "StoreImg");
            }

            var storeNameBackConnectedAnimation = ConnectedAnimationService.GetForCurrentView()
                                                  .GetAnimation("StoreNameBackConnectedAnimation");

            if (storeNameBackConnectedAnimation != null)
            {
                await StoresCollection.TryStartConnectedAnimationAsync(storeNameBackConnectedAnimation, _selectedStore,
                                                                       "StoreName");
            }
        }
        /// <summary>
        /// Tries to deserialize stores collection
        /// </summary>
        protected override bool OnDeserializeUnrecognizedElement(string elementName, System.Xml.XmlReader reader)
        {
            if (elementName == StoresCollectionElementName)
            {
                var storesCollection = new StoresCollection(this);
                storesCollection.Deserialize(reader);
                Stores = storesCollection;
                return true;
            }

            return base.OnDeserializeUnrecognizedElement(elementName, reader);
        }
示例#3
0
 private void Details(object sender, ItemClickEventArgs e)
 {
     if (!(StoresCollection.ContainerFromItem(e.ClickedItem) is ListViewItem container))
     {
         return;
     }
     _selectedStore = container.Content as Store;
     StoresCollection.PrepareConnectedAnimation("StoreImgForwardConnectedAnimation", _selectedStore, "StoreImg");
     StoresCollection.PrepareConnectedAnimation("StoreNameForwardConnectedAnimation", _selectedStore,
                                                "StoreName");
     if (_selectedStore != null)
     {
         Frame.Navigate(typeof(StoreDetails), _selectedStore);
     }
 }