public WindowHotkeyDetection() { InitializeComponent(); // set opacity Opacity = 0.0; // create timer _timer = new DispatcherTimer(); _timer.Interval = TimeSpan.FromMilliseconds(Constants.WINDOW_HOTKEY_DETECTED_SHOW_DURATION); _timer.Tick += OnTimerEvent; // create animation _animation = new OpacityAnimation(this, Constants.WINDOW_HOTKEY_DETECTED_FADE_IN_DURATION, Constants.WINDOW_HOTKEY_DETECTED_FADE_OUT_DURATION, AnimationCompleted); }
public WindowInfo(Settings settings) { InitializeComponent(); _settings = settings; // set opacity Opacity = 0.0; // configure timer for auto hiding the window _timer = new DispatcherTimer(); _timer.Interval = TimeSpan.FromMilliseconds(Constants.WINDOW_INFO_SHOW_DURATION); _timer.Tick += OnAutohideTimerEvent; // create info queue _infoQueue = new InfoQueue(); // create animation _animation = new OpacityAnimation(this, Constants.WINDOW_INFO_FADE_IN_DURATION, Constants.WINDOW_INFO_FADE_OUT_DURATION, AnimationCompleted); }