protected override void OnTextStyleChanged(EventArgs e) { base.OnTextStyleChanged(e); var styleService = Overlay.Services.GetService <IStyleService>(); var brushResource = Overlay.Theme.GetResource <ColorResource>(TextStyle.Foreground); Foreground = styleService.GetBrushResource(brushResource, brushResource.Shared); textFormat = styleService.GetTextResource(TextStyle); DeviceContext context = Device; context.TextAntialiasMode = TextAntialiasMode.Grayscale; }
protected override void OnInitializing(EventArgs e) { if (TextStyle == null) { ApplyTextStyle(); } if (string.IsNullOrEmpty(Text)) { Text = Name; } var styleService = Overlay.Services.GetService <IStyleService>(); textFormat = styleService.GetTextResource(TextStyle); }