<Image Width="22"
Height="22"
Margin="5"
>
<Image.Style>
<Style>
<Style.Triggers>
<DataTrigger Binding="{Binding Path=IsSelected, RelativeSource={RelativeSource Mode=FindAncestor,AncestorType=ListBoxItem}}" Value="true">
<Setter Property="Image.Source" Value="../Images/play2.png"/>
</DataTrigger>
<DataTrigger Binding="{Binding Path=IsSelected, RelativeSource={RelativeSource Mode=FindAncestor,AncestorType=ListBoxItem}}" Value="false">
<Setter Property="Image.Source" Value="../Images/play.png"/>
</DataTrigger>
</Style.Triggers>
</Style>
</Image.Style>
</Image>
public class CurrentContext
{
private CurrentContext()
{
}
private static Lazy<CurrentContext> instance = new Lazy<CurrentContext>(() => new CurrentContext());
public static CurrentContext Instance
{
get { return instance.Value; }
}
public string Text {get;set;}
}
CurrentContext.Instance.Text="тест";