Skip to main content
Home Forums Silverlight Programming Visual Studio & Silverlight Development Tools Silverlight .XAML and .XAML.CS communication
4 replies. Latest Post by Maud on November 8, 2009.
(0)
dr d b k...
Member
60 points
113 Posts
11-03-2009 8:04 PM |
How do C# and XAML communicate ? Specifically, what headers from one go in the other ? For example (exemplar gratis): can be referenced in c# as MyExternalName.Content="some text"; or something like that. But sometimes it does not seem to work. What am I (or VS or Expression) missing ? Are all x:Names visible in C# ? How do I make names in c# visible in XAML (for example, dynamically created objects). Finally are Style.xaml files automatically included or referenced in an 'assembly' or do I need to 'link' them in ? In the App.xaml file ? Are they 'included' as headers or just a standard sequence of files ? What is the xaml compiled into ? Java or machine code ? Cheers! dB
meidianto
583 points
124 Posts
11-03-2009 8:48 PM |
by Namespace declaration in the XAML
Maud
Contributor
3286 points
453 Posts
11-06-2009 1:33 AM |
Hi,
You could find clue on xaml root element. There is an attribute "x:Class", this declared which class as its code behind file.
If you don't familiar with silverlight development with managed code, try start here
http://msdn.microsoft.com/en-us/library/cc838218(VS.95).aspx
http://weblogs.asp.net/scottgu/pages/silverlight-tutorial-part-1-creating-quot-hello-world-quot-with-silverlight-2-and-vs-2008.aspx
Thanks,
11-06-2009 2:37 PM |
Dear Maud;
what is the xaml root element ?
what is the sequence of xaml execution, file by file ?
thanks for your pointers, Maud !
I like your icon too.
dB
11-08-2009 9:52 PM |
for example
<UserControl x:Class="SilverlightApplication7.SilverlightControl1" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"> <Grid x:Name="LayoutRoot" Background="White"> <Ellipse Width="100" Height="100" Name="e1"/> </Grid> </UserControl>
The blod part is root element.
For silverlight application starting sequence and code behind mechanism, you may find useful info from this articles
Application Modelhttp://msdn.microsoft.com/en-us/library/cc872869(VS.95).aspx
Silverlight programming Modelhttp://msdn.microsoft.com/en-us/library/cc838215(VS.95).aspx
Code behind and partial classhttp://msdn.microsoft.com/en-us/library/cc221357(VS.95).aspx
ps: glad that you like my avatar, it's called Nezha, pic from Nezha nao hai