Hi CemYedikardes-5780,
Welcome to our Microsoft Q&A platform!
There is no such property or method to set x:Name for Xamarin controls. In essence, x:Name is only used to help the compiler recognize the control.
If you want to identify a control programmatically, you can use the property StyleId. According to documentation:Element.StyleId Property, we know that it can be used to set a user defined value to uniquely identify the element.
for (int i = 0; i < 2; i++)
{
Entry aentry = new Entry
{
StyleId = $"Entry{i}",
};
stack.Children.Add(aentry);
};
Then you can use the following code to get the specified control based on the StyleId.
var theEntry = stack.Children.ToList().Find(item => item.StyleId == "Entry1");
Console.WriteLine((theEntry as Entry).Text);
Regards,
Kyle
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.