Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Convert XAML to code and vice-versa?
Message
De
09/02/2011 07:17:08
John Baird
Coatesville, Pennsylvanie, États-Unis
 
 
À
08/02/2011 23:31:11
Information générale
Forum:
ASP.NET
Catégorie:
Windows Presentation Foundation (WPF)
Divers
Thread ID:
01498821
Message ID:
01499333
Vues:
61
>>Hi,
>>
>>Does Visual Studio 2010 have a way to convert some existing XAML into C# code? I want to do a few [XAML-related] things via code so that I can make changes at run-time depending upon user privileges. I figure I might save some time writing code if I could just automatically convert the existing XAML into a code snippet.
>>
>>Any ideas?
>>
>>Thanks,
>>Guy
>
>I haven't seen one, and since not all XAML can be properly represented in code I'm not sure you will find one. (Most can, but not all)
>
>You also loose the ability to use a designer and tend to complicate things when you move stuff to code behind. I generally restrict code behind view creation to things that cannot be done in XAML. Which is actually pretty rare.
>
>You might want to check out ContentTemplateSelectors I think that's what you will want for this. (But that's just a guess without seeing your XAML)

I agree... Content selectors are probably the way to go ...
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform