コード例 #1
0
        private void Expander_Expanded(object sender, RoutedEventArgs e)
        {
            ThicknessAnimation borderSettingAnimation = new ThicknessAnimation();

            Thickness wide = new Thickness(0, 0, 0, 0);

            borderSettingAnimation.From = SettingsBorder.Margin;
            borderSettingAnimation.To   = wide;

            borderSettingAnimation.Duration          = TimeSpan.FromSeconds(0.15);
            borderSettingAnimation.DecelerationRatio = 0.5;



            SettingsBorder.BeginAnimation(Border.MarginProperty, borderSettingAnimation);
            if (ChatGrid != null)
            {
                DoubleAnimation borderChatAnimation = new DoubleAnimation();
                double          thin = 0;
                borderChatAnimation.From = ChatGrid.Width;
                borderChatAnimation.To   = thin;

                borderChatAnimation.Duration          = TimeSpan.FromSeconds(0.15);
                borderChatAnimation.DecelerationRatio = 0.5;

                ChatGrid.BeginAnimation(WidthProperty, borderChatAnimation);
            }
        }
コード例 #2
0
        private void Expander_Collapsed(object sender, RoutedEventArgs e)
        {
            ThicknessAnimation borderSettingAnimation = new ThicknessAnimation();
            Thickness          thin = new Thickness(685, 0, 0, 0);

            borderSettingAnimation.From = SettingsBorder.Margin;
            borderSettingAnimation.To   = thin;

            borderSettingAnimation.Duration          = TimeSpan.FromSeconds(0.3);
            borderSettingAnimation.AccelerationRatio = 0.5;

            SettingsBorder.BeginAnimation(Border.MarginProperty, borderSettingAnimation);
            DoubleAnimation borderChatAnimation = new DoubleAnimation();

            double wide = 680;

            borderChatAnimation.From = ChatGrid.Width;
            borderChatAnimation.To   = wide;

            borderChatAnimation.Duration          = TimeSpan.FromSeconds(0.30);
            borderChatAnimation.AccelerationRatio = 0.5;

            ChatGrid.BeginAnimation(Border.WidthProperty, borderChatAnimation);

            //ChatGrid.Width = 670;
            //680
        }
コード例 #3
0
        private void ChatGrid_MouseLeave(object sender, MouseEventArgs e)
        {
            ChatTriggerGrid.Visibility = Visibility.Visible;

            var moveAnimation = new ThicknessAnimation(new Thickness(0, ChatGrid.Margin.Top, -190, 30), TimeSpan.FromSeconds(0.25));

            ChatGrid.BeginAnimation(MarginProperty, moveAnimation);
        }
コード例 #4
0
        private void HideHeader()
        {
            var moveAnimation = new ThicknessAnimation(new Thickness(0, -60, 0, 0), TimeSpan.FromSeconds(0.25));

            HeaderGrid.BeginAnimation(MarginProperty, moveAnimation);
            moveAnimation = new ThicknessAnimation(new Thickness(0, 40, ChatGrid.Margin.Right, 30), TimeSpan.FromSeconds(0.25));
            ChatGrid.BeginAnimation(MarginProperty, moveAnimation);

            var fadeInAnimation = new DoubleAnimation(1, TimeSpan.FromSeconds(0.25));

            TrianglePoly.BeginAnimation(OpacityProperty, fadeInAnimation);
        }