Skip to content

Instantly share code, notes, and snippets.

@JustinBeckwith
Created February 13, 2013 17:39
Show Gist options
  • Save JustinBeckwith/4946453 to your computer and use it in GitHub Desktop.
Save JustinBeckwith/4946453 to your computer and use it in GitHub Desktop.
snippets
<DataTemplate
x:Key="SnippetItemInGallery">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition
Width="*" />
<ColumnDefinition
Width="Auto" />
</Grid.ColumnDefinitions>
<StackPanel
Orientation="Horizontal"
Grid.Column="0">
<TextBlock
Text="{Binding Path=Name}"
Margin="2,3,2,0"
ToolTip="{Binding Path=Text}" />
</StackPanel>
<Button
x:Name="EditButton"
Visibility="Hidden"
Grid.Column="1"
Command="{Binding Path=EditSnippet}">...</Button>
</Grid>
<DataTemplate.Triggers>
<MultiDataTrigger>
<MultiDataTrigger.Conditions>
<Condition
Binding="{Binding Path=IsMouseOver, RelativeSource={RelativeSource AncestorType=Grid}}"
Value="true" />
<Condition
Binding="{Binding Path=CanEdit}"
Value="true" />
</MultiDataTrigger.Conditions>
<Setter
TargetName="EditButton"
Property="Visibility"
Value="Visible" />
</MultiDataTrigger>
</DataTemplate.Triggers>
</DataTemplate>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment