개정판 81e3a60f
issue #1155 : Page Navigation Scroll이 맨 밑으로 이동했을 때 페이지 스크롤이 재설정되는 현상 해결.
Dependency MarkupColorList 속성의 Callback 함수 OnColorListChanged 를 타게 하기 위해 List가 변경됬을 때 리스트 변경을 알려준는 ObservableCollection으로 변경
Change-Id: Ia498c90063e752405055c7053618f11f54b43ae5
IKCOM/Interface.cs | ||
---|---|---|
80 | 80 |
public string markupID { get; set; } |
81 | 81 |
//public Guid markupID { get; set; } |
82 | 82 |
public string DisplayColor { get; set; } |
83 |
|
|
84 |
public int Page { get; set; } |
|
83 | 85 |
} |
84 | 86 |
|
85 | 87 |
|
KCOM/Common/ThumbnailItem.cs | ||
---|---|---|
1 | 1 |
using IKCOM; |
2 | 2 |
using System; |
3 | 3 |
using System.Collections.Generic; |
4 |
using System.Collections.ObjectModel; |
|
5 |
using System.ComponentModel; |
|
4 | 6 |
using System.Linq; |
5 | 7 |
using System.Text; |
6 | 8 |
|
7 | 9 |
namespace KCOM.Common |
8 | 10 |
{ |
9 |
public class ThumbnailItem |
|
11 |
public class ThumbnailItem : INotifyPropertyChanged
|
|
10 | 12 |
{ |
11 | 13 |
public ThumbnailItem() |
12 | 14 |
{ |
13 |
DisplayColorItems = new List<SetColorMarkupItem>();
|
|
15 |
DisplayColorItems = new ObservableCollection<SetColorMarkupItem>();
|
|
14 | 16 |
} |
15 | 17 |
|
16 | 18 |
public Uri ImageUri { get; set; } |
17 | 19 |
|
18 |
public List<SetColorMarkupItem> DisplayColorItems { get; set; } |
|
20 |
private ObservableCollection<SetColorMarkupItem> _DisplayColorItems; |
|
21 |
|
|
22 |
public ObservableCollection<SetColorMarkupItem> DisplayColorItems |
|
23 |
{ |
|
24 |
get { return _DisplayColorItems; } |
|
25 |
set { _DisplayColorItems = value; |
|
26 |
NotifyPropertyChanged("DisplayColorItems"); |
|
27 |
} |
|
28 |
} |
|
29 |
|
|
30 |
|
|
19 | 31 |
public int PageNumber { get; set; } |
20 | 32 |
public int Angle { get; set; } |
21 | 33 |
|
... | ... | |
28 | 40 |
/// 2019.07.03 김태성 추가 |
29 | 41 |
/// </summary> |
30 | 42 |
public Uri PageUri { get; set; } |
43 |
|
|
44 |
public event PropertyChangedEventHandler PropertyChanged; |
|
45 |
|
|
46 |
public void NotifyPropertyChanged(string propertyName) |
|
47 |
{ |
|
48 |
if (PropertyChanged != null) |
|
49 |
{ |
|
50 |
PropertyChanged(this, new PropertyChangedEventArgs(propertyName)); |
|
51 |
} |
|
52 |
} |
|
31 | 53 |
} |
32 | 54 |
|
33 | 55 |
//public class SetColorMarkupItem |
KCOM/Controls/MarkupColorList.xaml.cs | ||
---|---|---|
2 | 2 |
using KCOM.Common; |
3 | 3 |
using System; |
4 | 4 |
using System.Collections.Generic; |
5 |
using System.Collections.ObjectModel; |
|
5 | 6 |
using System.Linq; |
6 | 7 |
using System.Text; |
7 | 8 |
using System.Windows; |
... | ... | |
27 | 28 |
InitializeComponent(); |
28 | 29 |
} |
29 | 30 |
|
30 |
public List<SetColorMarkupItem> ColorList
|
|
31 |
public ObservableCollection<SetColorMarkupItem> ColorList
|
|
31 | 32 |
{ |
32 |
get { return (List<SetColorMarkupItem>)GetValue(ColorListProperty); }
|
|
33 |
get { return (ObservableCollection<SetColorMarkupItem>)GetValue(ColorListProperty); }
|
|
33 | 34 |
set { SetValue(ColorListProperty, value); } |
34 | 35 |
} |
35 | 36 |
|
36 | 37 |
// Using a DependencyProperty as the backing store for MousePosition. This enables animation, styling, binding, etc... |
37 | 38 |
public static readonly DependencyProperty ColorListProperty = |
38 |
DependencyProperty.Register("ColorList", typeof(List<SetColorMarkupItem>), typeof(MarkupColorList), new PropertyMetadata(new PropertyChangedCallback(OnColorListChanged)));
|
|
39 |
DependencyProperty.Register("ColorList", typeof(ObservableCollection<SetColorMarkupItem>), typeof(MarkupColorList), new PropertyMetadata(new PropertyChangedCallback(OnColorListChanged)));
|
|
39 | 40 |
|
40 | 41 |
private static void OnColorListChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) |
41 | 42 |
{ |
KCOM/Controls/Sample.xaml.cs | ||
---|---|---|
424 | 424 |
_delItem.ForEach(f => _UsersCommentPagesList.Remove(f)); |
425 | 425 |
|
426 | 426 |
Logger.sendCheckLog("SetCommentList_UsersCommentPagesMember_PropertyChanged", 1); |
427 |
List<SetColorMarkupItem> setColorMarkupItems = new List<SetColorMarkupItem>(); |
|
428 |
|
|
427 | 429 |
UsersCommentPagesList.ForEach(user => |
428 | 430 |
{ |
429 | 431 |
user.PropertyChanged -= new System.ComponentModel.PropertyChangedEventHandler(user_PropertyChanged); |
... | ... | |
446 | 448 |
var _items = this._thumbnailItems.Where(item => item.PageNumber == page); |
447 | 449 |
|
448 | 450 |
if (_items.Count() > 0) |
449 |
_items.First().DisplayColorItems.Add(new SetColorMarkupItem { DisplayColor = user.SetColor }); |
|
451 |
{ |
|
452 |
setColorMarkupItems.Add(new SetColorMarkupItem { DisplayColor = user.SetColor, markupID = user.MarkupInfoID, Page = page }); |
|
453 |
|
|
454 |
} |
|
455 |
|
|
450 | 456 |
}); |
451 | 457 |
}); |
452 | 458 |
|
453 |
|
|
459 |
foreach (var item in this._thumbnailItems) |
|
460 |
{ |
|
461 |
item.DisplayColorItems = new ObservableCollection<SetColorMarkupItem>(setColorMarkupItems.Where(color => color.Page == item.PageNumber).ToList()); |
|
462 |
} |
|
463 |
|
|
454 | 464 |
Logger.sendCheckLog("SetCommentList_SelectComment.ItemsSource 설정", 1); |
455 | 465 |
var data = _UsersCommentPagesList.OrderByDescending(p => p.isConSolidation == Convert.ToInt32(true)).ToList(); |
456 | 466 |
if (data.Count() != 0) |
... | ... | |
470 | 480 |
{ |
471 | 481 |
this.lstSelectComment.ItemsSource = _UsersCommentPagesList; //섬네일 |
472 | 482 |
} |
473 |
//this.ImgListbox.ItemsSource = null; |
|
474 |
Logger.sendCheckLog("SetCommentList_ImgListbox 설정", 1); |
|
483 |
|
|
484 |
Logger.sendCheckLog("SetComme6ntList_ImgListbox 설정", 1);
|
|
475 | 485 |
|
476 | 486 |
|
477 |
//this.ImgListbox.ItemsSource = this._thumbnailItems; |
|
478 |
var template = this.ImgListbox.ItemTemplate; |
|
479 |
this.ImgListbox.ItemTemplate = null; |
|
480 |
this.ImgListbox.ItemTemplate = template; |
|
487 |
//var template = this.ImgListbox.ItemTemplate; |
|
488 |
//this.ImgListbox.ItemTemplate = null; |
|
489 |
//this.ImgListbox.ItemTemplate = template; |
|
481 | 490 |
|
482 | 491 |
} |
483 | 492 |
|
내보내기 Unified diff