Esempio n. 1
0
        public CreateMemoryPage()
        {
            InitializeComponent();
            TitleBarControl.SetBackButtonVisibility(Visibility.Visible);
            // 设置为多选
            GalleryGridViewControl.SetGridViewMultipleSelection();
            // 标题box
            TitleBox.Text = new DateTimeFormatter("longdate").Format(DateTime.Now);
            // 完成button
            DoneButton.Click += async(sender, args) =>
            {
                if (_memoryListView == null)
                {
                    return;
                }
                // 新建一个回忆VM
                var memoryViewModel = await MemoryViewModel.GetInstanceAsync();

                memoryViewModel.KeyNo           = _memoryListView.LastKeyNo + 1;
                memoryViewModel.MemoryName      = TitleBox.Text;
                memoryViewModel.ImageViewModels = GalleryGridViewControl.SelectedImageViewModels;
                memoryViewModel.CoverImage      = memoryViewModel.ImageViewModels[0].ThumbnailImage;
                _memoryListView.Add(memoryViewModel);
                GoBack();
            };
            // 取消button
            CancelButton.Click += (sender, args) => { GoBack(); };
        }
Esempio n. 2
0
        public MemoryDetailPage()
        {
            InitializeComponent();
            InitVisual();
            TitleBarControl.SetBackButtonVisibility(Visibility.Visible);
            ShowButton.Click += (sender, args) =>
            {
                // 进入街景界面
                var rootFrame = Window.Current.Content as Frame;
                rootFrame?.Navigate(typeof(StreetViewPage), _memoryModel);
                Window.Current.Content = rootFrame;
                Debug.WriteLine("进入街景界面");
            };
            AudioButton.Click += async(sender, args) =>
            {
                var filePicker = new FileOpenPicker();
                filePicker.FileTypeFilter.Add(".mp3");
                filePicker.SuggestedStartLocation = PickerLocationId.MusicLibrary;
                var file = await filePicker.PickSingleFileAsync();

                if (file == null)
                {
                    return;
                }
                var newFile = await file.CopyAsync(ApplicationData.Current.LocalFolder);

                await newFile.RenameAsync(_memoryModel.KeyNo.ToString(), NameCollisionOption.ReplaceExisting);

                // 显示成功通知
                var flyout = FlyoutBase.GetAttachedFlyout((FrameworkElement)sender);
                flyout.ShowAt((FrameworkElement)sender);
                await Task.Run(async() =>
                {
                    await Dispatcher.RunAsync(CoreDispatcherPriority.Normal, async() =>
                    {
                        await Task.Delay(1000);
                        flyout.Hide();
                    });
                });
            };
            DeleteButton.Click += (sender, args) =>
            {
                var rootFrame = Window.Current.Content as Frame;
                //_memoryListViewModel.Delete(_memoryViewModel);

                ViewModelLocator.Instance.MemoryListViewModel.DeleteCommand.Execute(_memoryModel);
                rootFrame?.GoBack();
            };
        }
        public CreateMemoryPage()
        {
            InitializeComponent();

            TitleBarControl.SetBackButtonVisibility(Visibility.Visible);
            // 设置为多选
            GalleryGridViewControl.SetGridViewMultipleSelection();
            // 标题box
            TitleBox.Text = new DateTimeFormatter("longdate").Format(DateTime.Now);
            // 完成button
            DoneButton.Click += async(sender, args) =>
            {
                MemoryModel memoryModel = await ViewModelLocator.Instance.MemoryListViewModel.CreateMemoryAsync(
                    ViewModelLocator.Instance.MemoryListViewModel.MemoryList.LastKeyNo,
                    TitleBox.Text, GalleryGridViewControl.SelectedImageModels);

                ViewModelLocator.Instance.MemoryListViewModel.AddCommand.Execute(memoryModel);
                GoBack();
            };
            // 取消button
            CancelButton.Click += (sender, args) => { GoBack(); };
        }
 public SettingPage()
 {
     InitializeComponent();
     TitleBarControl.SetBackButtonVisibility(Visibility.Visible);
     DataContext = ViewModelLocator.Instance.FolderListViewModel;
 }
Esempio n. 5
0
 public SettingPage()
 {
     InitializeComponent();
     TitleBarControl.SetBackButtonVisibility(Visibility.Visible);
 }