I'm having a WPF Custom Control
<local:SuperControl>
<local:SuperControl.SBItem>
<MultiBinding StringFormat="{}Name: {0} ({1})">
<Binding Path="Name" />
<Binding Path="ID" />
</MultiBinding>
</local:SuperControl.SBItem>
</local:SuperControl>
The ViewModel Property
public string Name { get; set; }
public string ID { get; set; }
Consider the Value for the Property
Name = "John";
ID = "STK001";
The Custom Control
public class SuperControl : ItemsControl
{
public static readonly DependencyProperty SBItemProperty = DependencyProperty.Register("SBItem", typeof(string), typeof(BAutoComplete), new PropertyMetadata(null));
public string SBItem
{
get { return (string)GetValue(SBItemProperty); }
set { SetValue(SBItemProperty, value); }
}
public override void OnApplyTemplate()
{
string Name = SBItem;
string ID = SBItem;
string StringFormat = SBItem;
}
}
Consider the Piece of Code in the Custom Control
public override void OnApplyTemplate()
{
string Name = SBItem;
string ID = SBItem;
string StringFormat = SBItem;
}
Here I need to get the Value of the Binded Property Name, ID and String Format from the Dependency Property SBItem. Kindly assist me.
SBItemsomehow...?