示例#1
0
        /// <summary>
        /// Hides/shows interface elements with a fade animation
        /// </summary>
        /// <param name="show"></param>
        internal static async void FadeControlsAsync(bool show, double time = .5)
        {
            /// Might cause unnecessary cpu usage? Need to check
            await mainWindow.Dispatcher.BeginInvoke((Action)(() =>
            {
                if (!Properties.Settings.Default.ShowInterface | Slidetimer.Enabled == true)
                {
                    if (clickArrowRight != null && clickArrowLeft != null && x2 != null)
                    {
                        var fadeTo = show ? 1 : 0;
                        var timespan = TimeSpan.FromSeconds(time);

                        AnimationHelper.Fade(clickArrowLeft, fadeTo, timespan);
                        AnimationHelper.Fade(clickArrowRight, fadeTo, timespan);
                        AnimationHelper.Fade(x2, fadeTo, timespan);
                        AnimationHelper.Fade(minus, fadeTo, timespan);
                    }
                }

                ScrollbarFade(show);
            }));
        }
示例#2
0
        /// <summary>
        /// Shows a black tooltip on screen in a given time
        /// </summary>
        /// <param name="message">The message to display</param>
        /// <param name="center">If centered or on bottom</param>
        /// <param name="time">How long until it fades away</param>
        internal static void ToolTipStyle(object message, bool center, TimeSpan time)
        {
            sexyToolTip.Visibility = Visibility.Visible;

            if (center)
            {
                sexyToolTip.Margin            = new Thickness(0, 0, 0, 0);
                sexyToolTip.VerticalAlignment = VerticalAlignment.Center;
            }
            else
            {
                sexyToolTip.Margin            = new Thickness(0, 0, 0, 15);
                sexyToolTip.VerticalAlignment = VerticalAlignment.Bottom;
            }

            sexyToolTip.SexyToolTipText.Text = message.ToString();
            var anim = new DoubleAnimation(1, TimeSpan.FromSeconds(.5));

            anim.Completed += (s, _) => AnimationHelper.Fade(sexyToolTip, TimeSpan.FromSeconds(1.5), time, 1, 0);

            sexyToolTip.BeginAnimation(UIElement.OpacityProperty, anim);
        }
 internal static void MinButtonMouseButtonDown(object sender, MouseButtonEventArgs e)
 {
     AnimationHelper.PreviewMouseLeftButtonDownColorEvent(mainWindow.MinButtonBrush, false);
 }
 internal static void MinButtonMouseLeave(object sender, MouseEventArgs e)
 {
     AnimationHelper.MouseLeaveColorEvent(0, 0, 0, 0, mainWindow.MinButtonBrush, false);
 }
 // MaxButton
 internal static void MaxButtonMouseOver(object sender, MouseEventArgs e)
 {
     AnimationHelper.MouseEnterColorEvent(0, 0, 0, 0, mainWindow.MaxButtonBrush, false);
 }
 internal static void FunctionMenuButtonButtonMouseButtonDown(object sender, MouseButtonEventArgs e)
 {
     AnimationHelper.PreviewMouseLeftButtonDownColorEvent(mainWindow.QuestionButtonFill1, false);
 }
 internal static void SettingsButtonButtonMouseButtonDown(object sender, MouseButtonEventArgs e)
 {
     AnimationHelper.PreviewMouseLeftButtonDownColorEvent(mainWindow.SettingsButtonFill, false);
 }
 internal static void OpenMenuButtonMouseButtonDown(object sender, MouseButtonEventArgs e)
 {
     AnimationHelper.PreviewMouseLeftButtonDownColorEvent(mainWindow.FolderFill, false);
 }
 internal static void RightButtonMouseButtonDown(object sender, MouseButtonEventArgs e)
 {
     AnimationHelper.PreviewMouseLeftButtonDownColorEvent(mainWindow.RightArrowFill, false);
 }