StoryboardSample/PhotosPage1803.xaml.cs

(开头部分) 3KB

这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。

using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Runtime.InteropServices.WindowsRuntime;
using Windows.Foundation;
using Windows.Foundation.Collections;
using Windows.UI.Xaml;
using Windows.UI.Xaml.Controls;
using Windows.UI.Xaml.Controls.Primitives;
using Windows.UI.Xaml.Data;
using Windows.UI.Xaml.Input;
using Windows.UI.Xaml.Media;
using Windows.UI.Xaml.Media.Animation;
using Windows.UI.Xaml.Navigation;

// The Blank Page item template is documented at https://go.microsoft.com/fwlink/?LinkId=234238

namespace StoryboardSample
{
    /// <summary>
    /// An empty page that can be used on its own or navigated to within a Frame.
    /// </summary>
    public sealed partial class PhotosPage1803 : Page
    {
        public List<PhotoModel> Photos { get; set; }

        private Popup popup = new Popup();

        public PhotosPage1803()
        {
            this.InitializeComponent();
            Photos = CreatePhotos();
            this.DataContext = this;
            popup.RenderTransform = new TranslateTransform();
        }

        private List<PhotoModel> CreatePhotos()
        {
            return new List<PhotoModel>
            {
                new PhotoModel {  ImageUri = new Uri("ms-appx:///Assets/0.jpg")},
                new PhotoModel {  ImageUri = new Uri("ms-appx:///Assets/1.jpg")},
                new PhotoModel {  ImageUri = new Uri("ms-appx:///Assets/2.jpg")},
                new PhotoModel {  ImageUri = new Uri("ms-appx:///Assets/3.jpg")},
                new PhotoModel {  ImageUri = new Uri("ms-appx:///Assets/4.jpg")},
                new PhotoModel {  ImageUri = new Uri("ms-appx:///Assets/5.jpg")},
                new PhotoModel {  ImageUri = new Uri("ms-appx:///Assets/6.jpg")},
                new PhotoModel {  ImageUri = new Uri("ms-appx:///Assets/7.jpg")},
                new PhotoModel {  ImageUri = new Uri("ms-appx:///Assets/8.jpg")},
                new PhotoModel {  ImageUri = new Uri("ms-appx:///Assets/9.jpg")}
            };
        }

        private void Image_Tapped(object sender, TappedRoutedEventArgs e)
        {
            popup.IsOpen = false;

            var tappedImage = e.OriginalSource as Image;
            var image = new Image { Source = tappedImage.Source };
后面还有 31 行代码,解锁后查看完整代码

24 小时内免费解锁 3 个项目,之后 1 积分/个。 规则说明

AI 解读

登录后可用,每次 10 积分,解读结果公开显示在下面。

还没有人解读过这个文件。