첨부 소스 코드는 나눔고딕코딩 폰트를 사용합니다.
728x90
반응형
728x170

TestProject.zip
0.16MB

▶ ExecutionState.cs

using System;

namespace TestProject
{
    /// <summary>
    /// 실행 상태
    /// </summary>
    [FlagsAttribute]
    public enum ExecutionState : uint
    {
        /// <summary>
        /// ES_AWAYMODE_REQUIRED
        /// </summary>
        ES_AWAYMODE_REQUIRED = 0x00000040,

        /// <summary>
        /// ES_CONTINUOUS
        /// </summary>
        ES_CONTINUOUS = 0x80000000,

        /// <summary>
        /// ES_DISPLAY_REQUIRED
        /// </summary>
        ES_DISPLAY_REQUIRED = 0x00000002,

        /// <summary>
        /// ES_SYSTEM_REQUIRED
        /// </summary>
        ES_SYSTEM_REQUIRED = 0x00000001
    }
}

 

728x90

 

▶ SleepModeHelper.cs

using System.Runtime.InteropServices;

namespace TestProject
{
    /// <summary>
    /// 절전 모드 헬퍼
    /// </summary>
    public static class SleepModeHelper
    {
        //////////////////////////////////////////////////////////////////////////////////////////////////// Import
        ////////////////////////////////////////////////////////////////////////////////////////// Static
        //////////////////////////////////////////////////////////////////////////////// Private

        #region 스레드 실행 상태 설정하기 - SetThreadExecutionState(state)

        /// <summary>
        /// 스레드 실행 상태 설정하기
        /// </summary>
        /// <param name="state">실행 상태</param>
        /// <returns>실행 상태</returns>
        [DllImport("kernel32.dll", CharSet = CharSet.Auto, SetLastError = true)]
        private static extern ExecutionState SetThreadExecutionState(ExecutionState state);

        #endregion

        //////////////////////////////////////////////////////////////////////////////////////////////////// Method
        ////////////////////////////////////////////////////////////////////////////////////////// Static
        //////////////////////////////////////////////////////////////////////////////// Public

        #region 절전 모드 방지하기 - Prevent()

        /// <summary>
        /// 절전 모드 방지하기
        /// </summary>
        public static void Prevent()
        {
            SetThreadExecutionState
            (
                ExecutionState.ES_CONTINUOUS        |
                ExecutionState.ES_SYSTEM_REQUIRED   |
                ExecutionState.ES_AWAYMODE_REQUIRED |
                ExecutionState.ES_DISPLAY_REQUIRED
            );
        }

        #endregion
        #region 절전 모드 허용하기 - Allow()

        /// <summary>
        /// 절전 모드 허용하기
        /// </summary>
        public static void Allow()
        {
            SetThreadExecutionState(ExecutionState.ES_CONTINUOUS);
        }

        #endregion
    }
}

 

반응형

 

▶ MainApplication.xaml

<Application x:Class="TestProject.MainApplication"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    StartupUri="MainWindow.xaml">
    <Application.Resources>
        <ResourceDictionary>
            <ResourceDictionary.MergedDictionaries>
                <ResourceDictionary Source="ClockResourceDictionary.xaml" />
            </ResourceDictionary.MergedDictionaries>
        </ResourceDictionary>
    </Application.Resources>
</Application>

 

300x250

 

▶ MainWindow.xaml

