First of all, please accept Jason's suggestion, take some time to copy your code and format it ptoperly.
According to your code, don't binding Label St BindingContext to Switch Sw, because you binding Label St Text to status, but Switch Sw don't have this property, so please change your code.
<Label
FontSize="Medium"
HorizontalOptions="StartAndExpand"
IsVisible="{Binding Source={x:Reference sw}, Path=IsToggled}"
Text="{Binding status}" />
<Switch
x:Name="sw"
HorizontalOptions="EndAndExpand"
IsToggled="True" />
public partial class Page12 : ContentPage, INotifyPropertyChanged
{
private string _status;
public string status
{
get { return _status; }
set
{
_status = value;
RaisePropertyChanged("status");
}
}
public Page12()
{
InitializeComponent();
status = "this is test";
this.BindingContext = this;
}
public event PropertyChangedEventHandler PropertyChanged;
public void RaisePropertyChanged(string propertyName)
{
PropertyChangedEventHandler handler = PropertyChanged;
if (handler != null)
{
handler(this, new PropertyChangedEventArgs(propertyName));
}
}
}
Note: don't forget to implement INotifyPropertyChanged interface, to notify data changed.
About binding, please take a look:
https://learn.microsoft.com/en-us/xamarin/xamarin-forms/app-fundamentals/data-binding/basic-bindings