-2
リストビューで選択した項目のデータ型を変更しようとしていますが、私が見つけたものはあまりにも複雑であり、時代遅れです。 動作を使用しようとしましたが、それでも動作しません。これは私がリストビューを選択した項目を変更するUWP
<UserControl.Rescources>
<DataTemplate x:DataType="dt" x:Key="notselected">
<Grid>
<Textblock Text="{Binding Title}" Foreground="White"/>
<Image Source="ms-appx:///Assets/myimage.png"/>
</Grid>
</DataTemplate>
<DataTemplate x:DataType="dt" x:Key="selected">
<Grid>
<Textblock Text="{Binding Title}" Foreground="Black"/>
<Image Source="ms-appx:///Assets/myselectedimage.png"/>
</Grid>
</DataTemplate>
</UserControl.Rescources>
<ListView x:Name="listview" ItemTemplate="{StaticResource TMP1}">
<ListView.ItemContainerStyle>
<StaticResource ResourceKey="ListViewItemStyle1"/>
</ListView.ItemContainerStyle>
後だとちょうど はこれが可能で、選択されている間、それはTMP2に切り替える持つことは何ですか?
おかげで
...
<ListView x:Name="listview" ItemTemplateSelector="{StaticResource TMP1}"
ようになりますが重複する可能性を指し、(https://stackoverflow.com/questions/44249232/uwp-datatemplateselector-selecteditem) –過去1時間の間、そのソリューションについてiveが演奏されていました。 – user1855290