locked
TextBlock Style does not work in Flyout

    Question

  • Hi,

    if I show this flyout, the style of the TextBlock is not used. The Font is very small.

    I've tried ShowAt, FlyoutBase.ShowAttachedFlyout and directly add the flyout to a Button instead of a resource.

    If I create several TextBlocks the style is correct.

    Any Idea?

    Thank you

     

    <Flyout x:Key="TranslationFlyout" x:Name="TranslationFlyout" Placement="Bottom"> <Grid> <ListView ItemsSource="{Binding Translations}" IsItemClickEnabled="True" ItemClick="ListView_ItemClick" > <DataTemplate> <TextBlock Text="{Binding}" Style="{StaticResource TitleTextBlockStyle}" Margin="5 0 0 0" TextWrapping="WrapWholeWords" /> </DataTemplate> </ListView> </Grid> </Flyout>


    Saturday, March 28, 2015 11:31 AM

Answers

  • Hi Stonemiller,

    Please add this <ListView.ItemTemplate> to your ListView, after that your TextBlock will use the correct style:

    <Flyout x:Key="TranslationFlyout" x:Name="TranslationFlyout" Placement="Bottom">
                <Grid>
                    <ListView ItemsSource="{Binding Translations}" IsItemClickEnabled="True" ItemClick="ListView_ItemClick" >
                        <ListView.ItemTemplate>
    <DataTemplate> <TextBlock Text="{Binding}" Style="{StaticResource TitleTextBlockStyle}" Margin="5 0 0 0" TextWrapping="WrapWholeWords" /> </DataTemplate>
    </ListView.ItemTemplate> </ListView> </Grid> </Flyout>

    Best Regards,
    Amy Peng


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    • Marked as answer by Stonemiller Monday, April 06, 2015 8:25 AM
    Monday, March 30, 2015 10:31 AM
    Moderator

All replies

  • Hi Stonemiller,

    Please add this <ListView.ItemTemplate> to your ListView, after that your TextBlock will use the correct style:

    <Flyout x:Key="TranslationFlyout" x:Name="TranslationFlyout" Placement="Bottom">
                <Grid>
                    <ListView ItemsSource="{Binding Translations}" IsItemClickEnabled="True" ItemClick="ListView_ItemClick" >
                        <ListView.ItemTemplate>
    <DataTemplate> <TextBlock Text="{Binding}" Style="{StaticResource TitleTextBlockStyle}" Margin="5 0 0 0" TextWrapping="WrapWholeWords" /> </DataTemplate>
    </ListView.ItemTemplate> </ListView> </Grid> </Flyout>

    Best Regards,
    Amy Peng


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    • Marked as answer by Stonemiller Monday, April 06, 2015 8:25 AM
    Monday, March 30, 2015 10:31 AM
    Moderator
  • Thank you for your support!
    Monday, April 06, 2015 8:25 AM