I have this button from Main window.xaml need to call it from another class i made it just like first answer How to make a control in XAML public in order to be seen in other classes
<Window x:Class="USD.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="MainWindow" Height="450" Width="525">
<Button ToolTip="Answer Call" HorizontalAlignment="Left" VerticalAlignment="Top" Margin="107,82,0,0" x:Name="answerCall" Click="answerCall_Click" Visibility="Hidden" x:FieldModifier="public">
<StackPanel Orientation="Horizontal" >
<Image Width="35" Height="35" Source="Images/unnamed.png" RenderTransformOrigin="4.075,0.607">
</Image>
</StackPanel>
<Button.Template>
<ControlTemplate TargetType="Button">
<Grid>
<ContentPresenter HorizontalAlignment="Center"
VerticalAlignment="Center"/>
</Grid>
</ControlTemplate>
</Button.Template>
</Button>
but when i checked it from any .cs class just like that
MainWindow.answerCall.Visibility.Visible;
give errors