Ejemplo n.º 1
0
        private void ClosingStoryboard_Completed(object sender, EventArgs e)
        {
            Hide();
            _isDisplayed = false;
            _actionOnHidding();
            _closingStoryboard.Remove();
            _openingStoryboard.Remove();

            var dataContext = (PasteBarWindowViewModel)DataContext;

            if (dataContext.DataEntries.Any(item => item.IsMoreInfoDisplayed))
            {
                foreach (var dataContextDataEntry in dataContext.DataEntries.Where(item => item.IsMoreInfoDisplayed))
                {
                    dataContextDataEntry.IsMoreInfoDisplayed = false;
                }
                DataListBox.Items.Refresh();
            }

            if (DataListBox.Items.Count > 0)
            {
                DataListBox.ScrollIntoView(DataListBox.Items[0]);
            }

            DataListBox.SelectedItem  = null;
            DataListBox.SelectedIndex = 0;
        }
Ejemplo n.º 2
0
        internal void Previous()
        {
            var view     = ViewModel.CollectionView;
            var position = view.CurrentPosition;

            if (position <= 0)
            {
                return;
            }
            var r = view.MoveCurrentToPosition(position - 1);

            if (r)
            {
                DataListBox.ScrollIntoView(view.CurrentItem);
            }
        }
Ejemplo n.º 3
0
        internal void Next()
        {
            var view     = ViewModel.CollectionView;
            var position = view.CurrentPosition;

            if (position >= view.Count - 1)
            {
                return;
            }
            var r = view.MoveCurrentToPosition(position + 1);

            if (r)
            {
                DataListBox.ScrollIntoView(view.CurrentItem);
            }
        }
Ejemplo n.º 4
0
        /// <summary>
        /// 批量下载 - 操控线程
        /// </summary>
        private void AutoDownload()
        {
            this.Dispatcher.BeginInvoke(DispatcherPriority.Send, (ThreadStart) delegate()
            {
                DataListBox.IsEnabled          = false;
                Button_SaveSong.IsEnabled      = false;
                Image_Album_Previous.IsEnabled = false;
                Image_Album_Next.IsEnabled     = false;
            });
            for (int i = 0; i < SongList.Count; i++)
            {
                AutoDownloading = true;

                //设置进度
                this.Dispatcher.BeginInvoke(DispatcherPriority.Send, (ThreadStart) delegate()
                {
                    DataListBox.SelectedIndex = i;
                    DataListBox.ScrollIntoView(DataListBox.SelectedItem);
                    double d = ((double)(i + 1) / (double)SongList.Count * 100);

                    Label_ProcessBar.Content  = Math.Truncate(d).ToString() + "%";
                    ProcessBar_Download.Value = d;
                });

                while (AutoDownloading)
                {
                    Thread.Sleep(100);
                }

                this.Dispatcher.BeginInvoke(DispatcherPriority.Send, (ThreadStart) delegate()
                {
                    Button_SaveSong_Click(null, null);
                });
            }
            this.Dispatcher.BeginInvoke(DispatcherPriority.Send, (ThreadStart) delegate()
            {
                DataListBox.IsEnabled          = true;
                Button_SaveSong.IsEnabled      = true;
                Image_Album_Previous.IsEnabled = true;
                Image_Album_Next.IsEnabled     = true;
                Sb3.Begin();
            });
        }
 private void GraphicsLayer_MouseLeftButtonDown(object sender, GraphicMouseButtonEventArgs e)
 {
     DataListBox.Focus();
     DataListBox.SelectedItem = e.Graphic;
     DataListBox.ScrollIntoView(DataListBox.SelectedItem);
 }