CATextLayer SetupTextLayer() { _textLayer = new CATextLayer { AlignmentMode = CATextLayer.AlignmentCenter, ShadowOpacity = ProgressButtonFloats.TextLayerShadowOpacity.AsResourceFloat(), }; _textLayer.Bind("foregroundColor", _progressButtonLayer, "curForegroundColor", null); _textLayer.Bind("Frame", _progressButtonLayer, "curFrame", null); _textLayer.Bind("string", _progressButtonLayer, "curText", null); _textLayer.Bind("FontSize", _progressButtonLayer, "curFontSize", null); return(_textLayer); }
// public ProgressPieControl() // { // } #endregion #region Overrided members public override void AwakeFromNib() { _pieTimerLayer = new ProgressPieControlLayer(); Layer = SetupLayers(); _progressLayer.Bind("path", _pieTimerLayer, "currentPath", null); _textLayer.Bind("string", _pieTimerLayer, "currentString", null); State = 0; WantsLayer = true; }
CALayer SetupClockFaceLayer() { clockFaceLayer = new CATextLayer() { FontSize = 60, ShadowOpacity = .9f }; clockFaceLayer.Bind("string", clockTimer, "outputString", null); clockFaceLayer.SetFont("Menlo"); // Constrain the text layer in the middle var constraint = CAConstraint.Create(CAConstraintAttribute.MidX, "superlayer", CAConstraintAttribute.MidX); clockFaceLayer.AddConstraint(constraint); constraint = CAConstraint.Create(CAConstraintAttribute.MidY, "superlayer", CAConstraintAttribute.MidY); clockFaceLayer.AddConstraint(constraint); return(clockFaceLayer); }
CALayer SetupClockFaceLayer() { clockFaceLayer = new CATextLayer (){ FontSize = 60, ShadowOpacity = .9f }; clockFaceLayer.Bind ("string", clockTimer, "outputString", null); clockFaceLayer.SetFont ("Menlo-Regular"); // Constrain the text layer in the middle var constraint = CAConstraint.Create (CAConstraintAttribute.MidX, "superlayer", CAConstraintAttribute.MidX); clockFaceLayer.AddConstraint (constraint); constraint = CAConstraint.Create (CAConstraintAttribute.MidY, "superlayer", CAConstraintAttribute.MidY); clockFaceLayer.AddConstraint (constraint); return clockFaceLayer; }