Skip to content

Commit

Permalink
FIX to gif fix xd
Browse files Browse the repository at this point in the history
  • Loading branch information
Haruki1707 committed Feb 9, 2022
1 parent ac154d0 commit c8f1df7
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
2 changes: 1 addition & 1 deletion ValorantCC/SubWindow/ProfilesWindow.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
<TextBox Style="{StaticResource LineTextBox}" Name="SearchCode" MinWidth="128" MaxWidth="128" Background="#FF393B44" Margin="65,25,5,0" Foreground="White" Height="22"/>
<Button Style="{DynamicResource SearchCodeButtonStyle}" Name="btnSearchCode" Content="Search Code" MinWidth="85" Background="#FF393B44" Margin="0,25,5,0" Foreground="White" Cursor="Hand" Click="btnSearchCode_Click" BorderBrush="#FF393B44"/>
</StackPanel>
<Image gif:ImageBehavior.AnimatedSource="../Resources/vtspinner optimized.gif" Width="50" Height="52" Margin="0,155,0,0" x:Name="LoadingPlaceHolder"/>
<Image gif:ImageBehavior.AnimatedSource="../Resources/vtspinner optimized.gif" Width="50" Height="52" Margin="0,155,0,0" x:Name="LoadingPlaceHolder" Visibility="Visible" IsVisibleChanged="LoadingPlaceHolder_IsVisibleChanged"/>
<ScrollViewer VerticalScrollBarVisibility="Auto" HorizontalScrollBarVisibility="Disabled" Margin="0,5,0,0" Height="388" Width="338">

<StackPanel Name="ShareablesContainer" HorizontalAlignment="Center">
Expand Down
9 changes: 8 additions & 1 deletion ValorantCC/SubWindow/ProfilesWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ private async void Border_Loaded(object sender, RoutedEventArgs e)
LoadingPlaceHolder.Visibility = Visibility.Visible;
await InitialFetch();
LoadingPlaceHolder.Visibility = Visibility.Collapsed;
WpfAnimatedGif.ImageBehavior.GetAnimationController(LoadingPlaceHolder).Pause();
await RenderProfiles();
}

Expand Down Expand Up @@ -166,5 +165,13 @@ private void Border_MouseDown(object sender, MouseButtonEventArgs e)
{
if (e.LeftButton == MouseButtonState.Pressed) DragMove();
}

private void LoadingPlaceHolder_IsVisibleChanged(object sender, DependencyPropertyChangedEventArgs e)
{
if (LoadingPlaceHolder.Visibility == Visibility.Visible)
WpfAnimatedGif.ImageBehavior.GetAnimationController(LoadingPlaceHolder)?.Play();
else
WpfAnimatedGif.ImageBehavior.GetAnimationController(LoadingPlaceHolder)?.Pause();
}
}
}

0 comments on commit c8f1df7

Please # to comment.