WindowsPhone : RelativeSource Mode=FindAncestor, AncestorType : CannotResolve SymbolAncestorType

后端 未结 1 1820
栀梦
栀梦 2020-12-04 00:24

I\'m templating a listbox. I like to show a path only if the item is selected.

The DataTemplate :


          


        
相关标签:
1条回答
  • 2020-12-04 01:10

    AncestorType is not supported on Windows Phone.

    <DataTemplate x:Key="itplPlayerOfTheDay">
        <Grid>
            ...
            <Grid Width="50" Height="50" HorizontalAlignment="Right" VerticalAlignment="Top" Margin="0,5,5,0">
                <Path Visibility="{Binding ElementName=yourListBoxName, Path=SelectedItem, Converter={StaticResource BooleanToVisibilityConverter}}"  Data="M32.5569,7.54591 C32.3883,13.1553 31.3485,16.9274z" Stretch="Uniform" Stroke="Black" >
                </Path>
            </Grid>
            ...
        </Grid>
    </DataTemplate>  
    

    Make some changes in your BooleanToVisibilityConverter and done!

    0 讨论(0)
提交回复
热议问题