mirror of
https://github.com/ZuneDev/ZuneModdingHelper.git
synced 2026-07-27 13:12:21 -07:00
Animate About sections
This commit is contained in:
@@ -76,3 +76,41 @@ public class FadeAnimateItemsBehavior : Behavior<ItemsControl>
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public class FadeAnimateItemsPanelBehavior : Behavior<Panel>
|
||||
{
|
||||
public DoubleAnimation Animation { get; set; }
|
||||
public TimeSpan Tick { get; set; }
|
||||
|
||||
protected override void OnAttached()
|
||||
{
|
||||
base.OnAttached();
|
||||
AssociatedObject.Loaded += AssociatedObject_Loaded;
|
||||
}
|
||||
|
||||
void AssociatedObject_Loaded(object sender, RoutedEventArgs e)
|
||||
{
|
||||
var items = AssociatedObject.Children.OfType<UIElement>().PruneNull();
|
||||
|
||||
foreach (var item in items)
|
||||
item.Opacity = 0;
|
||||
|
||||
var enumerator = items.GetEnumerator();
|
||||
if (enumerator.MoveNext())
|
||||
{
|
||||
DispatcherTimer timer = new() { Interval = Tick };
|
||||
timer.Tick += (s, timerE) =>
|
||||
{
|
||||
var item = enumerator.Current;
|
||||
if (item is null) return;
|
||||
|
||||
item.BeginAnimation(UIElement.OpacityProperty, Animation);
|
||||
if (!enumerator.MoveNext())
|
||||
{
|
||||
timer.Stop();
|
||||
}
|
||||
};
|
||||
timer.Start();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,6 +5,8 @@
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:local="clr-namespace:ZuneModdingHelper.Pages"
|
||||
xmlns:zmh="clr-namespace:ZuneModdingHelper"
|
||||
xmlns:b="clr-namespace:ZuneModdingHelper.Behaviors"
|
||||
xmlns:i="http://schemas.microsoft.com/xaml/behaviors"
|
||||
mc:Ignorable="d"
|
||||
d:DesignHeight="350" d:DesignWidth="750"
|
||||
d:Background="White">
|
||||
@@ -43,8 +45,9 @@
|
||||
<Run Text="" FontFamily="{StaticResource ZMHIcons}"/>
|
||||
<Run Text="release notes"/>
|
||||
</Hyperlink><LineBreak/>
|
||||
<LineBreak/>
|
||||
</TextBlock>
|
||||
|
||||
<TextBlock Style="{StaticResource AboutTextBlockStyle}">
|
||||
<Run Text="Community" Style="{StaticResource HeaderTextStyle}"/><LineBreak/>
|
||||
<Hyperlink NavigateUri="https://reddit.com/r/Zune" RequestNavigate="Link_RequestNavigate">
|
||||
<Run Text="" FontFamily="{StaticResource ZMHIcons}"/>
|
||||
@@ -54,8 +57,9 @@
|
||||
<Run Text="" FontFamily="{StaticResource ZMHIcons}"/>
|
||||
<Run Text="join r/zune discord server"/>
|
||||
</Hyperlink><LineBreak/>
|
||||
<LineBreak/>
|
||||
</TextBlock>
|
||||
|
||||
<TextBlock Style="{StaticResource AboutTextBlockStyle}">
|
||||
<Run Text="Development" Style="{StaticResource HeaderTextStyle}"/><LineBreak/>
|
||||
<Run Text="by Joshua "Yoshi" Askharoun." FontWeight="SemiBold"/>
|
||||
<Run Text="Mods included with authors' permission."/><LineBreak/>
|
||||
@@ -75,8 +79,16 @@
|
||||
<Hyperlink NavigateUri="{x:Static zmh:App.DonateUri}" RequestNavigate="Link_RequestNavigate">
|
||||
<Run Text="" FontFamily="{StaticResource ZMHIcons}"/>
|
||||
<Run Text="donate"/>
|
||||
</Hyperlink><LineBreak/>
|
||||
</Hyperlink>
|
||||
</TextBlock>
|
||||
|
||||
<i:Interaction.Behaviors>
|
||||
<b:FadeAnimateItemsPanelBehavior Tick="0:0:0.05">
|
||||
<b:FadeAnimateItemsPanelBehavior.Animation>
|
||||
<DoubleAnimation From="0" To="1" Duration="0:0:0.3"/>
|
||||
</b:FadeAnimateItemsPanelBehavior.Animation>
|
||||
</b:FadeAnimateItemsPanelBehavior>
|
||||
</i:Interaction.Behaviors>
|
||||
</StackPanel>
|
||||
</ScrollViewer>
|
||||
</UserControl>
|
||||
|
||||
Reference in New Issue
Block a user