<Window x:Class="TestProject.MainWindow"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    WindowStyle="None"
    Width="420"
    Height="140"
    Topmost="True"
    ResizeMode="CanResizeWithGrip"
    SizeToContent="WidthAndHeight"
    AllowsTransparency="True"
    Opacity="1"
    Visibility="Visible"
    FontFamily="나눔고딕코딩"
    FontSize="16">
    <Window.ContextMenu>
        <ContextMenu HasDropShadow="True">
            <MenuItem Header="그림자">
                <MenuItem Name="shadow0MenuItem" Header="0 포인트" />
                <MenuItem Name="shadow1MenuItem" Header="1 포인트" />
                <MenuItem Name="shadow2MenuItem" Header="2 포인트" />
                <MenuItem Name="shadow3MenuItem" Header="3 포인트" />
                <MenuItem Name="shadow4MenuItem" Header="4 포인트" />
                <MenuItem Name="shadow5MenuItem" Header="5 포인트" />
            </MenuItem>
        </ContextMenu>
    </Window.ContextMenu>
    <Window.Resources>
        <Storyboard x:Key="hour1StoryboardKey"
            RepeatBehavior="Forever">
            <Rotation3DAnimationUsingKeyFrames
                Storyboard.TargetName="hour1ModelVisual3D"
                Storyboard.TargetProperty="(Visual3D.Transform).(Transform3DGroup.Children)[2].(RotateTransform3D.Rotation)"
                BeginTime="00:00:00">
                <SplineRotation3DKeyFrame KeyTime="00:00:00">
                    <SplineRotation3DKeyFrame.Value>
                        <AxisAngleRotation3D
                            Axis="-1.22460635382238E-16 -1 1.22460635382238E-16"
                            Angle="270" />
                    </SplineRotation3DKeyFrame.Value>
                </SplineRotation3DKeyFrame>
                <SplineRotation3DKeyFrame KeyTime="00:00:00.5">
                    <SplineRotation3DKeyFrame.Value>
                        <AxisAngleRotation3D
                            Axis="-1 0 0"
                            Angle="360" />
                    </SplineRotation3DKeyFrame.Value>
                </SplineRotation3DKeyFrame>
                <SplineRotation3DKeyFrame KeyTime="23:59:59.5">
                    <SplineRotation3DKeyFrame.Value>
                        <AxisAngleRotation3D
                            Axis="0 1 0"
                            Angle="0" />
                    </SplineRotation3DKeyFrame.Value>
                </SplineRotation3DKeyFrame>
                <SplineRotation3DKeyFrame KeyTime="23:59:59">
                    <SplineRotation3DKeyFrame.Value>
                        <AxisAngleRotation3D
                            Axis="0 -1 0"
                            Angle="90" />
                    </SplineRotation3DKeyFrame.Value>
                </SplineRotation3DKeyFrame>
            </Rotation3DAnimationUsingKeyFrames>
        </Storyboard>
        <Storyboard x:Key="hour2StoryboardKey"
            RepeatBehavior="Forever">
            <Rotation3DAnimationUsingKeyFrames
                Storyboard.TargetName="hour2ModelVisual3D"
                Storyboard.TargetProperty="(Visual3D.Transform).(Transform3DGroup.Children)[2].(RotateTransform3D.Rotation)"
                BeginTime="00:00:00">
                <SplineRotation3DKeyFrame KeyTime="00:00:00">
                    <SplineRotation3DKeyFrame.Value>
                        <AxisAngleRotation3D
                            Axis="-1.22460635382238E-16 -1 1.22460635382238E-16"
                            Angle="270" />
                    </SplineRotation3DKeyFrame.Value>
                </SplineRotation3DKeyFrame>
                <SplineRotation3DKeyFrame KeyTime="00:00:00.5">
                    <SplineRotation3DKeyFrame.Value>
                        <AxisAngleRotation3D
                            Axis="-1 0 0"
                            Angle="360" />
                    </SplineRotation3DKeyFrame.Value>
                </SplineRotation3DKeyFrame>
                <SplineRotation3DKeyFrame KeyTime="00:59:59.5">
                    <SplineRotation3DKeyFrame.Value>
                        <AxisAngleRotation3D
                            Axis="0 1 0"
                            Angle="0" />
                    </SplineRotation3DKeyFrame.Value>
                </SplineRotation3DKeyFrame>
                <SplineRotation3DKeyFrame KeyTime="10:00:00">
                    <SplineRotation3DKeyFrame.Value>
                        <AxisAngleRotation3D
                            Axis="0 -1 0"
                            Angle="90" />
                    </SplineRotation3DKeyFrame.Value>
                </SplineRotation3DKeyFrame>
            </Rotation3DAnimationUsingKeyFrames>
        </Storyboard>
        <Storyboard x:Key="minute1StoryboardKey"
            RepeatBehavior="Forever">
            <Rotation3DAnimationUsingKeyFrames
                Storyboard.TargetName="minute1ModelVisual3D"
                Storyboard.TargetProperty="(Visual3D.Transform).(Transform3DGroup.Children)[2].(RotateTransform3D.Rotation)"
                BeginTime="00:00:00">
                <SplineRotation3DKeyFrame KeyTime="00:00:00">
                    <SplineRotation3DKeyFrame.Value>
                        <AxisAngleRotation3D
                            Axis="-1.22460635382238E-16 -1 1.22460635382238E-16"
                            Angle="270" />
                    </SplineRotation3DKeyFrame.Value>
                </SplineRotation3DKeyFrame>
                <SplineRotation3DKeyFrame KeyTime="00:00:00.5">
                    <SplineRotation3DKeyFrame.Value>
                        <AxisAngleRotation3D
                            Axis="-1 0 0"
                            Angle="360" />
                    </SplineRotation3DKeyFrame.Value>
                </SplineRotation3DKeyFrame>
                <SplineRotation3DKeyFrame KeyTime="00:09:59.5">
                    <SplineRotation3DKeyFrame.Value>
                        <AxisAngleRotation3D
                            Axis="0 1 0"
                            Angle="0" />
                    </SplineRotation3DKeyFrame.Value>
                </SplineRotation3DKeyFrame>
                <SplineRotation3DKeyFrame KeyTime="01:00:00">
                    <SplineRotation3DKeyFrame.Value>
                        <AxisAngleRotation3D
                            Axis="0 -1 0"
                            Angle="90" />
                    </SplineRotation3DKeyFrame.Value>
                </SplineRotation3DKeyFrame>
            </Rotation3DAnimationUsingKeyFrames>
        </Storyboard>
        <Storyboard x:Key="minute2StoryboardKey">
            <Rotation3DAnimationUsingKeyFrames
                Storyboard.TargetName="minute2ModelVisual3D"
                Storyboard.TargetProperty="(Visual3D.Transform).(Transform3DGroup.Children)[2].(RotateTransform3D.Rotation)"
                BeginTime="00:00:00">
                <SplineRotation3DKeyFrame KeyTime="00:00:00">
                    <SplineRotation3DKeyFrame.Value>
                        <AxisAngleRotation3D
                            Axis="-1.22460635382238E-16 -1 1.22460635382238E-16"
                            Angle="270" />
                    </SplineRotation3DKeyFrame.Value>
                </SplineRotation3DKeyFrame>
                <SplineRotation3DKeyFrame KeyTime="00:00:00.5">
                    <SplineRotation3DKeyFrame.Value>
                        <AxisAngleRotation3D
                            Axis="-1 0 0"
                            Angle="360" />
                    </SplineRotation3DKeyFrame.Value>
                </SplineRotation3DKeyFrame>
                <SplineRotation3DKeyFrame KeyTime="00:00:59.5">
                    <SplineRotation3DKeyFrame.Value>
                        <AxisAngleRotation3D
                            Axis="0 1 0"
                            Angle="0" />
                    </SplineRotation3DKeyFrame.Value>
                </SplineRotation3DKeyFrame>
                <SplineRotation3DKeyFrame KeyTime="00:10:00">
                    <SplineRotation3DKeyFrame.Value>
                        <AxisAngleRotation3D
                            Axis="0 -1 0"
                            Angle="90" />
                    </SplineRotation3DKeyFrame.Value>
                </SplineRotation3DKeyFrame>
            </Rotation3DAnimationUsingKeyFrames>
        </Storyboard>
        <Storyboard x:Key="second1StoryboardKey">
            <Rotation3DAnimationUsingKeyFrames
                Storyboard.TargetName="second1ModelVisual3D"
                Storyboard.TargetProperty="(Visual3D.Transform).(Transform3DGroup.Children)[2].(RotateTransform3D.Rotation)"
                BeginTime="00:00:00">
                <SplineRotation3DKeyFrame KeyTime="00:00:00">
                    <SplineRotation3DKeyFrame.Value>
                        <AxisAngleRotation3D
                            Axis="-1.22460635382238E-16 -1 1.22460635382238E-16"
                            Angle="270" />
                    </SplineRotation3DKeyFrame.Value>
                </SplineRotation3DKeyFrame>
                <SplineRotation3DKeyFrame KeyTime="00:00:00.5">
                    <SplineRotation3DKeyFrame.Value>
                        <AxisAngleRotation3D
                            Axis="-1 0 0"
                            Angle="360" />
                    </SplineRotation3DKeyFrame.Value>
                </SplineRotation3DKeyFrame>
                <SplineRotation3DKeyFrame KeyTime="00:00:09.5">
                    <SplineRotation3DKeyFrame.Value>
                        <AxisAngleRotation3D
                            Axis="0 1 0"
                            Angle="0" />
                    </SplineRotation3DKeyFrame.Value>
                </SplineRotation3DKeyFrame>
                <SplineRotation3DKeyFrame KeyTime="00:00:10">
                    <SplineRotation3DKeyFrame.Value>
                        <AxisAngleRotation3D
                            Axis="0 -1 0"
                            Angle="90" />
                    </SplineRotation3DKeyFrame.Value>
                </SplineRotation3DKeyFrame>
            </Rotation3DAnimationUsingKeyFrames>
        </Storyboard>
        <Storyboard x:Key="second2StoryboardKey">
            <Rotation3DAnimationUsingKeyFrames
                Storyboard.TargetName="second2ModelVisual3D"
                Storyboard.TargetProperty="(Visual3D.Transform).(Transform3DGroup.Children)[2].(RotateTransform3D.Rotation)"
                BeginTime="00:00:00">
                <SplineRotation3DKeyFrame KeyTime="00:00:00">
                    <SplineRotation3DKeyFrame.Value>
                        <AxisAngleRotation3D
                            Axis="-1.22460635382238E-16 -1 1.22460635382238E-16"
                            Angle="270" />
                    </SplineRotation3DKeyFrame.Value>
                </SplineRotation3DKeyFrame>
                <SplineRotation3DKeyFrame KeyTime="00:00:00.2000000">
                    <SplineRotation3DKeyFrame.Value>
                        <AxisAngleRotation3D
                            Axis="-1 0 0"
                            Angle="360" />
                    </SplineRotation3DKeyFrame.Value>
                </SplineRotation3DKeyFrame>
                <SplineRotation3DKeyFrame KeyTime="00:00:00.8000000">
                    <SplineRotation3DKeyFrame.Value>
                        <AxisAngleRotation3D
                            Axis="0 1 0"
                            Angle="0" />
                    </SplineRotation3DKeyFrame.Value>
                </SplineRotation3DKeyFrame>
                <SplineRotation3DKeyFrame KeyTime="00:00:01">
                    <SplineRotation3DKeyFrame.Value>
                        <AxisAngleRotation3D
                            Axis="0 -1 0"
                            Angle="90" />
                    </SplineRotation3DKeyFrame.Value>
                </SplineRotation3DKeyFrame>
            </Rotation3DAnimationUsingKeyFrames>
        </Storyboard>
    </Window.Resources>
    <Grid Name="clockGrid"
        HorizontalAlignment="Left"
        VerticalAlignment="Top"
        Width="390"
        Height="110"
        AllowDrop="True"
        Opacity="1">
        <Viewport3D Name="viewport3D"
            Margin="0"
            ClipToBounds="False"
            RenderTransformOrigin="0.424 0.438">
            <Viewport3D.BitmapEffect>
                <DropShadowBitmapEffect x:Name="dropShadowBitmapEffect"
                    ShadowDepth="15"
                    Softness="0.2" />
            </Viewport3D.BitmapEffect>
            <Viewport3D.Camera>
                <PerspectiveCamera
                    Position="-0.2 1 4.3"
                    UpDirection="0 1 0"
                    FieldOfView="30"
                    LookDirection="0 0 -2.07393971556536"
                    FarPlaneDistance="150"
                    NearPlaneDistance="1.3">
                    <PerspectiveCamera.Transform>
                        <Transform3DGroup>
                            <TranslateTransform3D
                                OffsetX="0"
                                OffsetY="0"
                                OffsetZ="0" />
                            <ScaleTransform3D
                                ScaleX="1"
                                ScaleY="1"
                                ScaleZ="1" />
                            <RotateTransform3D />
                            <TranslateTransform3D
                                OffsetX="0"
                                OffsetY="0"
                                OffsetZ="0" />
                            <TranslateTransform3D
                                OffsetX="0"
                                OffsetY="0"
                                OffsetZ="0" />
                        </Transform3DGroup>
                    </PerspectiveCamera.Transform>
                </PerspectiveCamera>
            </Viewport3D.Camera>
            <ModelVisual3D>
                <ModelVisual3D>
                    <ModelVisual3D.Content>
                        <AmbientLight Color="LightBlue">
                            <AmbientLight.Transform>
                                <Transform3DGroup>
                                    <TranslateTransform3D
                                        OffsetX="0"
                                        OffsetY="0"
                                        OffsetZ="0" />
                                    <ScaleTransform3D
                                        ScaleX="1"
                                        ScaleY="1"
                                        ScaleZ="1" />
                                    <RotateTransform3D />
                                    <TranslateTransform3D
                                        OffsetX="0"
                                        OffsetY="0"
                                        OffsetZ="0" />
                                    <TranslateTransform3D
                                        OffsetX="-0.203"
                                        OffsetY="0"
                                        OffsetZ="0" />
                                </Transform3DGroup>
                            </AmbientLight.Transform>
                        </AmbientLight>
                    </ModelVisual3D.Content>
                </ModelVisual3D>
                <ModelVisual3D>
                    <ModelVisual3D.Transform>
                        <Transform3DGroup>
                            <TranslateTransform3D
                                OffsetX="0"
                                OffsetY="0"
                                OffsetZ="0" />
                            <ScaleTransform3D
                                ScaleX="1"
                                ScaleY="1"
                                ScaleZ="1" />
                            <RotateTransform3D />
                            <TranslateTransform3D
                                OffsetX="0"
                                OffsetY="0"
                                OffsetZ="0" />
                            <TranslateTransform3D
                                OffsetX="-0.216"
                                OffsetY="0"
                                OffsetZ="0" />
                        </Transform3DGroup>
                    </ModelVisual3D.Transform>
                    <ModelVisual3D.Content>
                        <DirectionalLight Color="{DynamicResource DirectionalLightKey}">
                            <DirectionalLight.Transform>
                                <Transform3DGroup>
                                    <TranslateTransform3D
                                        OffsetX="0"
                                        OffsetY="0"
                                        OffsetZ="0" />
                                    <ScaleTransform3D
                                        ScaleX="1"
                                        ScaleY="1"
                                        ScaleZ="1" />
                                    <RotateTransform3D />
                                    <TranslateTransform3D
                                        OffsetX="0"
                                        OffsetY="0"
                                        OffsetZ="0" />
                                    <TranslateTransform3D
                                        OffsetX="-0.152"
                                        OffsetY="2.622"
                                        OffsetZ="0" />
                                </Transform3DGroup>
                            </DirectionalLight.Transform>
                        </DirectionalLight>
                    </ModelVisual3D.Content>
                </ModelVisual3D>
                <ModelVisual3D x:Name="hour1ModelVisual3D">
                    <ModelVisual3D.Transform>
                        <Transform3DGroup>
                            <TranslateTransform3D
                                OffsetX="0"
                                OffsetY="0"
                                OffsetZ="0" />
                            <ScaleTransform3D
                                ScaleX="0.5"
                                ScaleY="0.5"
                                ScaleZ="0.5" />
                            <RotateTransform3D />
                            <TranslateTransform3D
                                OffsetX="0"
                                OffsetY="0"
                                OffsetZ="0" />
                            <TranslateTransform3D
                                OffsetX="-1.168"
                                OffsetY="0.715"
                                OffsetZ="0" />
                        </Transform3DGroup>
                    </ModelVisual3D.Transform>
                    <ModelVisual3D.Content>
                        <GeometryModel3D x:Name="hour1GeometryModel3D"
                            Geometry="{DynamicResource digit0MeshGeometry3DKey}">
                            <GeometryModel3D.Transform>
                                <Transform3DGroup>
                                    <TranslateTransform3D
                                        OffsetX="0"
                                        OffsetY="0"
                                        OffsetZ="0" />
                                    <ScaleTransform3D
                                        ScaleX="1"
                                        ScaleY="1"
                                        ScaleZ="1" />
                                    <RotateTransform3D />
                                    <TranslateTransform3D
                                        OffsetX="0"
                                        OffsetY="0"
                                        OffsetZ="0" />
                                    <TranslateTransform3D
                                        OffsetX="0"
                                        OffsetY="0"
                                        OffsetZ="0" />
                                </Transform3DGroup>
                            </GeometryModel3D.Transform>
                            <GeometryModel3D.Material>
                                <DiffuseMaterial Brush="{DynamicResource DigitLinearGradientBrushKey}" />
                            </GeometryModel3D.Material>
                        </GeometryModel3D>
                    </ModelVisual3D.Content>
                </ModelVisual3D>
            </ModelVisual3D>
            <ModelVisual3D>
                <ModelVisual3D x:Name="hour2ModelVisual3D">
                    <ModelVisual3D.Transform>
                        <Transform3DGroup>
                            <TranslateTransform3D
                                OffsetX="0"
                                OffsetY="0"
                                OffsetZ="0" />
                            <ScaleTransform3D
                                ScaleX="0.5"
                                ScaleY="0.5"
                                ScaleZ="0.5" />
                            <RotateTransform3D />
                            <TranslateTransform3D
                                OffsetX="0"
                                OffsetY="0"
                                OffsetZ="0" />
                            <TranslateTransform3D
                                OffsetX="-0.824"
                                OffsetY="0.716"
                                OffsetZ="0" />
                        </Transform3DGroup>
                    </ModelVisual3D.Transform>
                    <ModelVisual3D.Content>
                        <GeometryModel3D x:Name="hour2GeometryModel3D"
                            Geometry="{DynamicResource digit0MeshGeometry3DKey}">
                            <GeometryModel3D.Transform>
                                <Transform3DGroup>
                                    <TranslateTransform3D
                                        OffsetX="0"
                                        OffsetY="0"
                                        OffsetZ="0" />
                                    <ScaleTransform3D
                                        ScaleX="1"
                                        ScaleY="1"
                                        ScaleZ="1" />
                                    <RotateTransform3D />
                                    <TranslateTransform3D
                                        OffsetX="0"
                                        OffsetY="0"
                                        OffsetZ="0" />
                                    <TranslateTransform3D
                                        OffsetX="0"
                                        OffsetY="0"
                                        OffsetZ="0" />
                                </Transform3DGroup>
                            </GeometryModel3D.Transform>
                            <GeometryModel3D.Material>
                                <DiffuseMaterial Brush="{DynamicResource DigitLinearGradientBrushKey}" />
                            </GeometryModel3D.Material>
                        </GeometryModel3D>
                    </ModelVisual3D.Content>
                </ModelVisual3D>
            </ModelVisual3D>
            <ModelVisual3D>
                <ModelVisual3D x:Name="minute1ModelVisual3D">
                    <ModelVisual3D.Transform>
                        <Transform3DGroup>
                            <TranslateTransform3D
                                OffsetX="0"
                                OffsetY="0"
                                OffsetZ="0" />
                            <ScaleTransform3D
                                ScaleX="0.5"
                                ScaleY="0.5"
                                ScaleZ="0.5" />
                            <RotateTransform3D />
                            <TranslateTransform3D
                                OffsetX="0"
                                OffsetY="0"
                                OffsetZ="0" />
                            <TranslateTransform3D
                                OffsetX="-0.378"
                                OffsetY="0.716"
                                OffsetZ="0" />
                        </Transform3DGroup>
                    </ModelVisual3D.Transform>
                    <ModelVisual3D.Content>
                        <GeometryModel3D x:Name="minute1GeometryModel3D"
                            Geometry="{DynamicResource digit0MeshGeometry3DKey}">
                            <GeometryModel3D.Transform>
                                <Transform3DGroup>
                                    <TranslateTransform3D
                                        OffsetX="0"
                                        OffsetY="0"
                                        OffsetZ="0" />
                                    <ScaleTransform3D
                                        ScaleX="1"
                                        ScaleY="1"
                                        ScaleZ="1" />
                                    <RotateTransform3D />
                                    <TranslateTransform3D
                                        OffsetX="0"
                                        OffsetY="0"
                                        OffsetZ="0" />
                                    <TranslateTransform3D
                                        OffsetX="0"
                                        OffsetY="0"
                                        OffsetZ="0" />
                                </Transform3DGroup>
                            </GeometryModel3D.Transform>
                            <GeometryModel3D.Material>
                                <DiffuseMaterial Brush="{DynamicResource DigitLinearGradientBrushKey}" />
                            </GeometryModel3D.Material>
                        </GeometryModel3D>
                    </ModelVisual3D.Content>
                </ModelVisual3D>
            </ModelVisual3D>
            <ModelVisual3D>
                <ModelVisual3D x:Name="minute2ModelVisual3D">
                    <ModelVisual3D.Transform>
                        <Transform3DGroup>
                            <TranslateTransform3D
                                OffsetX="0"
                                OffsetY="0"
                                OffsetZ="0" />
                            <ScaleTransform3D
                                ScaleX="0.5"
                                ScaleY="0.5"
                                ScaleZ="0.5" />
                            <RotateTransform3D />
                            <TranslateTransform3D
                                OffsetX="0"
                                OffsetY="0"
                                OffsetZ="0" />
                            <TranslateTransform3D
                                OffsetX="-0.038"
                                OffsetY="0.716"
                                OffsetZ="0" />
                        </Transform3DGroup>
                    </ModelVisual3D.Transform>
                    <ModelVisual3D.Content>
                        <GeometryModel3D x:Name="minute2GeometryModel3D"
                            Geometry="{DynamicResource digit0MeshGeometry3DKey}">
                            <GeometryModel3D.Transform>
                                <Transform3DGroup>
                                    <TranslateTransform3D
                                        OffsetX="0"
                                        OffsetY="0"
                                        OffsetZ="0" />
                                    <ScaleTransform3D
                                        ScaleX="1"
                                        ScaleY="1"
                                        ScaleZ="1" />
                                    <RotateTransform3D />
                                    <TranslateTransform3D
                                        OffsetX="0"
                                        OffsetY="0"
                                        OffsetZ="0" />
                                    <TranslateTransform3D
                                        OffsetX="0"
                                        OffsetY="0"
                                        OffsetZ="0" />
                                </Transform3DGroup>
                            </GeometryModel3D.Transform>
                            <GeometryModel3D.Material>
                                <DiffuseMaterial Brush="{DynamicResource DigitLinearGradientBrushKey}" />
                            </GeometryModel3D.Material>
                        </GeometryModel3D>
                    </ModelVisual3D.Content>
                </ModelVisual3D>
            </ModelVisual3D>
            <ModelVisual3D>
                <ModelVisual3D x:Name="second1ModelVisual3D">
                    <ModelVisual3D.Transform>
                        <Transform3DGroup>
                            <TranslateTransform3D
                                OffsetX="0"
                                OffsetY="0"
                                OffsetZ="0" />
                            <ScaleTransform3D
                                ScaleX="0.5"
                                ScaleY="0.5"
                                ScaleZ="0.5" />
                            <RotateTransform3D />
                            <TranslateTransform3D
                                OffsetX="0"
                                OffsetY="0"
                                OffsetZ="0" />
                            <TranslateTransform3D
                                OffsetX="0.412"
                                OffsetY="0.718"
                                OffsetZ="0" />
                        </Transform3DGroup>
                    </ModelVisual3D.Transform>
                    <ModelVisual3D.Content>
                        <GeometryModel3D x:Name="second1GeometryModel3D"
                            Geometry="{DynamicResource digit0MeshGeometry3DKey}">
                            <GeometryModel3D.Transform>
                                <Transform3DGroup>
                                    <TranslateTransform3D
                                        OffsetX="0"
                                        OffsetY="0"
                                        OffsetZ="0" />
                                    <ScaleTransform3D
                                        ScaleX="1"
                                        ScaleY="1"
                                        ScaleZ="1" />
                                    <RotateTransform3D />
                                    <TranslateTransform3D
                                        OffsetX="0"
                                        OffsetY="0"
                                        OffsetZ="0" />
                                    <TranslateTransform3D
                                        OffsetX="0"
                                        OffsetY="0"
                                        OffsetZ="0" />
                                </Transform3DGroup>
                            </GeometryModel3D.Transform>
                            <GeometryModel3D.Material>
                                <DiffuseMaterial Brush="{DynamicResource DigitLinearGradientBrushKey}" />
                            </GeometryModel3D.Material>
                        </GeometryModel3D>
                    </ModelVisual3D.Content>
                </ModelVisual3D>
            </ModelVisual3D>
            <ModelVisual3D>
                <ModelVisual3D x:Name="second2ModelVisual3D">
                    <ModelVisual3D.Transform>
                        <Transform3DGroup>
                            <TranslateTransform3D
                                OffsetX="0"
                                OffsetY="0"
                                OffsetZ="0" />
                            <ScaleTransform3D
                                ScaleX="0.5"
                                ScaleY="0.5"
                                ScaleZ="0.5" />
                            <RotateTransform3D />
                            <TranslateTransform3D
                                OffsetX="0"
                                OffsetY="0"
                                OffsetZ="0" />
                            <TranslateTransform3D
                                OffsetX="0.754"
                                OffsetY="0.718"
                                OffsetZ="0" />
                        </Transform3DGroup>
                    </ModelVisual3D.Transform>
                    <ModelVisual3D.Content>
                        <GeometryModel3D x:Name="second2GeometryModel3D"
                            Geometry="{DynamicResource digit0MeshGeometry3DKey}">
                            <GeometryModel3D.Transform>
                                <Transform3DGroup>
                                    <TranslateTransform3D
                                        OffsetX="0"
                                        OffsetY="0"
                                        OffsetZ="0" />
                                    <ScaleTransform3D
                                        ScaleX="1"
                                        ScaleY="1"
                                        ScaleZ="1" />
                                    <RotateTransform3D />
                                    <TranslateTransform3D
                                        OffsetX="0"
                                        OffsetY="0"
                                        OffsetZ="0" />
                                    <TranslateTransform3D
                                        OffsetX="0"
                                        OffsetY="0"
                                        OffsetZ="0" />
                                </Transform3DGroup>
                            </GeometryModel3D.Transform>
                            <GeometryModel3D.Material>
                                <DiffuseMaterial Brush="{DynamicResource DigitLinearGradientBrushKey}" />
                            </GeometryModel3D.Material>
                        </GeometryModel3D>
                    </ModelVisual3D.Content>
                </ModelVisual3D>
            </ModelVisual3D>
            <ModelVisual3D>
                <ModelVisual3D>
                    <ModelVisual3D.Transform>
                        <Transform3DGroup>
                            <TranslateTransform3D
                                OffsetX="0"
                                OffsetY="0"
                                OffsetZ="0" />
                            <ScaleTransform3D
                                ScaleX="0.5"
                                ScaleY="0.5"
                                ScaleZ="0.5" />
                            <RotateTransform3D />
                            <TranslateTransform3D
                                OffsetX="0"
                                OffsetY="0"
                                OffsetZ="0" />
                            <TranslateTransform3D
                                OffsetX="0.184"
                                OffsetY="0.79"
                                OffsetZ="0" />
                        </Transform3DGroup>
                    </ModelVisual3D.Transform>
                    <ModelVisual3D.Content>
                        <GeometryModel3D
                            Geometry="{DynamicResource ClockSeparatorMeshGeometry3DKey}">
                            <GeometryModel3D.Transform>
                                <Transform3DGroup>
                                    <TranslateTransform3D
                                        OffsetX="0"
                                        OffsetY="0"
                                        OffsetZ="0" />
                                    <ScaleTransform3D
                                        ScaleX="1"
                                        ScaleY="1"
                                        ScaleZ="1" />
                                    <RotateTransform3D />
                                    <TranslateTransform3D
                                        OffsetX="0"
                                        OffsetY="0"
                                        OffsetZ="0" />
                                    <TranslateTransform3D
                                        OffsetX="0"
                                        OffsetY="0"
                                        OffsetZ="0" />
                                </Transform3DGroup>
                            </GeometryModel3D.Transform>
                            <GeometryModel3D.Material>
                                <DiffuseMaterial Brush="{DynamicResource DigitLinearGradientBrushKey}" />
                            </GeometryModel3D.Material>
                        </GeometryModel3D>
                    </ModelVisual3D.Content>
                </ModelVisual3D>
            </ModelVisual3D>
            <ModelVisual3D>
                <ModelVisual3D>
                    <ModelVisual3D.Transform>
                        <Transform3DGroup>
                            <TranslateTransform3D
                                OffsetX="0"
                                OffsetY="0"
                                OffsetZ="0" />
                            <ScaleTransform3D
                                ScaleX="0.5"
                                ScaleY="0.5"
                                ScaleZ="0.5" />
                            <RotateTransform3D />
                            <TranslateTransform3D
                                OffsetX="0"
                                OffsetY="0"
                                OffsetZ="0" />
                            <TranslateTransform3D
                                OffsetX="-0.586"
                                OffsetY="0.79"
                                OffsetZ="0" />
                        </Transform3DGroup>
                    </ModelVisual3D.Transform>
                    <ModelVisual3D.Content>
                        <GeometryModel3D
                            Geometry="{DynamicResource ClockSeparatorMeshGeometry3DKey}">
                            <GeometryModel3D.Transform>
                                <Transform3DGroup>
                                    <TranslateTransform3D
                                        OffsetX="0"
                                        OffsetY="0"
                                        OffsetZ="0" />
                                    <ScaleTransform3D
                                        ScaleX="1"
                                        ScaleY="1"
                                        ScaleZ="1" />
                                    <RotateTransform3D />
                                    <TranslateTransform3D
                                        OffsetX="0"
                                        OffsetY="0"
                                        OffsetZ="0" />
                                    <TranslateTransform3D
                                        OffsetX="0"
                                        OffsetY="0"
                                        OffsetZ="0" />
                                </Transform3DGroup>
                            </GeometryModel3D.Transform>
                            <GeometryModel3D.Material>
                                <DiffuseMaterial Brush="{DynamicResource DigitLinearGradientBrushKey}" />
                            </GeometryModel3D.Material>
                        </GeometryModel3D>
                    </ModelVisual3D.Content>
                </ModelVisual3D>
            </ModelVisual3D>
        </Viewport3D>
        <Button Name="closeButton"
            HorizontalAlignment="Right"
            VerticalAlignment="Top"
            Margin="0"
            Width="20.083"
            Height="20.8"
            BorderThickness="0"
            Opacity="0.5"
            Background="Transparent"
            Foreground="White"
            FontFamily="Times New Roman"
            FontWeight="Bold"
            FontSize="12"
            Content="X"
            Visibility="Hidden" />
    </Grid>
