如何改善WPF中的UI呈现

时间:2019-06-28 07:01:09

标签: c# wpf

我正在将图像资源用于程序徽标和背景。当我的应用程序页面更改时间时,用户界面不流畅。

我使用了CacheMode的BitmapCache,但是UI并不流畅。

UTC                 | Lane | SaloonCarVehicles | Trucks | MotorCycle
28-06-2019 12:45:20 | 1    | 1                 | 2      | 5
28-06-2019 12:45:20 | 2    | 0                 | 0      | 0
28-06-2019 12:45:20 | 3    | 0                 | 0      | 0

上面的代码是简单的页面转换代码。 https://www.codeproject.com/Articles/1151795/WPF-Transition-of-User-Control

下面的代码是我的xaml文件。

    <Storyboard x:Key="SlideLeft" Completed="SlideLeft_Completed" FillBehavior="Stop" 
                Duration="0:0:1">
        <DoubleAnimation Storyboard.TargetProperty="(RenderTransform).(TranslateTransform.X)" 
                         From="0" 
                         Duration="0:0:1"
                         To="{Binding RelativeSource={RelativeSource FindAncestor, 
                            AncestorType=UserControl, AncestorLevel=1}, 
                            Converter={StaticResource invertDoubleConverter}, Path=ActualWidth}" />
        <DoubleAnimation Storyboard.TargetProperty="(RenderTransform).(TranslateTransform.X)" 
                         Duration="0:0:1"
                         From="{Binding RelativeSource={RelativeSource FindAncestor, 
                         AncestorType=UserControl, AncestorLevel=1}, Path=ActualWidth}" To="0"  />
    </Storyboard>

如何制作流畅的UI动画。

0 个答案:

没有答案