示例#1
0
 private void TransitionList_SelectionChanged(object sender, System.Windows.Controls.SelectionChangedEventArgs e)
 {
     if (this.photoListBox.SelectedItem != null && this.photoListBox.SelectedItem is ComposePhotoViewModel)
     {
         // 更新设计器以显示选定特效所需的额外的控件.
         // UI是一个内容绑定到视图模型的TransitionDesigner属性的ContentControl.
         ComposePhotoViewModel photo = (ComposePhotoViewModel)this.photoListBox.SelectedItem;
         photo.TransitionDesigner = TransitionFactory.CreateTransitionDesigner(this.transitionList.SelectedItem.ToString());
     }
 }
示例#2
0
        private void EditPhotoButton_Click(object sender, System.EventArgs e)
        {
            if (this.photoListBox.SelectedItem != null && this.photoListBox.SelectedItem is ComposePhotoViewModel)
            {
                this.photoListBox.IsEnabled = false;

                // 备份视图模型, 因此我们可以撤销更新操作.
                this._viewModelBackup = ((ComposePhotoViewModel)this.photoListBox.SelectedItem).CopyTo();
                this.ShowEditPanelStoryboard.Begin();
            }
        }
示例#3
0
 private void RemovePhotoButton_Click(object sender, System.EventArgs e)
 {
     // 移除选定项目, 关闭对应流.
     if (this.photoListBox.SelectedItem != null && this.photoListBox.SelectedItem is ComposePhotoViewModel)
     {
         ComposePhotoViewModel photo = (ComposePhotoViewModel)this.photoListBox.SelectedItem;
         photo.MediaStream.Close();
         this._photoDataSource.Remove(photo);
         photo.RemoveModel();
     }
 }
示例#4
0
        protected override void OnNavigatedTo(System.Windows.Navigation.NavigationEventArgs e)
        {
            // 准备数据源.
            this._photoDataSource = new ObservableCollection <ComposePhotoViewModel>();
            this.nameTextBox.Text = App.CurrentStoryName;
            foreach (Photo photo in App.MediaCollection)
            {
                _photoDataSource.Add(ComposePhotoViewModel.CreateFromModel(photo));
            }
            this.photoListBox.ItemsSource = this._photoDataSource;

            base.OnNavigatedTo(e);
        }