</Window>

 

▶ MainWindow.xaml.cs

using System;
using System.Timers;
using System.Windows;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Media.Media3D;
using System.Windows.Input;
using System.Windows.Threading;

namespace TestProject
{
    /// <summary>
    /// 메인 윈도우
    /// </summary>
	public partial class MainWindow : Window
	{
        //////////////////////////////////////////////////////////////////////////////////////////////////// Field
        ////////////////////////////////////////////////////////////////////////////////////////// Private

        #region Field

        /// <summary>
        /// 배경 브러시
        /// </summary>
        private SolidColorBrush backgroundBrush = new SolidColorBrush(Colors.LightBlue);

        /// <summary>
        /// 닫기 버튼 배경 브러시
        /// </summary>
        private SolidColorBrush closeButtonBackgroundBrush = new SolidColorBrush();

        /// <summary>
        /// 타이머
        /// </summary>
        private Timer timer;

        #endregion

        //////////////////////////////////////////////////////////////////////////////////////////////////// Constructor
        ////////////////////////////////////////////////////////////////////////////////////////// Public

        #region 생성자 - MainWindow()

        /// <summary>
        /// 생성자
        /// </summary>
        public MainWindow()
        {
            InitializeComponent();

            this.backgroundBrush.Opacity = 0;

            Background = this.backgroundBrush;

            #region 타이머를 설정한다.

            this.timer = new Timer();

            this.timer.Interval = 1000;

            this.timer.Elapsed += timer_Elapsed;

            #endregion

            SizeChanged                         += Window_SizeChanged;
            MouseEnter                          += Window_MouseEnter;
            MouseLeave                          += Window_MouseLeave;
            Closed                              += Window_Closed;
            this.closeButton.MouseEnter         += closeButton_MouseEnter;
            this.closeButton.MouseLeave         += closeButton_Mouseleave;
            this.closeButton.Click              += closeButton_Click;
            this.shadow0MenuItem.Click          += shadow0PointMenuitem_Click;
            this.shadow1MenuItem.Click          += shadow1PointMenuitem_Click;
            this.shadow2MenuItem.Click          += shadow2PointMenuitem_Click;
            this.shadow3MenuItem.Click          += shadow3PointMenuitem_Click;
            this.shadow4MenuItem.Click          += shadow4PointMenuitem_Click;
            this.shadow5MenuItem.Click          += shadow5PointMenuitem_Click;
            this.hour1GeometryModel3D.Changed   += hour1GeometryModel3D_Changed;
            this.hour2GeometryModel3D.Changed   += hour2GeometryModel3D_Changed;
            this.minute1GeometryModel3D.Changed += minute1GeometryModel3D_Changed;
            this.minute2GeometryModel3D.Changed += minute2GeometryModel3D_Changed;
            this.second1GeometryModel3D.Changed += second1GeometryModel3D_Changed;
            this.second2GeometryModel3D.Changed += second2GeometryModel3D_Changed;

            this.timer.Start();
        }

        #endregion

        //////////////////////////////////////////////////////////////////////////////////////////////////// Method
        ////////////////////////////////////////////////////////////////////////////////////////// Protected

        #region 마우스 왼쪽 버튼 DOWN 처리하기 - OnMouseLeftButtonDown(e)

        /// <summary>
        /// 마우스 왼쪽 버튼 DOWN 처리하기
        /// </summary>
        /// <param name="e">이벤트 발생자</param>
        protected override void OnMouseLeftButtonDown(MouseButtonEventArgs e)
        {
            base.OnMouseLeftButtonDown(e);

            Cursor = Cursors.Hand;

            DragMove();

            Cursor = Cursors.Arrow;
        }

        #endregion

        ////////////////////////////////////////////////////////////////////////////////////////// Private

        #region 윈도우 크기 변경시 처리하기 - Window_SizeChanged(sender, e)

        /// <summary>
        /// 윈도우 크기 변경시 처리하기
        /// </summary>
        /// <param name="sender">이벤트 발생자</param>
        /// <param name="e">이벤트 인자</param>
        private void Window_SizeChanged(object sender, SizeChangedEventArgs e)
        {
            this.clockGrid.Width  = Width;
            this.clockGrid.Height = 0.9 * Height; 

            this.viewport3D.Width  = Width;
            this.viewport3D.Height = 0.9 * Height;
        }

