File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1- using System . Windows . Media ;
1+ using System . ComponentModel ;
2+ using System . Runtime . CompilerServices ;
3+ using System . Windows . Media ;
24
35namespace Bloxstrap . Models
46{
5- public class GlyphItem
7+ public class GlyphItem : INotifyPropertyChanged
68 {
7- public Geometry Data { get ; set ; } = null ! ;
8- public SolidColorBrush ColorBrush { get ; set ; } = null ! ;
9+ private Geometry ? _data ;
10+ private SolidColorBrush ? _colorBrush ;
11+
12+ public Geometry ? Data
13+ {
14+ get => _data ;
15+ set
16+ {
17+ if ( Equals ( _data , value ) ) return ;
18+ _data = value ;
19+ OnPropertyChanged ( ) ;
20+ }
21+ }
22+
23+ public SolidColorBrush ? ColorBrush
24+ {
25+ get => _colorBrush ;
26+ set
27+ {
28+ if ( Equals ( _colorBrush , value ) ) return ;
29+ _colorBrush = value ;
30+ OnPropertyChanged ( ) ;
31+ }
32+ }
33+
34+ public event PropertyChangedEventHandler ? PropertyChanged ;
35+
36+ protected virtual void OnPropertyChanged ( [ CallerMemberName ] string ? propertyName = null )
37+ {
38+ PropertyChanged ? . Invoke ( this , new PropertyChangedEventArgs ( propertyName ) ) ;
39+ }
940 }
10- }
41+ }
Original file line number Diff line number Diff line change @@ -634,6 +634,7 @@ private async Task LoadGlyphPreviewsAsync(string fontPath)
634634
635635 var characterCodes = typeface . CharacterToGlyphMap . Keys
636636 . OrderByDescending ( c => c )
637+ . Take ( 80 )
637638 . ToList ( ) ;
638639
639640 var tasks = characterCodes . Select ( async characterCode =>
@@ -700,9 +701,6 @@ private void UpdateGlyphColors()
700701 {
701702 item . ColorBrush = newBrush ;
702703 }
703-
704- var updatedItems = new ObservableCollection < GlyphItem > ( GlyphItems ) ;
705- GlyphItems = updatedItems ;
706704 }
707705
708706 private bool IsValidHexColor ( string hex )
You can’t perform that action at this time.
0 commit comments