Click here to Skip to main content
Click here to Skip to main content
Add your own
alternative version

Another Screensaver with WPF

, 27 Jan 2012 CDDL
Lessons learnt from writing a screensaver with WPF
<Window x:Class="RZWScreenSaver.AboutRZ"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:tb="http://www.hardcodet.net/taskbar"
    Title="About RZ Screen Saver" Height="300" Width="300" ResizeMode="NoResize" ShowInTaskbar="False">
    <DockPanel>
        <tb:TaskbarIcon Name="trayIcon" IconSource="/RZWScreenSaver;Component/images/tray_icon.ico">
            <tb:TaskbarIcon.ContextMenu>
                <ContextMenu>
                    <MenuItem Header="_About..." Click="onShowAboutWindow" />
                    <MenuItem Header="_Settings..." Click="onShowConfigDialog" />
                    <Separator />
                    <MenuItem Name="showTitleMenu" Header="Show _Title" IsCheckable="True" Click="onToggleShowTitle" />
                    <Separator />
                    <MenuItem Header="Set _1" Tag="0" Click="onSwitchSet"/>
                    <MenuItem Header="Set _2" Tag="1" Click="onSwitchSet"/>
                    <MenuItem Header="Set _3" Tag="2" Click="onSwitchSet"/>
                    <MenuItem Header="Set _4" Tag="3" Click="onSwitchSet"/>
                    <Separator />
                    <MenuItem Header="E_xit" Click="onQuitApplications" />
                </ContextMenu>
            </tb:TaskbarIcon.ContextMenu>
        </tb:TaskbarIcon>
        <Button Click="onHideWindow" DockPanel.Dock="Bottom">Ok</Button>
        <Grid>
            <Image Source="/RZWScreenSaver;component/images/RZ Normal Badge Logo.png" />
            <TextBlock FontSize="16pt" Foreground="Red">Screen Saver by<LineBreak />Ruxo Zheng</TextBlock>
        </Grid>
    </DockPanel>
</Window>

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.

License

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

Share

About the Author

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

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