프로젝트

일반

사용자정보

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

markus / KCOM / Controls / Panorama.xaml.cs @ 9d5b4bc2

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

1 787a4489 KangIngu
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 9f473fb7 KangIngu
        /// <summary>
58
        /// 정삼각형을 그리기위한 두 포인트를 계산하여 넘겨줌
59
        /// </summary>
60
        /// <author>humkyung</author>
61
        /// <date>2018.04.26</date>
62
        /// <param name="StartP"></param>
63
        /// <param name="EndP"></param>
64
        /// <returns></returns>
65
66
        /// <summary>
67
        /// 
68
        /// </summary>
69
        /// <author>Ingu</author>
70
        /// <date>2018.04.30</date>
71
        /// <Update>이미지 더블 클릭 시 해당 페이지 이동 후 창 파노라마 닫기</Update>
72
        /// <param name="sender"></param>
73
        /// <param name="e"></param>
74 787a4489 KangIngu
        private void Border_MouseLeftButtonDown(object sender, MouseButtonEventArgs e)
75
        {
76
            if (e.ClickCount >=2)
77
            {
78
                ViewerDataModel.Instance.SystemMain.dzMainMenu.pageNavigator.GotoPage(((sender as Border).DataContext as ThumbnailItem).PageNumber);
79 2eac4f76 KangIngu
80 9f473fb7 KangIngu
                Window window = Window.GetWindow(this);
81
                window.Close();
82 787a4489 KangIngu
            }
83
        }
84
85
        private void tileList_PreviewMouseWheel(object sender, MouseWheelEventArgs e)
86
        {
87
            if (controlKey)
88
            {
89
                e.Handled = true;
90
                if (e.Delta >=1)
91
                {
92
                    columnsCount.Value += columnsCount.Value*0.3;
93
                }
94
                else
95
                {
96
                    columnsCount.Value -= columnsCount.Value*0.3;
97
                }
98
            }
99
            
100
        }
101
    }
102
}
클립보드 이미지 추가 (최대 크기: 500 MB)