MyControl.xaml.cs
public string achName
{
get { return (string)this.GetValue(achNameProperty); }
set { this.SetValue(achNameProperty, value); }
}
public static readonly DependencyProperty achNameProperty = DependencyProperty.Register("achName", typeof(string), typeof(MyControl), new PropertyMetadata(null));
MainPage.xaml
<My:MyControl achName="{Binding Name}"/>
name has a value, but it doesn’t seem to get send to the dependendcy (achName) property. How can I fix this?
ViewModel
public string Name { get { return "some random test value"; } }
other bindings to viewmodel do work, so the problem doesn’t lie there.
The only reason i can see is that
BindingtoNameis failing. You can debug your bindings to see if its not failing. Refer to this – Debug Data Bindings