WPF Trigger for IsSelected in a DataTemplate for ListBox items

You can style your ContentControl such that a trigger fires when its container (the ListBoxItem) becomes selected: <ContentControl x:Name=”designerContent” MinHeight=”100″ Margin=”2,0,2,2″ Content=”{Binding Path=DesignerInstance}” Background=”#FF999898″> <ContentControl.Style> <Style TargetType=”{x:Type ContentControl}”> <Setter Property=”Visibility” Value=”Collapsed”/> <Style.Triggers> <DataTrigger Binding=”{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType={x:Type ListBoxItem}}, Path=IsSelected}” Value=”True”> <Setter Property=”Visibility” Value=”Visible”/> </DataTrigger> </Style.Triggers> </Style> </ContentControl.Style> </ContentControl> Alternatively, I think you can add the … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)