小编Chr*_*667的帖子

为什么我的WPF翻译动画在完成之前就停止了?

我写了一个WindowExtension,它应该为窗口提供一个简单的Translate动画.但是这个动画总是在它到达目标坐标之前停止.任何人都可以给我一个建议吗?

最好的问候克里斯

   public static class WindowExtensions
   {
      public static void Translate(this Window element, double x, double y, TimeSpan duration)
      {
         NameScope.SetNameScope(element, new NameScope());

         var xAnimation = new DoubleAnimationUsingKeyFrames {Duration = duration};
         xAnimation.KeyFrames.Add(new EasingDoubleKeyFrame(element.Left, KeyTime.FromPercent(0)));
         xAnimation.KeyFrames.Add(new EasingDoubleKeyFrame(x, KeyTime.FromPercent(1)));

         var yAnimation = new DoubleAnimationUsingKeyFrames {Duration = duration};
         yAnimation.KeyFrames.Add(new EasingDoubleKeyFrame(element.Top, KeyTime.FromPercent(0)));
         yAnimation.KeyFrames.Add(new EasingDoubleKeyFrame(y, KeyTime.FromPercent(1)));

         var storyboard = new Storyboard()
         {
            Children = { xAnimation, yAnimation }
         };

         Storyboard.SetTargetProperty(xAnimation, new PropertyPath("(Window.Left)"));
         Storyboard.SetTargetProperty(yAnimation, new PropertyPath("(Window.Top)"));

         storyboard.Duration = duration;
         storyboard.FillBehavior = FillBehavior.Stop;

         storyboard.Completed += (sender, args) …
Run Code Online (Sandbox Code Playgroud)

c# wpf animation storyboard

6
推荐指数
1
解决办法
811
查看次数

更新到Xamarin.Forms 2.2后,Xamarin.Forms汉堡菜单图标消失了

在我将Xamarin.Forms 2.0的Xamarin.Forms项目更新为Xamarin.Forms 2.2后,汉堡图标消失了.

我用谷歌搜索没有运气,有没有人经历过同样的问题?

c# master-detail xamarin.forms hamburger-menu

6
推荐指数
1
解决办法
3368
查看次数

避免使用Resharper按照声明添加区域

我在配置Resharper 7.1.3的"类型成员布局"时遇到了一些麻烦.

我开始使用模板与区域一起使用,并尝试根据我的需要对其进行自定义.

请不要讨论"不使用地区等......"

我的第一个问题是,他目前在代码中为每个字段声明创建一个区域,但当然我希望一个区域具有"静态字段和常量",一个区域具有"字段和常量".

第二个问题是他没有为我的"Constructors"创建一个区域.看来他只接受配置中的前两个"模式"但忽略了其他模式.?!

在这里看到多个地区问题:

太多地区

我的类型成员布局如下所示:

    <?xml version="1.0" encoding="utf-8" ?>

<!--
I. Overall

I.1 Each pattern can have <Match>....</Match> element. For the given type declaration, the pattern with the match, evaluated to 'true' with the largest weight, will be used 
I.2 Each pattern consists of the sequence of <Entry>...</Entry> elements. Type member declarations are distributed between entries
I.3 If pattern has RemoveAllRegions="true" attribute, then all regions will be cleared prior to reordering. Otherwise, only auto-generated regions will be …
Run Code Online (Sandbox Code Playgroud)

c# resharper regions

5
推荐指数
1
解决办法
980
查看次数