Click here to Skip to main content
13,199,026 members (40,840 online)
Click here to Skip to main content


62 bookmarked
Posted 7 Dec 2009

Another Screensaver with WPF

, 27 Jan 2012
Lessons learnt from writing a screensaver with WPF
using System.Windows;
using System.Windows.Media;
using RZWScreenSaver.SlidePages;

namespace RZWScreenSaver{
    public class PageHost : Window{
        public PageHost(){
            Background = Brushes.Black;
            WindowStyle = WindowStyle.None;
            ResizeMode = ResizeMode.NoResize;
            ShowInTaskbar = false;
        public PageHost(IPictureSource source, Rect displayArea) : this(){
            Left = (displayArea.Left);
            Top = (displayArea.Top);
            Width = (displayArea.Width);
            Height = (displayArea.Height);
            pictureSource = source;
        public ISlidePage SlidePage{
            get { return slide; }
                if (slide != null){
                    pictureSource.PictureSetChanged -= slide.OnPictureSetChanged;
                    pictureSource.PictureChanged -= slide.OnShowPicture;
                Content = slide = value;
                pictureSource.PictureChanged += slide.OnShowPicture;
                pictureSource.PictureSetChanged += slide.OnPictureSetChanged;
        public void SendToBottom(){
        protected readonly IPictureSource pictureSource;
        protected ISlidePage slide;

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.


This article, along with any associated source code and files, is licensed under The Common Development and Distribution License (CDDL)


About the Author

Ruxo Zheng
Technical Lead
Thailand Thailand
C/C++ and C# programmer.

You may also be interested in...

Permalink | Advertise | Privacy | Terms of Use | Mobile
Web01 | 2.8.171020.1 | Last Updated 27 Jan 2012
Article Copyright 2009 by Ruxo Zheng
Everything else Copyright © CodeProject, 1999-2017
Layout: fixed | fluid