Skip to main content

Microsoft Silverlight

Answered Question Silverlight .XAML and .XAML.CS communication RSS Feed

(0)

dr d b karron
dr d b k...

Member

Member

62 points

119 Posts

Silverlight .XAML and .XAML.CS communication

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

dr d b karron
karron@casi.net
http://www.casi.net/
-----
I will mark your response as an answer after i test it. I have not forgotten your post !
------

meidianto
meidianto

Member

Member

605 points

130 Posts

Re: Silverlight .XAML and .XAML.CS communication

by Namespace declaration in the XAML

Please "Mark as Answer" if this post answers your question.

Ferry Meidianto
www.meidianto.com

Maud
Maud

Contributor

Contributor

3358 points

461 Posts

Answered Question

Re: Silverlight .XAML and .XAML.CS communication

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,

Maud

dr d b karron
dr d b k...

Member

Member

62 points

119 Posts

Re: Re: Silverlight .XAML and .XAML.CS communication

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

 

dr d b karron
karron@casi.net
http://www.casi.net/
-----
I will mark your response as an answer after i test it. I have not forgotten your post !
------

Maud
Maud

Contributor

Contributor

3358 points

461 Posts

Answered Question

Re: Re: Silverlight .XAML and .XAML.CS communication

Hi,

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 Model
http://msdn.microsoft.com/en-us/library/cc872869(VS.95).aspx

Silverlight programming Model
http://msdn.microsoft.com/en-us/library/cc838215(VS.95).aspx

Code behind and partial class
http://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

 

Maud
  • Unanswered Question
  • Answered Question
  • Announcement
Microsoft Communities