locked
Run time dependency on http://schemas.microsoft.com/winfx/2006/xaml/presentation RRS feed

  • Question

  • Hi,

    I have a method that returns some Xaml at runtime to create a control template:


    string GetTemplate(string strImage, string strType, string strDetail)
            {
                string strXaml = String.Format(@"
                    <ControlTemplate xmlns=""http://schemas.microsoft.com/winfx/2006/xaml/presentation"">
                        <Grid Width=""145"">
                          	 <Rectangle Fill=""#FFE7E7E7"" Margin=""0"" Stroke=""Black"" RadiusX=""5"" RadiusY=""5"" Width=""145"" Opacity=""0.6""/>
    							<Image Margin=""2,1,0,0"" Source=""{0}.png"" RenderTransformOrigin=""1.66,1.29"" Stretch=""Fill"" HorizontalAlignment=""Left"" Width=""40"" Height=""40""/>
    							<TextBlock Margin=""45,1,0,0"" TextWrapping=""Wrap"" Text=""{1}"" Height=""20"" VerticalAlignment=""Top"" FontWeight=""Bold""/>
                                <TextBlock Margin=""45,16,10,6"" TextWrapping=""Wrap"" Text=""{2}""/>
                        </Grid>
                    </ControlTemplate>", strImage, strType, strDetail);
    
                return strXaml;
            }


    Then used like this: 

    eEventGfx.Symbol.ControlTemplate =
                            XamlReader.Load(GetTemplate("pandemic", "Pandemic", oEvent.Name)) as ControlTemplate;

    What I am wondering - does this create a runtime dependencies on http://schemas.microsoft.com/winfx/2006/xaml/presentation?

    Since my application does not have access to the internet.

    Thank you.

    Mat

    Friday, December 17, 2010 12:45 AM

Answers

  • No, it doesn't in any way create a runtime dependency on internet or over the url. Its just a default namespace declaration interpreted by Xaml parser which is obviously built into Silverlight.

    See http://en.wikipedia.org/wiki/XML_namespace for details about the XML namespace. I have quoted most relevant stuff to your query, below
    "The namespace specification does not require nor suggest that the namespace URI be used to retrieve information; it is simply treated by an XML parser as a string"

    Thursday, December 23, 2010 4:08 AM

All replies

  • No, it doesn't in any way create a runtime dependency on internet or over the url. Its just a default namespace declaration interpreted by Xaml parser which is obviously built into Silverlight.

    See http://en.wikipedia.org/wiki/XML_namespace for details about the XML namespace. I have quoted most relevant stuff to your query, below
    "The namespace specification does not require nor suggest that the namespace URI be used to retrieve information; it is simply treated by an XML parser as a string"

    Thursday, December 23, 2010 4:08 AM
  • Thank you.

    Thursday, December 23, 2010 5:02 PM