        #endregion
        #region 윈도우 마우스 진입시 처리하기 - Window_MouseEnter(sender, e)

        /// <summary>
        /// 윈도우 마우스 진입시 처리하기
        /// </summary>
        /// <param name="sender">이벤트 발생자</param>
        /// <param name="e">이벤트 인자</param>
        private void Window_MouseEnter(object sender, MouseEventArgs e)
        {
            this.backgroundBrush.Opacity = 0.55;

            Background = this.backgroundBrush;

            this.closeButton.Visibility = Visibility;
        }

        #endregion
        #region 윈도우 마우스 이탈시 처리하기 - Window_MouseLeave(sender, e)

        /// <summary>
        /// 윈도우 마우스 이탈시 처리하기
        /// </summary>
        /// <param name="sender">이벤트 발생자</param>
        /// <param name="e">이벤트 인자</param>
        private void Window_MouseLeave(object sender, MouseEventArgs e)
        {
            this.backgroundBrush.Opacity = 0;

            Background = this.backgroundBrush;
        }

        #endregion
        #region 윈도우 닫는 경우 처리하기 - Window_Closed(sender, e)

        /// <summary>
        /// 윈도우 닫는 경우 처리하기
        /// </summary>
        /// <param name="sender">이벤트 발생자</param>
        /// <param name="e">이벤트 인자</param>
        private void Window_Closed(object sender, EventArgs e)
        {
            SleepModeHelper.Allow();
        }

