5

What does xmlns:dc mean in C# WPF XAML code? Can't find anything on it. Is it directory context? Domain controller?

Sorry for missing context.

I know xmlns is just xaml name space, but i want to know what dc stands for, like what does it mean?

xmlns:dc="clr-namespace:SomethingHere;assembly=SomethingHere"
  • You're going to need to provide more context. Can you paste the whole XAML, or at least the relevant portion? – rory.ap May 16 '16 at 14:19
  • 3
    http://stackoverflow.com/questions/630468/what-is-xmlns-in-every-wpf-file – Flat Eric May 16 '16 at 14:22
  • 1
    @FlatEric -- Maybe I misinterpreted, but I don't think the question is about `xmlns`, rather about the `dc` namespace itself, no? – rory.ap May 16 '16 at 14:24
  • @roryap: it can be interpreted in both ways, you're right. I hope the author will clarify this – Flat Eric May 16 '16 at 14:29
  • 1
    To me, xmlns:dc sounds like just another namespace alias given to the user created assembly. SInce there is nothing like that in WPF. Perhaps OP is new to WPF and referring some demo app where demo controls (dc?) assembly is referenced in view. – Nikhil Vartak May 16 '16 at 14:30
  • Oh I think it stands for DemoControl –  May 16 '16 at 18:35

3 Answers3

3

"dc" is an arbitrary prefix - it is used to reference the namespace as a short hand way, but can be anything you like.

Here's the explanation by the guy who thought it up: http://www.xml.com/pub/a/1999/01/namespaces.html

JamesDill
  • 1,857
  • 1
  • 18
  • 22
0

dc would just be the namespace of a control you're trying to use, so if you wanted to use a control called ThisControl that was inside the assembly "clr-namespace:SomethingHere;assembly=SomethingHere" you would need to use dc:ThisControl in the xaml.

0

Working with Cytoscape I have found that xmlns:dc refers to XLM Namespace(xlmns) and the Dublin Core(dc) metadata standard:

https://www.dublincore.org/specifications/dublin-core/dcmi-terms/

When exporting xgmml from cytoscape, part of the xml refers to http://purl.org/dc/elements/1.1/ which redirects to the url above.

Example:

<graph id="78" label="TAPBPL" directed="1" cy:documentVersion="3.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:cy="http://www.cytoscape.org" xmlns="http://www.cs.rpi.edu/XGMML">
Rasmus Groth
  • 321
  • 2
  • 7