Bug Report T558374
Visible to All Users

Templates - It is impossible to iterate through elements in XAML

created 7 years ago (modified 7 years ago)

Hi I have been trying to iterate through a class public properties and generate labels and editors in XAML, I have been using this tutorial
https://documentation.devexpress.com/CodeRushForRoslyn/116555/Extensibility/Custom-Templates-Creation/Iterating-Through-Elements

I have created 2 templates the main template and a child template with multiple expansions, the main template looks like this

XAML
<StackLayout Padding="10,40,10,10"> «ForEach(public property in clipType ,#FormsViewItem#)» «FinalTarget» </StackLayout>

The child template looks like this

XAML
<Label> <Label.FormattedText> <FormattedString> <FormattedString.Spans> <Span Text=" "> <Span.FontFamily> <OnPlatform x:TypeArguments="x:String"> <OnPlatform.iOS>FontAwesome</OnPlatform.iOS> <OnPlatform.Android>fontawesome-webfont.ttf#FontAwesome</OnPlatform.Android> </OnPlatform> </Span.FontFamily> </Span> <Span Text="{i18n:Translate «Class»«?Get(itemName)»}" /> </FormattedString.Spans> </FormattedString> </Label.FormattedText> </Label> <Entry></Entry> «FinalTarget»

Both templates are under XAML language. When I execute the code template, it only expands the main template I don’t know if it executes the child template since, the part that needed to be filled with the foreach is blank.
Is it something broken with the foreach functionality on XAML language, I recreated the same templates under C# language and it executes the foreach correctly so I know is not content of the template but coderush. Is there any way to fix this behavior?

Comments (1)
DevExpress Support Team 7 years ago

    Hi Pedro,
    Thanks for the templates,
    I see the problem and we are working on it. We will notify you when we have any results.

    Answers approved by DevExpress Support

    created 7 years ago

    We have fixed the issue described in this ticket and will include the fix in our next maintenance update. To apply this solution before the official update, request a hotfix by clicking the corresponding link for product versions you require.

    Note: Hotfixes may be unavailable for beta versions and updates that are about to be released.

      Disclaimer: The information provided on DevExpress.com and affiliated web properties (including the DevExpress Support Center) is provided "as is" without warranty of any kind. Developer Express Inc disclaims all warranties, either express or implied, including the warranties of merchantability and fitness for a particular purpose. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.

      Confidential Information: Developer Express Inc does not wish to receive, will not act to procure, nor will it solicit, confidential or proprietary materials and information from you through the DevExpress Support Center or its web properties. Any and all materials or information divulged during chats, email communications, online discussions, Support Center tickets, or made available to Developer Express Inc in any manner will be deemed NOT to be confidential by Developer Express Inc. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.