This example is just for learning ...
I have started a project in Visual Studio C#. It is very simple, there is a Phone class which is instantiated in the code behind. I would like to add the GUI using Blend 3.
public class Phone:DependencyObject
{
public string PhoneMake
{
get { return (string)GetValue(PhoneMakeProperty); }
set { SetValue(PhoneMakeProperty, value); }
}
public static readonly DependencyProperty PhoneMakeProperty =
DependencyProperty.Register("PhoneMake", typeof(string), typeof(Phone));
}
The code behind:
public partial class Window1 : Window
{
public Window1()
{
InitializeComponent();
}
private void Window_Loaded(object sender, RoutedEventArgs e)
{
Phone Nokia = new Phone();
Nokia.PhoneMake = "Nokia";
}
}
I now import this project into Blend 3 so I can add a graphic element and bind to the PhoneMake property of the Nokia object.
If I click the Add live data source button I am only given the option to instantiate a new object, I can't see how to select my Nokia object.
How do I set this instantiated object Nokia as a data source?
Should Blend be able to do this or have I got the whole thing wrong?
Using Visual Studio C# Express 2008 and Blend 3.