Version 4.9.0: Reworked MapPanel child arrangement.

This commit is contained in:
ClemensF 2018-05-01 02:31:47 +02:00
parent 5a05e9284a
commit ea2cd438fa
2 changed files with 33 additions and 0 deletions

View file

@ -110,6 +110,31 @@ namespace MapControl
set { SetValue(StrokeMiterLimitProperty, value); }
}
public Binding FontSizeBinding
{
get { return GetBinding(FontSizeProperty, nameof(FontSize)); }
}
public Binding FontFamilyBinding
{
get { return GetBinding(FontFamilyProperty, nameof(FontFamily)); }
}
public Binding FontStyleBinding
{
get { return GetBinding(FontStyleProperty, nameof(FontStyle)); }
}
public Binding FontStretchBinding
{
get { return GetBinding(FontStretchProperty, nameof(FontStretch)); }
}
public Binding FontWeightBinding
{
get { return GetBinding(FontWeightProperty, nameof(FontWeight)); }
}
public Binding ForegroundBinding
{
get { return GetBinding(ForegroundProperty, nameof(Foreground)); }

View file

@ -116,6 +116,14 @@ namespace MapControl
renderTransform.Children.Add(new TranslateTransform());
label = new TextBlock { RenderTransform = renderTransform };
if (FontFamily != null)
{
label.SetBinding(TextBlock.FontFamilyProperty, FontFamilyBinding);
}
label.SetBinding(TextBlock.FontSizeProperty, FontSizeBinding);
label.SetBinding(TextBlock.FontStyleProperty, FontStyleBinding);
label.SetBinding(TextBlock.FontStretchProperty, FontStretchBinding);
label.SetBinding(TextBlock.FontWeightProperty, FontWeightBinding);
label.SetBinding(TextBlock.ForegroundProperty, ForegroundBinding);
Children.Add(label);