        #endregion

        #region 닫기 버튼 마우스 진입시 처리하기 - closeButton_MouseEnter(sender, e)

        /// <summary>
        /// 닫기 버튼 마우스 진입시 처리하기
        /// </summary>
        /// <param name="sender">이벤트 발생자</param>
        /// <param name="e">이벤트 인자</param>
        private void closeButton_MouseEnter(object sender, MouseEventArgs e)
        {
            this.closeButtonBackgroundBrush.Color   = Colors.Red;
            this.closeButtonBackgroundBrush.Opacity = 1;

            this.closeButton.Opacity    = 1;
            this.closeButton.Background = this.closeButtonBackgroundBrush;
        }

        #endregion
        #region 닫기 버튼 마우스 이탈시 처리하기 - closeButton_Mouseleave(sender, e)

        /// <summary>
        /// 닫기 버튼 마우스 이탈시 처리하기
        /// </summary>
        /// <param name="sender">이벤트 발생자</param>
        /// <param name="e">이벤트 인자</param>
        private void closeButton_Mouseleave(object sender, MouseEventArgs e)
        {
            this.closeButtonBackgroundBrush.Color   = Colors.Transparent;
            this.closeButtonBackgroundBrush.Opacity = 0.55;

            this.closeButton.Opacity    = 0.5;
            this.closeButton.Background = this.closeButtonBackgroundBrush;
        }

        #endregion
        #region 닫기 버튼 클릭시 처리하기 - closeButton_Click(sender, e)

        /// <summary>
        /// 닫기 버튼 클릭시 처리하기
        /// </summary>
        /// <param name="sender">이벤트 발생자</param>
        /// <param name="e">이벤트 인자</param>
        private void closeButton_Click(object sender, RoutedEventArgs e)
        {
            Close();
        }

        #endregion

        #region 그림자 0 포인트 메뉴 항목 클릭시 처리하기 - shadow0PointMenuitem_Click(sender, e)

        /// <summary>
        /// 그림자 0 포인트 메뉴 항목 클릭시 처리하기 
        /// </summary>
        /// <param name="sender">이벤트 발생자</param>
        /// <param name="e">이벤트 인자</param>
        private void shadow0PointMenuitem_Click(object sender, RoutedEventArgs e)
        {
            this.dropShadowBitmapEffect.ShadowDepth = 0;
        }

        #endregion
        #region 그림자 1 포인트 메뉴 항목 클릭시 처리하기 - shadow1PointMenuitem_Click(sender, e)

        /// <summary>
        /// 그림자 1 포인트 메뉴 항목 클릭시 처리하기 
        /// </summary>
        /// <param name="sender">이벤트 발생자</param>
        /// <param name="e">이벤트 인자</param>
        private void shadow1PointMenuitem_Click(object sender, RoutedEventArgs e)
        {
            this.dropShadowBitmapEffect.ShadowDepth = 1;
        }

        #endregion
        #region 그림자 2 포인트 메뉴 항목 클릭시 처리하기 - shadow2PointMenuitem_Click(sender, e)

        /// <summary>
        /// 그림자 2 포인트 메뉴 항목 클릭시 처리하기 
        /// </summary>
        /// <param name="sender">이벤트 발생자</param>
        /// <param name="e">이벤트 인자</param>
        private void shadow2PointMenuitem_Click(object sender, RoutedEventArgs e)
        {
            this.dropShadowBitmapEffect.ShadowDepth = 2;
        }

        #endregion
        #region 그림자 3 포인트 메뉴 항목 클릭시 처리하기 - shadow3PointMenuitem_Click(sender, e)

        /// <summary>
        /// 그림자 3 포인트 메뉴 항목 클릭시 처리하기 
        /// </summary>
        /// <param name="sender">이벤트 발생자</param>
        /// <param name="e">이벤트 인자</param>
        private void shadow3PointMenuitem_Click(object sender, RoutedEventArgs e)
        {
            this.dropShadowBitmapEffect.ShadowDepth = 3;
        }

