mirror of
https://gitee.com/akwkevin/aistudio.-wpf.-diagram
synced 2026-03-06 17:50:51 +08:00
来一个旋转Group
This commit is contained in:
@@ -4,9 +4,41 @@
|
||||
xmlns:viewmodel="clr-namespace:AIStudio.Wpf.DiagramDesigner.Demo.ViewModels">
|
||||
|
||||
<dd:ColorBrushConverter x:Key="ColorBrushConverter" />
|
||||
|
||||
|
||||
<LinearGradientBrush x:Key="SevenColorsBrush" StartPoint="0,0" EndPoint="1,1">
|
||||
<LinearGradientBrush.GradientStops>
|
||||
<GradientStop Color="Red" Offset="0"/>
|
||||
<GradientStop Color="Orange" Offset="0.17"/>
|
||||
<GradientStop Color="Yellow" Offset="0.33"/>
|
||||
<GradientStop Color="Green" Offset="0.5"/>
|
||||
<GradientStop Color="Cyan" Offset="0.67"/>
|
||||
<GradientStop Color="Blue" Offset="0.84"/>
|
||||
<GradientStop Color="Violet" Offset="1.0"/>
|
||||
</LinearGradientBrush.GradientStops>
|
||||
</LinearGradientBrush>
|
||||
|
||||
<DataTemplate DataType="{x:Type viewmodel:CustomDefinedGroupDesignerItemViewModel}">
|
||||
<Grid IsHitTestVisible="False">
|
||||
<Grid.Resources>
|
||||
<Storyboard x:Key="LoadStoryboard">
|
||||
<DoubleAnimation By="360"
|
||||
Duration="00:01:00"
|
||||
RepeatBehavior="Forever"
|
||||
Storyboard.TargetName="PathAnimal"
|
||||
Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[0].(RotateTransform.Angle)">
|
||||
</DoubleAnimation>
|
||||
</Storyboard>
|
||||
</Grid.Resources>
|
||||
<Grid.Triggers>
|
||||
<EventTrigger RoutedEvent="FrameworkElement.Loaded">
|
||||
<!--触发动画-->
|
||||
<BeginStoryboard Storyboard="{StaticResource LoadStoryboard}" />
|
||||
|
||||
<!--一动一静效果更好。-->
|
||||
<!--<BeginStoryboard Storyboard="{StaticResource LoadHeadStoryboardOfSelectedTitle}"/>-->
|
||||
</EventTrigger>
|
||||
</Grid.Triggers>
|
||||
|
||||
<TextBlock Text="{Binding Describe}"
|
||||
Foreground="{Binding FontViewModel.FontColor,Converter={StaticResource ColorBrushConverter}}"
|
||||
FontSize="{Binding FontViewModel.FontSize}"
|
||||
@@ -17,6 +49,24 @@
|
||||
TextDecorations="{Binding FontViewModel.TextDecorations}"
|
||||
HorizontalAlignment="Center"
|
||||
VerticalAlignment="Bottom"></TextBlock>
|
||||
|
||||
<Path x:Name="PathAnimal"
|
||||
Fill="{StaticResource SevenColorsBrush}"
|
||||
HorizontalAlignment="Stretch"
|
||||
VerticalAlignment="Stretch"
|
||||
Opacity="0.5"
|
||||
Data="M49.594037,53.171998L55.055,58.632699C49.563936,63.346123,42.528627,66.286118,34.806998,66.622002L34.806998,58.919186C40.396964,58.598897,45.518216,56.513077,49.594037,53.171998z M16.733999,52.872002C20.707999,56.24965,25.718299,58.434582,31.216998,58.885087L31.216998,66.590996C23.586899,66.111794,16.6663,63.08315,11.276999,58.327782z M58.887636,35.854001L66.590996,35.854001C65.999884,43.687417,62.711817,50.752621,57.642811,56.146L52.186998,50.690121C55.869375,46.697861,58.322525,41.557187,58.887636,35.854001z M0.075000763,35.854001L7.7807102,35.854001C8.327713,41.398285,10.662289,46.40886,14.174,50.354222L8.718214,55.810002C3.8250103,50.45842,0.6556282,43.526017,0.075000763,35.854001z M8.0104389,11.591001L13.473999,17.054528C10.048174,21.231648,7.938839,26.507674,7.7044659,32.263001L0,32.263001C0.24597168,24.374863,3.2109623,17.182128,8.0104389,11.591001z M58.351557,11.258001C63.327,16.89602,66.416988,24.213616,66.666996,32.263001L58.961075,32.263001C58.722868,26.348984,56.490904,20.942763,52.896999,16.713723z M31.216998,0.031000529L31.216998,7.7366715C25.348684,8.2184158,20.04666,10.68454,15.95562,14.458001L10.5,9.002277C15.990719,3.840901,23.214515,0.53362032,31.216998,0.031000529z M34.806998,0C42.904966,0.35419508,50.237211,3.5782064,55.834997,8.6981245L50.377916,14.154001C46.182476,10.419522,40.770797,8.047051,34.806998,7.7032948z"
|
||||
Stretch="Fill"
|
||||
RenderTransformOrigin="0.5,0.5">
|
||||
<Path.RenderTransform>
|
||||
<TransformGroup>
|
||||
<TransformGroup.Children>
|
||||
<RotateTransform Angle="0" />
|
||||
<ScaleTransform ScaleX="1" ScaleY="1" />
|
||||
</TransformGroup.Children>
|
||||
</TransformGroup>
|
||||
</Path.RenderTransform>
|
||||
</Path>
|
||||
</Grid>
|
||||
</DataTemplate>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user