프로젝트

일반

사용자정보

통계
| 브랜치(Branch): | 개정판:

markus / KCOM / Controls / Panorama.xaml.cs @ 787a4489

이력 | 보기 | 이력해설 | 다운로드 (2.37 KB)

1
using KCOM.Common;
2
using System;
3
using System.Collections.Generic;
4
using System.Linq;
5
using System.Text;
6
using System.Windows;
7
using System.Windows.Controls;
8
using System.Windows.Data;
9
using System.Windows.Documents;
10
using System.Windows.Input;
11
using System.Windows.Media;
12
using System.Windows.Media.Imaging;
13
using System.Windows.Navigation;
14
using System.Windows.Shapes;
15

    
16
namespace KCOM.Controls
17
{
18
    /// <summary>
19
    /// Interaction logic for Panorama.xaml
20
    /// </summary>
21
    public partial class Panorama : UserControl
22
    {
23
        private System.Collections.ObjectModel.ObservableCollection<ThumbnailItem> pageList { get; set; }
24
        bool controlKey = false;
25
        public Panorama()
26
        {
27
            InitializeComponent();
28
            this.Loaded += Panorama_Loaded;
29
            tileList.KeyDown += TileList_KeyDown;
30
            tileList.KeyUp += TileList_KeyUp;
31
            tileList.PreviewMouseWheel += tileList_PreviewMouseWheel;
32
        }
33

    
34
        private void TileList_KeyUp(object sender, KeyEventArgs e)
35
        {
36
            if (e.Key == Key.LeftCtrl)
37
            {
38
                controlKey = false;
39
            }
40
        }
41

    
42
        private void TileList_KeyDown(object sender, KeyEventArgs e)
43
        {
44
            if (e.Key == Key.LeftCtrl)
45
            {
46
                controlKey = true;
47
            }
48
        }
49

    
50
        private void Panorama_Loaded(object sender, RoutedEventArgs e)
51
        {
52
            pageList = ViewerDataModel.Instance.SystemMain.dzMainMenu.pageNavigator._thumbnailItems;
53
            tileList.ItemsSource = pageList;
54
            tileList.Focus();
55
        }
56

    
57
        private void Border_MouseLeftButtonDown(object sender, MouseButtonEventArgs e)
58
        {
59
            if (e.ClickCount >=2)
60
            {
61
                ViewerDataModel.Instance.SystemMain.dzMainMenu.pageNavigator.GotoPage(((sender as Border).DataContext as ThumbnailItem).PageNumber);
62
            }
63
            
64
        }
65

    
66
        private void tileList_PreviewMouseWheel(object sender, MouseWheelEventArgs e)
67
        {
68
            if (controlKey)
69
            {
70
                e.Handled = true;
71
                if (e.Delta >=1)
72
                {
73
                    columnsCount.Value += columnsCount.Value*0.3;
74
                }
75
                else
76
                {
77
                    columnsCount.Value -= columnsCount.Value*0.3;
78
                }
79
            }
80
            
81
        }
82
    }
83
}
클립보드 이미지 추가 (최대 크기: 500 MB)