Hello @Nathan Sokalski ,
Welcome to our Microsoft Q&A platform!
but if I set it to true during design time, I receive an error in the designer. T
I created a basic to test the code, it works as expected. After changing the layoutParameter, we need to reset it for the view. Check the code:
private bool isWorked;
public bool IsWorked
{
get { return isWorked; }
set
{
this.isWorked = value;
var layoutParameter = text.LayoutParameters;
layoutParameter.Width = IsWorked ? (int)TypedValue.ApplyDimension(ComplexUnitType.Sp, 125, Application.Context.Resources.DisplayMetrics) : LayoutParams.WrapContent;
text.LayoutParameters = layoutParameter;
}
}
Best Regards,
Jarvan Zhang
If the response is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.