|
<Window
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:ed="http://schemas.microsoft.com/expression/2010/drawing"
xmlns:Custom="http://schemas.microsoft.com/expression/2010/interactivity"
xmlns:ei="http://schemas.microsoft.com/expression/2010/interactions"
xmlns:CaControlTestApp="clr-namespace:CaControlTestApp"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" mc:Ignorable="d"
x:Class="AdornerBehaviorSample.MainWindow"
x:Name="Window"
Title="MainWindow"
Width="640" Height="480">
<Window.Resources>
<!-- Template used in Adorner -->
<DataTemplate x:Key="AdornerDataTemplate">
<Grid>
<StackPanel Orientation="Horizontal" HorizontalAlignment="Left" VerticalAlignment="Top">
<Image Height="32" Width="32" Source="Mail-add.png"/>
<Image Height="32" Source="Paper-pencil.png" Width="32"/>
<Button Style="{DynamicResource SimpleButton}" Width="32" Height="32">
<Image Height="Auto" Source="Exclamation.png" Stretch="Fill"/>
</Button>
</StackPanel>
<TextBlock VerticalAlignment="Bottom"
HorizontalAlignment="Left" Text="{Binding Path=SampleString}"/>
<Image Source="Pencil.png"
VerticalAlignment="Bottom"
HorizontalAlignment="Right"
Width="32" Height="32" />
</Grid>
</DataTemplate>
</Window.Resources>
<!-- Control -->
<Grid x:Name="LayoutRoot">
<AdornerDecorator Width="250" Height="250">
<ed:Arc x:Name="arc" ArcThickness="1" ArcThicknessUnit="Percent"
EndAngle="333" Stretch="None" StartAngle="-257"
Stroke="#FF999292" StrokeThickness="5" RenderTransformOrigin="0.5,0.5">
<ed:Arc.Fill>
<LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
<GradientStop Color="#FFCEFF00" Offset="0"/>
<GradientStop Color="#FFFF8D4A" Offset="0.816"/>
</LinearGradientBrush>
</ed:Arc.Fill>
<Custom:Interaction.Behaviors>
<CaControlTestApp:CaAdornerBehavior AdornerTemplate="{StaticResource AdornerDataTemplate}">
<Custom:Interaction.Triggers>
<Custom:EventTrigger SourceName="arc" EventName="MouseEnter">
<Custom:InvokeCommandAction CommandName="ShowAdornerCommand"/>
</Custom:EventTrigger>
<Custom:EventTrigger SourceName="arc" EventName="MouseLeave">
<Custom:InvokeCommandAction CommandName="HideAdornerCommand"/>
</Custom:EventTrigger>
</Custom:Interaction.Triggers>
</CaControlTestApp:CaAdornerBehavior>
</Custom:Interaction.Behaviors>
</ed:Arc>
</AdornerDecorator>
</Grid>
</Window>
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.
20+ yrs Leading and Developing Microsoft products in the Financial Industry.
My main background is VC++, server and client development.
Currently focused in WPF/XAML, Windows 8 and Windows Azure Server technologies.