        #endregion
        #region 그림자 4 포인트 메뉴 항목 클릭시 처리하기 - shadow4PointMenuitem_Click(sender, e)

        /// <summary>
        /// 그림자 4 포인트 메뉴 항목 클릭시 처리하기 
        /// </summary>
        /// <param name="sender">이벤트 발생자</param>
        /// <param name="e">이벤트 인자</param>
        private void shadow4PointMenuitem_Click(object sender, RoutedEventArgs e)
        {
            this.dropShadowBitmapEffect.ShadowDepth = 4;
        }

        #endregion
        #region 그림자 5 포인트 메뉴 항목 클릭시 처리하기 - shadow5PointMenuitem_Click(sender, e)

        /// <summary>
        /// 그림자 5 포인트 메뉴 항목 클릭시 처리하기 
        /// </summary>
        /// <param name="sender">이벤트 발생자</param>
        /// <param name="e">이벤트 인자</param>
        private void shadow5PointMenuitem_Click(object sender, RoutedEventArgs e)
        {
            this.dropShadowBitmapEffect.ShadowDepth = 5;
        }

        #endregion

        #region 타이머 경과시 처리하기 - timer_Elapsed(sender, e)

        /// <summary>
        /// 타이머 경과시 처리하기
        /// </summary>
        /// <param name="sender">이벤트 발생자</param>
        /// <param name="e">이벤트 인자</param>
        private void timer_Elapsed(object sender, ElapsedEventArgs e)
        {
            SleepModeHelper.Prevent();

            Dispatcher.Invoke
            (
                DispatcherPriority.Normal,
                (Action)
                (
                    () =>
                    {
                        int hour1   = DateTime.Now.Hour / 10;
                        int hour2   = DateTime.Now.Hour - (DateTime.Now.Hour / 10) * 10;
                        int minute1 = DateTime.Now.Minute / 10;
                        int minute2 = DateTime.Now.Minute - (DateTime.Now.Minute / 10) * 10;
                        int second1 = DateTime.Now.Second / 10;
                        int second2 = DateTime.Now.Second - (DateTime.Now.Second / 10) * 10;

                        switch(hour1)
                        {
                            case 1 : this.hour1GeometryModel3D.Geometry = (Geometry3D)TryFindResource("digit1MeshGeometry3DKey"); break;
                            case 2 : this.hour1GeometryModel3D.Geometry = (Geometry3D)TryFindResource("digit2MeshGeometry3DKey"); break;
                            case 3 : this.hour1GeometryModel3D.Geometry = (Geometry3D)TryFindResource("digit3MeshGeometry3DKey"); break;
                            case 4 : this.hour1GeometryModel3D.Geometry = (Geometry3D)TryFindResource("digit4MeshGeometry3DKey"); break;
                            case 5 : this.hour1GeometryModel3D.Geometry = (Geometry3D)TryFindResource("digit5MeshGeometry3DKey"); break;
                            case 6 : this.hour1GeometryModel3D.Geometry = (Geometry3D)TryFindResource("digit6MeshGeometry3DKey"); break;
                            case 7 : this.hour1GeometryModel3D.Geometry = (Geometry3D)TryFindResource("digit7MeshGeometry3DKey"); break;
                            case 8 : this.hour1GeometryModel3D.Geometry = (Geometry3D)TryFindResource("digit8MeshGeometry3DKey"); break;
                            case 9 : this.hour1GeometryModel3D.Geometry = (Geometry3D)TryFindResource("digit9MeshGeometry3DKey"); break;
                            case 0 : this.hour1GeometryModel3D.Geometry = (Geometry3D)TryFindResource("digit0MeshGeometry3DKey"); break;
                        }

                        switch(hour2)
                        {
                            case 1 : this.hour2GeometryModel3D.Geometry = (Geometry3D)TryFindResource("digit1MeshGeometry3DKey"); break;
                            case 2 : this.hour2GeometryModel3D.Geometry = (Geometry3D)TryFindResource("digit2MeshGeometry3DKey"); break;
                            case 3 : this.hour2GeometryModel3D.Geometry = (Geometry3D)TryFindResource("digit3MeshGeometry3DKey"); break;
                            case 4 : this.hour2GeometryModel3D.Geometry = (Geometry3D)TryFindResource("digit4MeshGeometry3DKey"); break;
                            case 5 : this.hour2GeometryModel3D.Geometry = (Geometry3D)TryFindResource("digit5MeshGeometry3DKey"); break;
                            case 6 : this.hour2GeometryModel3D.Geometry = (Geometry3D)TryFindResource("digit6MeshGeometry3DKey"); break;
                            case 7 : this.hour2GeometryModel3D.Geometry = (Geometry3D)TryFindResource("digit7MeshGeometry3DKey"); break;
                            case 8 : this.hour2GeometryModel3D.Geometry = (Geometry3D)TryFindResource("digit8MeshGeometry3DKey"); break;
                            case 9 : this.hour2GeometryModel3D.Geometry = (Geometry3D)TryFindResource("digit9MeshGeometry3DKey"); break;
                            case 0 : this.hour2GeometryModel3D.Geometry = (Geometry3D)TryFindResource("digit0MeshGeometry3DKey"); break;
                        }

                        switch(minute1)
                        {
                            case 1 : this.minute1GeometryModel3D.Geometry = (Geometry3D)TryFindResource("digit1MeshGeometry3DKey"); break;
                            case 2 : this.minute1GeometryModel3D.Geometry = (Geometry3D)TryFindResource("digit2MeshGeometry3DKey"); break;
                            case 3 : this.minute1GeometryModel3D.Geometry = (Geometry3D)TryFindResource("digit3MeshGeometry3DKey"); break;
                            case 4 : this.minute1GeometryModel3D.Geometry = (Geometry3D)TryFindResource("digit4MeshGeometry3DKey"); break;
                            case 5 : this.minute1GeometryModel3D.Geometry = (Geometry3D)TryFindResource("digit5MeshGeometry3DKey"); break;
                            case 6 : this.minute1GeometryModel3D.Geometry = (Geometry3D)TryFindResource("digit6MeshGeometry3DKey"); break;
                            case 7 : this.minute1GeometryModel3D.Geometry = (Geometry3D)TryFindResource("digit7MeshGeometry3DKey"); break;
                            case 8 : this.minute1GeometryModel3D.Geometry = (Geometry3D)TryFindResource("digit8MeshGeometry3DKey"); break;
                            case 9 : this.minute1GeometryModel3D.Geometry = (Geometry3D)TryFindResource("digit9MeshGeometry3DKey"); break;
                            case 0 : this.minute1GeometryModel3D.Geometry = (Geometry3D)TryFindResource("digit0MeshGeometry3DKey"); break;
                        }

                        switch(minute2)
                        {
                            case 1 : this.minute2GeometryModel3D.Geometry = (Geometry3D)TryFindResource("digit1MeshGeometry3DKey"); break;
                            case 2 : this.minute2GeometryModel3D.Geometry = (Geometry3D)TryFindResource("digit2MeshGeometry3DKey"); break;
                            case 3 : this.minute2GeometryModel3D.Geometry = (Geometry3D)TryFindResource("digit3MeshGeometry3DKey"); break;
                            case 4 : this.minute2GeometryModel3D.Geometry = (Geometry3D)TryFindResource("digit4MeshGeometry3DKey"); break;
                            case 5 : this.minute2GeometryModel3D.Geometry = (Geometry3D)TryFindResource("digit5MeshGeometry3DKey"); break;
                            case 6 : this.minute2GeometryModel3D.Geometry = (Geometry3D)TryFindResource("digit6MeshGeometry3DKey"); break;
                            case 7 : this.minute2GeometryModel3D.Geometry = (Geometry3D)TryFindResource("digit7MeshGeometry3DKey"); break;
                            case 8 : this.minute2GeometryModel3D.Geometry = (Geometry3D)TryFindResource("digit8MeshGeometry3DKey"); break;
                            case 9 : this.minute2GeometryModel3D.Geometry = (Geometry3D)TryFindResource("digit9MeshGeometry3DKey"); break;
                            case 0 : this.minute2GeometryModel3D.Geometry = (Geometry3D)TryFindResource("digit0MeshGeometry3DKey"); break;
                        }

                        switch(second1)
                        {
                            case 1 : this.second1GeometryModel3D.Geometry = (Geometry3D)TryFindResource("digit1MeshGeometry3DKey"); break;
                            case 2 : this.second1GeometryModel3D.Geometry = (Geometry3D)TryFindResource("digit2MeshGeometry3DKey"); break;
                            case 3 : this.second1GeometryModel3D.Geometry = (Geometry3D)TryFindResource("digit3MeshGeometry3DKey"); break;
                            case 4 : this.second1GeometryModel3D.Geometry = (Geometry3D)TryFindResource("digit4MeshGeometry3DKey"); break;
                            case 5 : this.second1GeometryModel3D.Geometry = (Geometry3D)TryFindResource("digit5MeshGeometry3DKey"); break;
                            case 6 : this.second1GeometryModel3D.Geometry = (Geometry3D)TryFindResource("digit6MeshGeometry3DKey"); break;
                            case 7 : this.second1GeometryModel3D.Geometry = (Geometry3D)TryFindResource("digit7MeshGeometry3DKey"); break;
                            case 8 : this.second1GeometryModel3D.Geometry = (Geometry3D)TryFindResource("digit8MeshGeometry3DKey"); break;
                            case 9 : this.second1GeometryModel3D.Geometry = (Geometry3D)TryFindResource("digit9MeshGeometry3DKey"); break;
                            case 0 : this.second1GeometryModel3D.Geometry = (Geometry3D)TryFindResource("digit0MeshGeometry3DKey"); break;
                        }

                        switch(second2)
                        {
                            case 1 : this.second2GeometryModel3D.Geometry = (Geometry3D)TryFindResource("digit1MeshGeometry3DKey"); break;
                            case 2 : this.second2GeometryModel3D.Geometry = (Geometry3D)TryFindResource("digit2MeshGeometry3DKey"); break;
                            case 3 : this.second2GeometryModel3D.Geometry = (Geometry3D)TryFindResource("digit3MeshGeometry3DKey"); break;
                            case 4 : this.second2GeometryModel3D.Geometry = (Geometry3D)TryFindResource("digit4MeshGeometry3DKey"); break;
                            case 5 : this.second2GeometryModel3D.Geometry = (Geometry3D)TryFindResource("digit5MeshGeometry3DKey"); break;
                            case 6 : this.second2GeometryModel3D.Geometry = (Geometry3D)TryFindResource("digit6MeshGeometry3DKey"); break;
                            case 7 : this.second2GeometryModel3D.Geometry = (Geometry3D)TryFindResource("digit7MeshGeometry3DKey"); break;
                            case 8 : this.second2GeometryModel3D.Geometry = (Geometry3D)TryFindResource("digit8MeshGeometry3DKey"); break;
                            case 9 : this.second2GeometryModel3D.Geometry = (Geometry3D)TryFindResource("digit9MeshGeometry3DKey"); break;
                            case 0 : this.second2GeometryModel3D.Geometry = (Geometry3D)TryFindResource("digit0MeshGeometry3DKey"); break;
                        }
                    }
                )
            );
        }

