<Window
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" mc:Ignorable="d"
x:Class="Trainning.biding"
x:Name="Window"
Title="biding"
Width="640" Height="480">
<Window.Resources>
<Style x:Key="ListBoxItemStyle1" TargetType="{x:Type ListBoxItem}">
<Setter Property="Background" Value="Transparent"/>
<Setter Property="HorizontalContentAlignment" Value="{Binding HorizontalContentAlignment, RelativeSource={RelativeSource AncestorType={x:Type ItemsControl}}}"/>
<Setter Property="VerticalContentAlignment" Value="{Binding VerticalContentAlignment, RelativeSource={RelativeSource AncestorType={x:Type ItemsControl}}}"/>
<Setter Property="Padding" Value="2,0,0,0"/>
</Style>
</Window.Resources>
<Grid Margin="8,8,0,8" DataContext="{Binding Source={StaticResource kirupaZuneDataSampleDataSource}}">
<ComboBox x:Name="comboBox" Height="48" Margin="99,83,0,0" VerticalAlignment="Top" SelectedIndex="0" HorizontalAlignment="Left" Width="96">
<ComboBoxItem Content="#FF13428D"/>
<ComboBoxItem Content="#00FFFFFF" Background="#00166A13"/>
<ComboBoxItem Content="#FF890E6F" Background="#0005116E"/>
<ComboBoxItem Content="#0005116E" Background="#0009683A"/>
<ComboBoxItem Content="##0009683A"/>
</ComboBox>
<TextBox Margin="99,145,297,0" TextWrapping="Wrap" Text="{Binding SelectedItem, ElementName=comboBox}" Height="41" VerticalAlignment="Top"/>
</Grid>
出力は下の図のようになります
しかし、正確には文字列「#FF13428D」をテキストボックスにバインドする必要があります。
そのために私は何をすべきか...助けてください..