If I understand well, your _Parent should be the current main page and not one created with the new keyword. If you are sure that the map is inside the root control you can use _Parent = (Mainpage)System.Windows.Application.Current.RootVisual;
Or, more elegant, you can add a 'Map' property to your switch control in order to get the map buddied to your control. In switch.cs add :
#region Map
/// <summary>
/// Gets or sets the map that the switch control is buddied to.
/// </summary>
/// <value>The map.</value>
public ESRI.ArcGIS.Client.Map Map
{
get { return GetValue(MapProperty) as Map; }
set { SetValue(MapProperty, value); }
}
/// /// <summary>
/// Identifies the <see cref="Map"/> dependency property.
/// </summary>
public static readonly DependencyProperty MapProperty =
DependencyProperty.Register("Map", typeof(Map), typeof(Switch),null);
#endregion
In switch.cs, replace all '_Parent.MyMap' by 'Map' In MainPage.xaml, bind the Map property of your Switch control :
<Switch Map={Binding ElementName=MyMap} ...... />