        #endregion

        #region 시 1 지오메트리 모델 3D 변경시 처리하기 - hour1GeometryModel3D_Changed(sender, e)

        /// <summary>
        /// 시 1 지오메트리 모델 3D 변경시 처리하기
        /// </summary>
        /// <param name="sender">이벤트 발생자</param>
        /// <param name="e">이벤트 인자</param>
        private void hour1GeometryModel3D_Changed(object sender, EventArgs e)
        {
            Storyboard storyboard = (Storyboard)TryFindResource("hour1StoryboardKey");

            storyboard.Begin();
        }

        #endregion
        #region 시 2 지오메트리 모델 3D 변경시 처리하기 - hour2GeometryModel3D_Changed(sender, e)

        /// <summary>
        /// 시 2 지오메트리 모델 3D 변경시 처리하기
        /// </summary>
        /// <param name="sender">이벤트 발생자</param>
        /// <param name="e">이벤트 인자</param>
        private void hour2GeometryModel3D_Changed(object sender, EventArgs e)
        {
            Storyboard storyboard = (Storyboard)TryFindResource("hour2StoryboardKey");

            storyboard.Begin();
        }

        #endregion
        #region 분 1 지오메트리 모델 3D 변경시 처리하기 - minute1GeometryModel3D_Changed(sender, e)

        /// <summary>
        /// 분 1 지오메트리 모델 3D 변경시 처리하기
        /// </summary>
        /// <param name="sender">이벤트 발생자</param>
        /// <param name="e">이벤트 인자</param>
        private void minute1GeometryModel3D_Changed(object sender, EventArgs e)
        {
            Storyboard storyboard = (Storyboard)TryFindResource("minute1StoryboardKey");

            storyboard.Begin();
        }

        #endregion
        #region 분 2 지오메트리 모델 3D 변경시 처리하기 - minute2GeometryModel3D_Changed(sender, e)

        /// <summary>
        /// 분 2 지오메트리 모델 3D 변경시 처리하기
        /// </summary>
        /// <param name="sender">이벤트 발생자</param>
        /// <param name="e">이벤트 인자</param>
        private void minute2GeometryModel3D_Changed(object sender, EventArgs e)
        {
            Storyboard storyboard = (Storyboard)TryFindResource("minute2StoryboardKey");

            storyboard.Begin();
        }

        #endregion
        #region 초 1 지오메트리 모델 3D 변경시 처리하기 - second1GeometryModel3D_Changed(sender, e)

        /// <summary>
        /// 초 1 지오메트리 모델 3D 변경시 처리하기
        /// </summary>
        /// <param name="sender">이벤트 발생자</param>
        /// <param name="e">이벤트 인자</param>
        private void second1GeometryModel3D_Changed(object sender, EventArgs e)
        {
            Storyboard storyboard = (Storyboard)TryFindResource("second1StoryboardKey");

            storyboard.Begin();
        }

        #endregion
        #region 초 2 지오메트리 모델 3D 변경시 처리하기 - second2GeometryModel3D_Changed(sender, e)

        /// <summary>
        /// 초 2 지오메트리 모델 3D 변경시 처리하기
        /// </summary>
        /// <param name="sender">이벤트 발생자</param>
        /// <param name="e">이벤트 인자</param>
        private void second2GeometryModel3D_Changed(object sender, EventArgs e)
        {
            Storyboard storyboard = (Storyboard)TryFindResource("second2StoryboardKey");

            storyboard.Begin();
        }

        #endregion
    }
}
728x90
반응형
그리드형(광고전용)
Posted by icodebroker

댓글을 달아 주세요