tengo al cuadro de texto de árbol, y yo quiero convertir mi enumeración:Icono de enlace en función de enumeración en WPF Treeview
<TextBlock TextAlignment="Justify" VerticalAlignment="Center" Text="{Binding Path=AcceptationStatusGlobalFlag}" />
public enum AcceptationStatusGlobalFlag
{
NotReady = 0,
Ready = 1,
AcceptedByAdmin=2
}
a los iconos. Habrá 3 iconos, permiten decir ready.jpg, notready.jpg y AcceptedByAdmin.jpg
país y región tiene piscina AcceptationStatusGlobalFlag y en tanto que quieren mostrar esta enumeración/Icono
<TreeView Name="structureTree" SelectedItemChanged="structureTree_SelectedItemChanged" Grid.Row="0" Grid.Column="0" ItemsSource="{Binding}" Height="413" ScrollViewer.VerticalScrollBarVisibility="Visible" ScrollViewer.HorizontalScrollBarVisibility="Visible" Width="Auto" PreviewMouseRightButtonUp="structureTree_PreviewMouseRightButtonUp" FontFamily="Verdana" FontSize="12">
<TreeView.Resources>
<HierarchicalDataTemplate DataType="{x:Type ServiceMy:Country}"
ItemsSource="{Binding Path=ListOfRegions}">
<StackPanel Orientation="Horizontal">
<TextBlock TextAlignment="Justify" VerticalAlignment="Center" Text="{Binding Path=Name}"/>
<TextBlock TextAlignment="Justify" VerticalAlignment="Center" Text=" H:"/>
<TextBlock TextAlignment="Justify" VerticalAlignment="Center" Text="{Binding Path=NumberOfHotels}"/>
<TextBlock TextAlignment="Justify" VerticalAlignment="Center" Text=" "/>
<TextBlock TextAlignment="Justify" VerticalAlignment="Center" Text=" FG:"/>
<TextBlock TextAlignment="Justify" VerticalAlignment="Center" Text="{Binding Path=AcceptationStatusGlobalFlag}" />
<!--<Button Name="BTNAddRegion" Height="20" Content="+" Click="BTNAddRegion_Click"></Button>-->
</StackPanel>
</HierarchicalDataTemplate>
<HierarchicalDataTemplate DataType="{x:Type ServiceMy:Region}"
ItemsSource="{Binding Path=ListOfProvinces}">
<StackPanel Orientation="Horizontal">
<TextBlock TextAlignment="Justify" VerticalAlignment="Center" Text="{Binding Path=Name}"/>
<TextBlock TextAlignment="Justify" VerticalAlignment="Center" Text=" H:"/>
<TextBlock TextAlignment="Justify" VerticalAlignment="Center" Text="{Binding Path=NumberOfHotels}"/>
<TextBlock TextAlignment="Justify" VerticalAlignment="Center" Text=" "/>
<!--<Button Name="BTNAddProvince" Height="20" Content="+" Click="BTNAddProvince_Click"></Button>-->
</StackPanel>
</DataTemplate>
</TreeView.Resources>
</TreeView>
</GroupBox>
</StackPanel>
</Grid>
Para la solución sin convertidor ver: ht tp: //stackoverflow.com/questions/2787725/how-to-display-different-enum-icons-using-xaml-only/41150128#41150128 –