@@ -11,8 +11,8 @@ public TrackerControl()
11
11
{
12
12
InitializeComponent ( ) ;
13
13
14
- Background = new SolidColorBrush ( Color . FromArgb ( "#E0666666 " ) ) ;
15
- LineStroke = new SolidColorBrush ( Color . FromArgb ( "#80FFFFFF " ) ) ;
14
+ Background = new SolidColorBrush ( Color . FromArgb ( "#E0FFFFA0 " ) ) ;
15
+ LineStroke = new SolidColorBrush ( Color . FromArgb ( "#80000000 " ) ) ;
16
16
17
17
ControlTemplate = ( ControlTemplate ) Resources [ "TrackerControlTemplate" ] ;
18
18
IsClippedToBounds = false ;
@@ -21,7 +21,6 @@ public TrackerControl()
21
21
public static Func < View > DefaultTrackerTemplateContentProvider = ( ) =>
22
22
{
23
23
var label = new Label ( ) ;
24
- label . TextColor = Colors . White ;
25
24
label . Margin = 7 ;
26
25
label . LineBreakMode = LineBreakMode . WordWrap ;
27
26
label . SetBinding ( Label . TextProperty , "." ) ;
@@ -82,10 +81,10 @@ public TrackerControl()
82
81
nameof ( CornerRadius ) , typeof ( double ) , typeof ( TrackerControl ) , 0.0 ) ;
83
82
84
83
public static readonly BindableProperty BorderThicknessProperty = BindableProperty . Create (
85
- nameof ( BorderThickness ) , typeof ( int ) , typeof ( TrackerControl ) , 0 ) ;
84
+ nameof ( BorderThickness ) , typeof ( int ) , typeof ( TrackerControl ) , 1 ) ;
86
85
87
86
public static readonly BindableProperty BorderBrushProperty = BindableProperty . Create (
88
- nameof ( BorderBrush ) , typeof ( Brush ) , typeof ( TrackerControl ) , Brush . White ) ;
87
+ nameof ( BorderBrush ) , typeof ( Brush ) , typeof ( TrackerControl ) , Brush . Black ) ;
89
88
90
89
/// <summary>
91
90
/// Identifies the <see cref="Distance" /> dependency property.
@@ -373,11 +372,7 @@ private void UpdatePositionAndBorder()
373
372
374
373
var canvasWidth = parent . Width ;
375
374
var canvasHeight = parent . Height ;
376
- var contentSize = content . DesiredSize ;
377
- if ( contentSize . IsZero )
378
- {
379
- contentSize = content . Measure ( canvasWidth , canvasHeight ) . Request ;
380
- }
375
+ var contentSize = content . Measure ( canvasWidth , canvasHeight ) . Request ;
381
376
382
377
var contentWidth = contentSize . Width ;
383
378
var contentHeight = contentSize . Height ;
@@ -444,7 +439,7 @@ private void UpdatePositionAndBorder()
444
439
445
440
content . Margin = margin ;
446
441
447
- var contentContainerSize = new Size ( contentSize . Width + margin . Left + margin . Right , contentSize . Height + margin . Top + margin . Bottom ) ;
442
+ var contentContainerSize = new Size ( contentSize . Width + margin . HorizontalThickness , contentSize . Height + margin . VerticalThickness ) ;
448
443
449
444
contentContainer . TranslationX = dx * contentContainerSize . Width ;
450
445
contentContainer . TranslationY = dy * contentContainerSize . Height ;
@@ -542,8 +537,6 @@ private Geometry CreatePointerBorderGeometry(
542
537
var m = Distance ;
543
538
margin = new Thickness ( ) ;
544
539
545
- // PathFigureCollectionConverter.ParseStringToPathFigureCollection();
546
-
547
540
if ( ha == HorizontalAlignment . Center && va == VerticalAlignment . Bottom )
548
541
{
549
542
double x0 = 0 ;
@@ -700,6 +693,11 @@ private Geometry CreatePointerBorderGeometry(
700
693
} ;
701
694
}
702
695
696
+ if ( BorderThickness > 0 )
697
+ {
698
+ margin += BorderThickness ;
699
+ }
700
+
703
701
if ( points == null )
704
702
{
705
703
return null ;
0 commit comments