{
public class NinePatchButtonStyle : ButtonStyle
{
- private const string Path = "*Resource*/styles/button/";
- private const string Background = "9patch_fill";
- private const string Frame = "9patch_outline";
- private const string End = ".png";
-
public NinePatchButtonStyle()
{
// To avoid blinking:
private void SetImagesUrl()
{
- int ninePatchSize = (int)Config.PixelsPerUnit;
+ int pixelsPerUnit = (int)Config.PixelsPerUnit;
- NinePatchBackgroundImageUrl = Path + Background + ninePatchSize + End;
+ NinePatchBackgroundImageUrl = $"*Resource*/styles/button/9patch_fill{pixelsPerUnit}.png";
- NinePatchFrameImageUrl = Path + Frame + ninePatchSize + End;
+ NinePatchFrameImageUrl = $"*Resource*/styles/button/9patch_outline{pixelsPerUnit}.png";
}
}
}