My method accepts as argument any FrameworkElement. Then it checks if the FrameworkElement is a Label with the condition "if (MyFrameworkElement is Label)". If the condition is true, I want the program to change the FontSize property. But FontSize is not available for a FrameworkElement, I must indicate that it is a Label. How to do it ?
You can make use of the is
operator (Microsoft documentation) described in this article like
if (myFrameworkElement is Label l)
{
l.FontSize = 123;
}