728x90
반응형
728x170
▶ StandardStyle.xaml
<ResourceDictionary
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<!-- 테마에 따라 달라지는 비-브러시 값 -->
<ResourceDictionary.ThemeDictionaries>
<ResourceDictionary x:Key="Default">
<x:String x:Key="BackButtonGlyph"></x:String>
<x:String x:Key="BackButtonSnappedGlyph"></x:String>
</ResourceDictionary>
<ResourceDictionary x:Key="HighContrast">
<x:String x:Key="BackButtonGlyph"></x:String>
<x:String x:Key="BackButtonSnappedGlyph"></x:String>
</ResourceDictionary>
</ResourceDictionary.ThemeDictionaries>
<x:String x:Key="ChevronGlyph"></x:String>
<!-- RichTextBlcok 스타일 -->
<Style x:Key="BasicRichTextStyle" TargetType="RichTextBlock">
<Setter Property="Foreground" Value="{StaticResource ApplicationForegroundThemeBrush}" />
<Setter Property="FontSize" Value="{StaticResource ControlContentThemeFontSize}" />
<Setter Property="FontFamily" Value="{StaticResource ContentControlThemeFontFamily}" />
<Setter Property="TextTrimming" Value="WordEllipsis" />
<Setter Property="TextWrapping" Value="Wrap" />
<Setter Property="Typography.StylisticSet20" Value="True" />
<Setter Property="Typography.DiscretionaryLigatures" Value="True" />
<Setter Property="Typography.CaseSensitiveForms" Value="True" />
</Style>
<Style x:Key="BaselineRichTextStyle" TargetType="RichTextBlock"
BasedOn="{StaticResource BasicRichTextStyle}">
<Setter Property="LineHeight" Value="20" />
<Setter Property="LineStackingStrategy" Value="BlockLineHeight" />
<Setter Property="RenderTransform">
<Setter.Value>
<TranslateTransform X="-1" Y="4" />
</Setter.Value>
</Setter>
</Style>
<Style x:Key="ItemRichTextStyle" TargetType="RichTextBlock"
BasedOn="{StaticResource BaselineRichTextStyle}" />
<Style x:Key="BodyRichTextStyle" TargetType="RichTextBlock"
BasedOn="{StaticResource BaselineRichTextStyle}">
<Setter Property="FontWeight" Value="SemiLight" />
</Style>
<!-- TextBlock 스타일 -->
<Style x:Key="BasicTextStyle" TargetType="TextBlock">
<Setter Property="Foreground" Value="{StaticResource ApplicationForegroundThemeBrush}" />
<Setter Property="FontSize" Value="{StaticResource ControlContentThemeFontSize}" />
<Setter Property="FontFamily" Value="{StaticResource ContentControlThemeFontFamily}" />
<Setter Property="TextTrimming" Value="WordEllipsis" />
<Setter Property="TextWrapping" Value="Wrap" />
<Setter Property="Typography.StylisticSet20" Value="True" />
<Setter Property="Typography.DiscretionaryLigatures" Value="True" />
<Setter Property="Typography.CaseSensitiveForms" Value="True" />
</Style>
<Style x:Key="BaselineTextStyle" TargetType="TextBlock"
BasedOn="{StaticResource BasicTextStyle}">
<Setter Property="LineHeight" Value="20" />
<Setter Property="LineStackingStrategy" Value="BlockLineHeight" />
<Setter Property="RenderTransform">
<Setter.Value>
<TranslateTransform X="-1" Y="4" />
</Setter.Value>
</Setter>
</Style>
<Style x:Key="HeaderTextStyle" TargetType="TextBlock"
BasedOn="{StaticResource BaselineTextStyle}">
<Setter Property="FontSize" Value="56" />
<Setter Property="FontWeight" Value="Light" />
<Setter Property="LineHeight" Value="40" />
<Setter Property="RenderTransform">
<Setter.Value>
<TranslateTransform X="-2" Y="8" />
</Setter.Value>
</Setter>
</Style>
<Style x:Key="SubheaderTextStyle" TargetType="TextBlock"
BasedOn="{StaticResource BaselineTextStyle}">
<Setter Property="FontSize" Value="26.667" />
<Setter Property="FontWeight" Value="Light" />
<Setter Property="LineHeight" Value="30" />
<Setter Property="RenderTransform">
<Setter.Value>
<TranslateTransform X="-1" Y="6" />
</Setter.Value>
</Setter>
</Style>
<Style x:Key="TitleTextStyle" TargetType="TextBlock"
BasedOn="{StaticResource BaselineTextStyle}">
<Setter Property="FontWeight" Value="SemiBold" />
</Style>
<Style x:Key="SubtitleTextStyle" TargetType="TextBlock"
BasedOn="{StaticResource BaselineTextStyle}">
<Setter Property="FontWeight" Value="Normal" />
</Style>
<Style x:Key="ItemTextStyle" TargetType="TextBlock"
BasedOn="{StaticResource BaselineTextStyle}" />
<Style x:Key="BodyTextStyle" TargetType="TextBlock"
BasedOn="{StaticResource BaselineTextStyle}">
<Setter Property="FontWeight" Value="SemiLight" />
</Style>
<Style x:Key="CaptionTextStyle" TargetType="TextBlock"
BasedOn="{StaticResource BaselineTextStyle}">
<Setter Property="FontSize" Value="12" />
<Setter Property="Foreground" Value="{StaticResource ApplicationSecondaryForegroundThemeBrush}" />
</Style>
<Style x:Key="GroupHeaderTextStyle" TargetType="TextBlock">
<Setter Property="FontFamily" Value="{StaticResource ContentControlThemeFontFamily}"/>
<Setter Property="TextTrimming" Value="WordEllipsis" />
<Setter Property="TextWrapping" Value="NoWrap" />
<Setter Property="Typography.StylisticSet20" Value="True" />
<Setter Property="Typography.DiscretionaryLigatures" Value="True" />
<Setter Property="Typography.CaseSensitiveForms" Value="True" />
<Setter Property="FontSize" Value="26.667" />
<Setter Property="LineStackingStrategy" Value="BlockLineHeight" />
<Setter Property="FontWeight" Value="Light" />
<Setter Property="LineHeight" Value="30" />
<Setter Property="RenderTransform">
<Setter.Value>
<TranslateTransform X="-1" Y="6" />
</Setter.Value>
</Setter>
</Style>
<!-- Button 스타일 -->
<Style x:Key="TextButtonStyle" TargetType="ButtonBase">
<Setter Property="MinWidth" Value="0" />
<Setter Property="MinHeight" Value="0" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="ButtonBase">
<Grid Background="Transparent">
<ContentPresenter x:Name="Text"
Content="{TemplateBinding Content}" />
<Rectangle x:Name="FocusVisualWhite"
IsHitTestVisible="False"
Stroke="{StaticResource FocusVisualWhiteStrokeThemeBrush}"
StrokeEndLineCap="Square"
StrokeDashArray="1 1"
Opacity="0"
StrokeDashOffset="1.5" />
<Rectangle x:Name="FocusVisualBlack"
IsHitTestVisible="False"
Stroke="{StaticResource FocusVisualBlackStrokeThemeBrush}"
StrokeEndLineCap="Square"
StrokeDashArray="1 1"
Opacity="0"
StrokeDashOffset="0.5" />
<VisualStateManager.VisualStateGroups>
<VisualStateGroup x:Name="CommonStates">
<VisualState x:Name="Normal"/>
<VisualState x:Name="PointerOver">
<Storyboard>
<ObjectAnimationUsingKeyFrames
Storyboard.TargetName="Text"
Storyboard.TargetProperty="Foreground">
<DiscreteObjectKeyFrame
KeyTime="0"
Value="{StaticResource ApplicationPointerOverForegroundThemeBrush}" />
</ObjectAnimationUsingKeyFrames>
</Storyboard>
</VisualState>
<VisualState x:Name="Pressed">
<Storyboard>
<ObjectAnimationUsingKeyFrames
Storyboard.TargetName="Text"
Storyboard.TargetProperty="Foreground">
<DiscreteObjectKeyFrame
KeyTime="0"
Value="{StaticResource ApplicationPressedForegroundThemeBrush}" />
</ObjectAnimationUsingKeyFrames>
</Storyboard>
</VisualState>
<VisualState x:Name="Disabled">
<Storyboard>
<ObjectAnimationUsingKeyFrames
Storyboard.TargetName="Text"
Storyboard.TargetProperty="Foreground">
<DiscreteObjectKeyFrame
KeyTime="0"
Value="{StaticResource ApplicationPressedForegroundThemeBrush}" />
</ObjectAnimationUsingKeyFrames>
</Storyboard>
</VisualState>
</VisualStateGroup>
<VisualStateGroup x:Name="FocusStates">
<VisualState x:Name="Focused">
<Storyboard>
<DoubleAnimation
Storyboard.TargetName="FocusVisualWhite"
Storyboard.TargetProperty="Opacity"
Duration="0"
To="1" />
<DoubleAnimation
Storyboard.TargetName="FocusVisualBlack"
Storyboard.TargetProperty="Opacity"
Duration="0"
To="1" />
</Storyboard>
</VisualState>
<VisualState x:Name="Unfocused" />
</VisualStateGroup>
<VisualStateGroup x:Name="CheckStates">
<VisualState x:Name="Checked" />
<VisualState x:Name="Unchecked">
<Storyboard>
<ObjectAnimationUsingKeyFrames
Storyboard.TargetName="Text"
Storyboard.TargetProperty="Foreground">
<DiscreteObjectKeyFrame
KeyTime="0"
Value="{StaticResource ApplicationSecondaryForegroundThemeBrush}" />
</ObjectAnimationUsingKeyFrames>
</Storyboard>
</VisualState>
<VisualState x:Name="Indeterminate" />
</VisualStateGroup>
</VisualStateManager.VisualStateGroups>
</Grid>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<Style x:Key="TextPrimaryButtonStyle" TargetType="ButtonBase"
BasedOn="{StaticResource TextButtonStyle}">
<Setter Property="Foreground" Value="{StaticResource ApplicationHeaderForegroundThemeBrush}" />
</Style>
<Style x:Key="TextSecondaryButtonStyle" TargetType="ButtonBase"
BasedOn="{StaticResource TextButtonStyle}">
<Setter Property="Foreground" Value="{StaticResource ApplicationSecondaryForegroundThemeBrush}" />
</Style>
<Style x:Key="TextRadioButtonStyle" TargetType="RadioButton"
BasedOn="{StaticResource TextButtonStyle}">
<Setter Property="Margin" Value="0 0 30 0" />
</Style>
<Style x:Key="AppBarButtonStyle" TargetType="ButtonBase">
<Setter Property="Foreground" Value="{StaticResource AppBarItemForegroundThemeBrush}" />
<Setter Property="VerticalAlignment" Value="Stretch" />
<Setter Property="FontFamily" Value="Segoe UI Symbol" />
<Setter Property="FontWeight" Value="Normal" />
<Setter Property="FontSize" Value="20" />
<Setter Property="AutomationProperties.ItemType" Value="App Bar Button" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="ButtonBase">
<Grid x:Name="RootGrid"
Width="100"
Background="Transparent">
<StackPanel
Margin="0 12 0 11"
VerticalAlignment="Top">
<Grid
Margin="0 0 0 5"
HorizontalAlignment="Center"
Width="40"
Height="40">
<TextBlock x:Name="BackgroundGlyph"
Margin="-4 -19 0 0"
Foreground="{StaticResource AppBarItemBackgroundThemeBrush}"
FontFamily="Segoe UI Symbol"
FontSize="53.333"
Text="" />
<TextBlock x:Name="OutlineGlyph"
Margin="-4 -19 0 0"
FontFamily="Segoe UI Symbol"
FontSize="53.333"
Text="" />
<ContentPresenter x:Name="Content"
Margin="-1 -1 0 0"
HorizontalAlignment="Center"
VerticalAlignment="Center" />
</Grid>
<TextBlock x:Name="TextLabel"
Style="{StaticResource BasicTextStyle}"
Margin="0 0 2 0"
Width="88"
MaxHeight="32"
Foreground="{StaticResource AppBarItemForegroundThemeBrush}"
FontSize="12"
TextAlignment="Center"
TextTrimming="WordEllipsis"
Text="{TemplateBinding AutomationProperties.Name}" />
</StackPanel>
<Rectangle x:Name="FocusVisualWhite"
IsHitTestVisible="False"
Stroke="{StaticResource FocusVisualWhiteStrokeThemeBrush}"
StrokeEndLineCap="Square"
StrokeDashArray="1 1"
StrokeDashOffset="1.5"
Opacity="0" />
<Rectangle x:Name="FocusVisualBlack"
IsHitTestVisible="False"
Stroke="{StaticResource FocusVisualBlackStrokeThemeBrush}"
StrokeEndLineCap="Square"
StrokeDashArray="1 1"
StrokeDashOffset="0.5"
Opacity="0" />
<VisualStateManager.VisualStateGroups>
<VisualStateGroup x:Name="ApplicationViewStates">
<VisualState x:Name="FullScreenLandscape" />
<VisualState x:Name="Filled" />
<VisualState x:Name="FullScreenPortrait">
<Storyboard>
<ObjectAnimationUsingKeyFrames
Storyboard.TargetName="TextLabel"
Storyboard.TargetProperty="Visibility">
<DiscreteObjectKeyFrame
KeyTime="0"
Value="Collapsed" />
</ObjectAnimationUsingKeyFrames>
<ObjectAnimationUsingKeyFrames
Storyboard.TargetName="RootGrid"
Storyboard.TargetProperty="Width">
<DiscreteObjectKeyFrame
KeyTime="0"
Value="60" />
</ObjectAnimationUsingKeyFrames>
</Storyboard>
</VisualState>
<VisualState x:Name="Snapped">
<Storyboard>
<ObjectAnimationUsingKeyFrames
Storyboard.TargetName="TextLabel"
Storyboard.TargetProperty="Visibility">
<DiscreteObjectKeyFrame
KeyTime="0"
Value="Collapsed" />
</ObjectAnimationUsingKeyFrames>
<ObjectAnimationUsingKeyFrames
Storyboard.TargetName="RootGrid"
Storyboard.TargetProperty="Width">
<DiscreteObjectKeyFrame
KeyTime="0"
Value="60" />
</ObjectAnimationUsingKeyFrames>
</Storyboard>
</VisualState>
</VisualStateGroup>
<VisualStateGroup x:Name="CommonStates">
<VisualState x:Name="Normal"/>
<VisualState x:Name="PointerOver">
<Storyboard>
<ObjectAnimationUsingKeyFrames
Storyboard.TargetName="BackgroundGlyph"
Storyboard.TargetProperty="Foreground">
<DiscreteObjectKeyFrame
KeyTime="0"
Value="{StaticResource AppBarItemPointerOverBackgroundThemeBrush}" />
</ObjectAnimationUsingKeyFrames>
<ObjectAnimationUsingKeyFrames
Storyboard.TargetName="Content"
Storyboard.TargetProperty="Foreground">
<DiscreteObjectKeyFrame
KeyTime="0"
Value="{StaticResource AppBarItemPointerOverForegroundThemeBrush}" />
</ObjectAnimationUsingKeyFrames>
</Storyboard>
</VisualState>
<VisualState x:Name="Pressed">
<Storyboard>
<ObjectAnimationUsingKeyFrames
Storyboard.TargetName="OutlineGlyph"
Storyboard.TargetProperty="Foreground">
<DiscreteObjectKeyFrame
KeyTime="0"
Value="{StaticResource AppBarItemForegroundThemeBrush}" />
</ObjectAnimationUsingKeyFrames>
<ObjectAnimationUsingKeyFrames
Storyboard.TargetName="BackgroundGlyph"
Storyboard.TargetProperty="Foreground">
<DiscreteObjectKeyFrame
KeyTime="0"
Value="{StaticResource AppBarItemForegroundThemeBrush}" />
</ObjectAnimationUsingKeyFrames>
<ObjectAnimationUsingKeyFrames
Storyboard.TargetName="Content"
Storyboard.TargetProperty="Foreground">
<DiscreteObjectKeyFrame
KeyTime="0"
Value="{StaticResource AppBarItemPressedForegroundThemeBrush}" />
</ObjectAnimationUsingKeyFrames>
</Storyboard>
</VisualState>
<VisualState x:Name="Disabled">
<Storyboard>
<ObjectAnimationUsingKeyFrames
Storyboard.TargetName="OutlineGlyph"
Storyboard.TargetProperty="Foreground">
<DiscreteObjectKeyFrame
KeyTime="0"
Value="{StaticResource AppBarItemDisabledForegroundThemeBrush}" />
</ObjectAnimationUsingKeyFrames>
<ObjectAnimationUsingKeyFrames
Storyboard.TargetName="Content"
Storyboard.TargetProperty="Foreground">
<DiscreteObjectKeyFrame
KeyTime="0"
Value="{StaticResource AppBarItemDisabledForegroundThemeBrush}" />
</ObjectAnimationUsingKeyFrames>
<ObjectAnimationUsingKeyFrames
Storyboard.TargetName="TextLabel"
Storyboard.TargetProperty="Foreground">
<DiscreteObjectKeyFrame
KeyTime="0"
Value="{StaticResource AppBarItemDisabledForegroundThemeBrush}" />
</ObjectAnimationUsingKeyFrames>
</Storyboard>
</VisualState>
</VisualStateGroup>
<VisualStateGroup x:Name="FocusStates">
<VisualState x:Name="Focused">
<Storyboard>
<DoubleAnimation
Storyboard.TargetName="FocusVisualWhite"
Storyboard.TargetProperty="Opacity"
To="1"
Duration="0" />
<DoubleAnimation
Storyboard.TargetName="FocusVisualBlack"
Storyboard.TargetProperty="Opacity"
To="1"
Duration="0" />
</Storyboard>
</VisualState>
<VisualState x:Name="Unfocused" />
<VisualState x:Name="PointerFocused" />
</VisualStateGroup>
<VisualStateGroup x:Name="CheckStates">
<VisualState x:Name="Checked">
<Storyboard>
<DoubleAnimation
Storyboard.TargetName="OutlineGlyph"
Storyboard.TargetProperty="Opacity"
Duration="0"
To="0" />
<ObjectAnimationUsingKeyFrames
Storyboard.TargetName="BackgroundGlyph"
Storyboard.TargetProperty="Foreground">
<DiscreteObjectKeyFrame
KeyTime="0"
Value="{StaticResource AppBarItemForegroundThemeBrush}" />
</ObjectAnimationUsingKeyFrames>
<ObjectAnimationUsingKeyFrames
Storyboard.TargetName="BackgroundCheckedGlyph"
Storyboard.TargetProperty="Visibility">
<DiscreteObjectKeyFrame
KeyTime="0"
Value="Visible" />
</ObjectAnimationUsingKeyFrames>
<ObjectAnimationUsingKeyFrames
Storyboard.TargetName="Content"
Storyboard.TargetProperty="Foreground">
<DiscreteObjectKeyFrame
KeyTime="0"
Value="{StaticResource AppBarItemPressedForegroundThemeBrush}" />
</ObjectAnimationUsingKeyFrames>
</Storyboard>
</VisualState>
<VisualState x:Name="Unchecked" />
<VisualState x:Name="Indeterminate" />
</VisualStateGroup>
</VisualStateManager.VisualStateGroups>
</Grid>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<!-- 제목 영역 스타일 -->
<Style x:Key="PageHeaderTextStyle" TargetType="TextBlock"
BasedOn="{StaticResource HeaderTextStyle}">
<Setter Property="TextWrapping" Value="NoWrap" />
<Setter Property="VerticalAlignment" Value="Bottom" />
<Setter Property="Margin" Value="0 0 30 40" />
</Style>
<Style x:Key="PageSubheaderTextStyle" TargetType="TextBlock"
BasedOn="{StaticResource SubheaderTextStyle}">
<Setter Property="TextWrapping" Value="NoWrap" />
<Setter Property="VerticalAlignment" Value="Bottom" />
<Setter Property="Margin" Value="0 0 0 40" />
</Style>
<Style x:Key="SnappedPageHeaderTextStyle" TargetType="TextBlock"
BasedOn="{StaticResource PageSubheaderTextStyle}">
<Setter Property="Margin" Value="0 0 18 40" />
</Style>
<Style x:Key="BackButtonStyle" TargetType="Button">
<Setter Property="MinWidth" Value="0" />
<Setter Property="Width" Value="48" />
<Setter Property="Height" Value="48" />
<Setter Property="Margin" Value="36 0 36 36" />
<Setter Property="VerticalAlignment" Value="Bottom" />
<Setter Property="FontFamily" Value="Segoe UI Symbol" />
<Setter Property="FontWeight" Value="Normal" />
<Setter Property="FontSize" Value="56" />
<Setter Property="AutomationProperties.AutomationId" Value="BackButton" />
<Setter Property="AutomationProperties.Name" Value="Back" />
<Setter Property="AutomationProperties.ItemType" Value="Navigation Button" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="Button">
<Grid x:Name="RootGrid">
<Grid Margin="-1 -16 0 0">
<TextBlock x:Name="BackgroundGlyph"
Text=""
Foreground="{StaticResource BackButtonBackgroundThemeBrush}" />
<TextBlock x:Name="NormalGlyph"
Text="{StaticResource BackButtonGlyph}"
Foreground="{StaticResource BackButtonForegroundThemeBrush}" />
<TextBlock x:Name="ArrowGlyph"
Text=""
Foreground="{StaticResource BackButtonPressedForegroundThemeBrush}"
Opacity="0" />
</Grid>
<Rectangle x:Name="FocusVisualWhite"
IsHitTestVisible="False"
Stroke="{StaticResource FocusVisualWhiteStrokeThemeBrush}"
StrokeEndLineCap="Square"
StrokeDashArray="1 1"
StrokeDashOffset="1.5"
Opacity="0" />
<Rectangle x:Name="FocusVisualBlack"
IsHitTestVisible="False"
Stroke="{StaticResource FocusVisualBlackStrokeThemeBrush}"
StrokeEndLineCap="Square"
StrokeDashArray="1 1"
StrokeDashOffset="0.5"
Opacity="0" />
<VisualStateManager.VisualStateGroups>
<VisualStateGroup x:Name="CommonStates">
<VisualState x:Name="Normal" />
<VisualState x:Name="PointerOver">
<Storyboard>
<ObjectAnimationUsingKeyFrames
Storyboard.TargetName="BackgroundGlyph"
Storyboard.TargetProperty="Foreground">
<DiscreteObjectKeyFrame
KeyTime="0"
Value="{StaticResource BackButtonPointerOverBackgroundThemeBrush}" />
</ObjectAnimationUsingKeyFrames>
<ObjectAnimationUsingKeyFrames
Storyboard.TargetName="NormalGlyph"
Storyboard.TargetProperty="Foreground">
<DiscreteObjectKeyFrame
KeyTime="0"
Value="{StaticResource BackButtonPointerOverForegroundThemeBrush}" />
</ObjectAnimationUsingKeyFrames>
</Storyboard>
</VisualState>
<VisualState x:Name="Pressed">
<Storyboard>
<ObjectAnimationUsingKeyFrames
Storyboard.TargetName="BackgroundGlyph"
Storyboard.TargetProperty="Foreground">
<DiscreteObjectKeyFrame
KeyTime="0"
Value="{StaticResource BackButtonForegroundThemeBrush}" />
</ObjectAnimationUsingKeyFrames>
<DoubleAnimation
Storyboard.TargetName="ArrowGlyph"
Storyboard.TargetProperty="Opacity"
Duration="0"
To="1" />
<DoubleAnimation
Storyboard.TargetName="NormalGlyph"
Storyboard.TargetProperty="Opacity"
Duration="0"
To="0" />
</Storyboard>
</VisualState>
<VisualState x:Name="Disabled">
<Storyboard>
<ObjectAnimationUsingKeyFrames
Storyboard.TargetName="RootGrid"
Storyboard.TargetProperty="Visibility">
<DiscreteObjectKeyFrame
KeyTime="0"
Value="Collapsed" />
</ObjectAnimationUsingKeyFrames>
</Storyboard>
</VisualState>
</VisualStateGroup>
<VisualStateGroup x:Name="FocusStates">
<VisualState x:Name="Focused">
<Storyboard>
<DoubleAnimation
Storyboard.TargetName="FocusVisualWhite"
Storyboard.TargetProperty="Opacity"
Duration="0"
To="1" />
<DoubleAnimation
Storyboard.TargetName="FocusVisualBlack"
Storyboard.TargetProperty="Opacity"
Duration="0"
To="1" />
</Storyboard>
</VisualState>
<VisualState x:Name="Unfocused" />
<VisualState x:Name="PointerFocused" />
</VisualStateGroup>
</VisualStateManager.VisualStateGroups>
</Grid>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<Style x:Key="PortraitBackButtonStyle" TargetType="Button"
BasedOn="{StaticResource BackButtonStyle}">
<Setter Property="Margin" Value="26 0 26 36" />
</Style>
<Style x:Key="SnappedBackButtonStyle" TargetType="Button">
<Setter Property="MinWidth" Value="0" />
<Setter Property="Margin" Value="20 0 0 0" />
<Setter Property="VerticalAlignment" Value="Bottom" />
<Setter Property="FontFamily" Value="Segoe UI Symbol" />
<Setter Property="FontWeight" Value="Normal" />
<Setter Property="FontSize" Value="26.66667" />
<Setter Property="AutomationProperties.AutomationId" Value="BackButton" />
<Setter Property="AutomationProperties.Name" Value="Back" />
<Setter Property="AutomationProperties.ItemType" Value="Navigation Button" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="Button">
<Grid x:Name="RootGrid"
Margin="-3 0 7 33"
Width="36"
Height="36">
<Grid Margin="-1 -1 0 0">
<TextBlock x:Name="BackgroundGlyph"
Text=""
Foreground="{StaticResource BackButtonBackgroundThemeBrush}" />
<TextBlock x:Name="NormalGlyph"
Text="{StaticResource BackButtonSnappedGlyph}"
Foreground="{StaticResource BackButtonForegroundThemeBrush}" />
<TextBlock x:Name="ArrowGlyph"
Text=""
Foreground="{StaticResource BackButtonPressedForegroundThemeBrush}"
Opacity="0" />
</Grid>
<Rectangle x:Name="FocusVisualWhite"
IsHitTestVisible="False"
Stroke="{StaticResource FocusVisualWhiteStrokeThemeBrush}"
StrokeEndLineCap="Square"
StrokeDashArray="1 1"
StrokeDashOffset="1.5"
Opacity="0" />
<Rectangle x:Name="FocusVisualBlack"
IsHitTestVisible="False"
Stroke="{StaticResource FocusVisualBlackStrokeThemeBrush}"
StrokeEndLineCap="Square"
StrokeDashArray="1,1"
StrokeDashOffset="0.5"
Opacity="0" />
<VisualStateManager.VisualStateGroups>
<VisualStateGroup x:Name="CommonStates">
<VisualState x:Name="Normal" />
<VisualState x:Name="PointerOver">
<Storyboard>
<ObjectAnimationUsingKeyFrames
Storyboard.TargetName="BackgroundGlyph"
Storyboard.TargetProperty="Foreground">
<DiscreteObjectKeyFrame
KeyTime="0"
Value="{StaticResource BackButtonPointerOverBackgroundThemeBrush}" />
</ObjectAnimationUsingKeyFrames>
<ObjectAnimationUsingKeyFrames
Storyboard.TargetName="NormalGlyph"
Storyboard.TargetProperty="Foreground">
<DiscreteObjectKeyFrame
KeyTime="0"
Value="{StaticResource BackButtonPointerOverForegroundThemeBrush}" />
</ObjectAnimationUsingKeyFrames>
</Storyboard>
</VisualState>
<VisualState x:Name="Pressed">
<Storyboard>
<ObjectAnimationUsingKeyFrames
Storyboard.TargetName="BackgroundGlyph"
Storyboard.TargetProperty="Foreground">
<DiscreteObjectKeyFrame
KeyTime="0"
Value="{StaticResource BackButtonForegroundThemeBrush}" />
</ObjectAnimationUsingKeyFrames>
<DoubleAnimation
Storyboard.TargetName="ArrowGlyph"
Storyboard.TargetProperty="Opacity"
Duration="0"
To="1" />
<DoubleAnimation
Storyboard.TargetName="NormalGlyph"
Storyboard.TargetProperty="Opacity"
Duration="0"
To="0" />
</Storyboard>
</VisualState>
<VisualState x:Name="Disabled">
<Storyboard>
<ObjectAnimationUsingKeyFrames
Storyboard.TargetName="RootGrid"
Storyboard.TargetProperty="Visibility">
<DiscreteObjectKeyFrame
KeyTime="0"
Value="Collapsed" />
</ObjectAnimationUsingKeyFrames>
</Storyboard>
</VisualState>
</VisualStateGroup>
<VisualStateGroup x:Name="FocusStates">
<VisualState x:Name="Focused">
<Storyboard>
<DoubleAnimation
Storyboard.TargetName="FocusVisualWhite"
Storyboard.TargetProperty="Opacity"
Duration="0"
To="1" />
<DoubleAnimation
Storyboard.TargetName="FocusVisualBlack"
Storyboard.TargetProperty="Opacity"
Duration="0"
To="1" />
</Storyboard>
</VisualState>
<VisualState x:Name="Unfocused" />
<VisualState x:Name="PointerFocused" />
</VisualStateGroup>
</VisualStateManager.VisualStateGroups>
</Grid>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<!-- 항목 템플리트 -->
<!-- GroupedItemsPage 및 ItemsPage에서 볼 수 있는 그리드에 적합한 250 픽셀 크기의 항목 템플릿 -->
<DataTemplate x:Key="Standard250x250ItemTemplate">
<Grid
HorizontalAlignment="Left"
Width="250"
Height="250">
<Border Background="{StaticResource ListViewItemPlaceholderBackgroundThemeBrush}">
<Image
Source="{Binding Image}"
Stretch="UniformToFill"
AutomationProperties.Name="{Binding Title}" />
</Border>
<StackPanel
VerticalAlignment="Bottom"
Background="{StaticResource ListViewItemOverlayBackgroundThemeBrush}">
<TextBlock
Style="{StaticResource TitleTextStyle}"
Margin="15 0 15 0"
Height="60"
Foreground="{StaticResource ListViewItemOverlayForegroundThemeBrush}"
Text="{Binding Title}" />
<TextBlock
Style="{StaticResource CaptionTextStyle}"
Margin="15 0 15 10"
Foreground="{StaticResource ListViewItemOverlaySecondaryForegroundThemeBrush}"
TextWrapping="NoWrap"
Text="{Binding Subtitle}" />
</StackPanel>
</Grid>
</DataTemplate>
<!-- GroupDetailPage에 표시된 그리드에 적합한 500×130 픽셀 항목 템플릿 -->
<DataTemplate x:Key="Standard500x130ItemTemplate">
<Grid
Margin="10"
Width="480"
Height="110">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<Border
Width="110"
Height="110"
Background="{StaticResource ListViewItemPlaceholderBackgroundThemeBrush}">
<Image
Stretch="UniformToFill"
AutomationProperties.Name="{Binding Title}"
Source="{Binding Image}" />
</Border>
<StackPanel Grid.Column="1"
Margin="10 0 0 0"
VerticalAlignment="Top">
<TextBlock
Style="{StaticResource TitleTextStyle}"
TextWrapping="NoWrap"
Text="{Binding Title}" />
<TextBlock
Style="{StaticResource CaptionTextStyle}"
TextWrapping="NoWrap"
Text="{Binding Subtitle}" />
<TextBlock
Style="{StaticResource BodyTextStyle}"
MaxHeight="60"
Text="{Binding Description}" />
</StackPanel>
</Grid>
</DataTemplate>
<!-- SplitPage에 표시된 목록에 적합한 130 픽셀 높이 항목 템플릿 -->
<DataTemplate x:Key="Standard130ItemTemplate">
<Grid
Margin="6"
Height="110">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<Border
Width="110"
Height="110"
Background="{StaticResource ListViewItemPlaceholderBackgroundThemeBrush}">
<Image
Stretch="UniformToFill"
AutomationProperties.Name="{Binding Title}"
Source="{Binding Image}" />
</Border>
<StackPanel Grid.Column="1"
Margin="10 0 0 0"
VerticalAlignment="Top">
<TextBlock
Style="{StaticResource TitleTextStyle}"
TextWrapping="NoWrap"
Text="{Binding Title}" />
<TextBlock
Style="{StaticResource CaptionTextStyle}"
TextWrapping="NoWrap"
Text="{Binding Subtitle}" />
<TextBlock
Style="{StaticResource BodyTextStyle}"
MaxHeight="60"
Text="{Binding Description}" />
</StackPanel>
</Grid>
</DataTemplate>
<DataTemplate x:Key="Standard80ItemTemplate">
<Grid Margin="6">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<Border
Width="60"
Height="60"
Background="{StaticResource ListViewItemPlaceholderBackgroundThemeBrush}">
<Image
Source="{Binding Image}"
Stretch="UniformToFill" />
</Border>
<StackPanel Grid.Column="1"
Margin="10 0 0 0">
<TextBlock
Style="{StaticResource ItemTextStyle}"
MaxHeight="40"
Text="{Binding Title}" />
<TextBlock
Style="{StaticResource CaptionTextStyle}"
TextWrapping="NoWrap"
Text="{Binding Subtitle}" />
</StackPanel>
</Grid>
</DataTemplate>
<!-- SearchResultsPage에 표시된 그리드에 적합한 300×70 픽셀 항목 템플릿 -->
<DataTemplate x:Key="StandardSmallIcon300x70ItemTemplate">
<Grid
Margin="6"
Width="294">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<Border
Margin="0 0 0 10"
Width="40"
Height="40"
Background="{StaticResource ListViewItemPlaceholderBackgroundThemeBrush}">
<Image
Source="{Binding Image}"
Stretch="UniformToFill" />
</Border>
<StackPanel Grid.Column="1"
Margin="10 -10 0 0">
<TextBlock
Style="{StaticResource BodyTextStyle}"
TextWrapping="NoWrap"
Text="{Binding Title}" />
<TextBlock
Style="{StaticResource BodyTextStyle}"
Foreground="{StaticResource ApplicationSecondaryForegroundThemeBrush}"
TextWrapping="NoWrap"
Text="{Binding Subtitle}" />
<TextBlock
Style="{StaticResource BodyTextStyle}"
Foreground="{StaticResource ApplicationSecondaryForegroundThemeBrush}"
TextWrapping="NoWrap"
Text="{Binding Description}" />
</StackPanel>
</Grid>
</DataTemplate>
<!-- 스냅할 때 SearchResultsPage에 표시된 목록에 적합한 70 픽셀 높이 항목 템플릿 -->
<DataTemplate x:Key="StandardSmallIcon70ItemTemplate">
<Grid Margin="6">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<Border
Margin="0 0 0 10"
Width="40"
Height="40"
Background="{StaticResource ListViewItemPlaceholderBackgroundThemeBrush}">
<Image
Source="{Binding Image}"
Stretch="UniformToFill" />
</Border>
<StackPanel Grid.Column="1"
Margin="10 -10 0 0">
<TextBlock
Style="{StaticResource BodyTextStyle}"
TextWrapping="NoWrap"
Text="{Binding Title}" />
<TextBlock
Style="{StaticResource BodyTextStyle}"
Foreground="{StaticResource ApplicationSecondaryForegroundThemeBrush}"
TextWrapping="NoWrap"
Text="{Binding Subtitle}" />
<TextBlock
Style="{StaticResource BodyTextStyle}"
Foreground="{StaticResource ApplicationSecondaryForegroundThemeBrush}"
TextWrapping="NoWrap"
Text="{Binding Description}" />
</StackPanel>
</Grid>
</DataTemplate>
<!-- 제목 및 설명 텍스트를 표시하는 정교한 툴팁 포함하는 FileOpenPickerPage에서 보이는 파일 미리보기를 표시하는 190×130 픽셀 항목 템플릿 -->
<DataTemplate x:Key="StandardFileWithTooltip190x130ItemTemplate">
<Grid>
<Grid Background="{StaticResource ListViewItemPlaceholderBackgroundThemeBrush}">
<Image
HorizontalAlignment="Center"
VerticalAlignment="Center"
Width="190"
Height="130"
Stretch="Uniform"
Source="{Binding Image}" />
</Grid>
<ToolTipService.Placement>Mouse</ToolTipService.Placement>
<ToolTipService.ToolTip>
<ToolTip>
<ToolTip.Style>
<Style TargetType="ToolTip">
<Setter Property="BorderBrush" Value="{StaticResource ToolTipBackgroundThemeBrush}" />
<Setter Property="Padding" Value="0" />
</Style>
</ToolTip.Style>
<Grid Background="{StaticResource ApplicationPageBackgroundThemeBrush}">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<Grid
Margin="20"
Background="{StaticResource ListViewItemPlaceholderBackgroundThemeBrush}">
<Image
Width="160"
Height="160"
HorizontalAlignment="Center"
VerticalAlignment="Center"
Stretch="Uniform"
Source="{Binding Image}" />
</Grid>
<StackPanel Grid.Column="1"
Margin="0 20 20 20"
Width="200">
<TextBlock
Style="{StaticResource BodyTextStyle}"
TextWrapping="NoWrap"
Text="{Binding Title}" />
<TextBlock
Style="{StaticResource BodyTextStyle}"
MaxHeight="140"
Foreground="{StaticResource ApplicationSecondaryForegroundThemeBrush}"
Text="{Binding Description}" />
</StackPanel>
</Grid>
</ToolTip>
</ToolTipService.ToolTip>
</Grid>
</DataTemplate>
<!-- ScrollViewer 스타일 -->
<Style x:Key="HorizontalScrollViewerStyle" TargetType="ScrollViewer">
<Setter Property="HorizontalScrollBarVisibility" Value="Auto" />
<Setter Property="VerticalScrollBarVisibility" Value="Disabled" />
<Setter Property="ScrollViewer.HorizontalScrollMode" Value="Enabled" />
<Setter Property="ScrollViewer.VerticalScrollMode" Value="Disabled" />
<Setter Property="ScrollViewer.ZoomMode" Value="Disabled" />
</Style>
<Style x:Key="VerticalScrollViewerStyle" TargetType="ScrollViewer">
<Setter Property="HorizontalScrollBarVisibility" Value="Disabled" />
<Setter Property="VerticalScrollBarVisibility" Value="Auto" />
<Setter Property="ScrollViewer.HorizontalScrollMode" Value="Disabled" />
<Setter Property="ScrollViewer.VerticalScrollMode" Value="Enabled" />
<Setter Property="ScrollViewer.ZoomMode" Value="Disabled" />
</Style>
<!-- 페이지 레이아웃 루트는 일반적으로 진입 애니메이션과 테마에 적합한 배경색을 사용합니다. -->
<Style x:Key="LayoutRootStyle" TargetType="Panel">
<Setter Property="Background" Value="{StaticResource ApplicationPageBackgroundThemeBrush}" />
<Setter Property="ChildrenTransitions">
<Setter.Value>
<TransitionCollection>
<EntranceThemeTransition />
</TransitionCollection>
</Setter.Value>
</Setter>
</Style>
</ResourceDictionary>
▶ App.xaml
<Application
x:Class="TestProject.App"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<Application.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="Common/StandardStyle.xaml" />
</ResourceDictionary.MergedDictionaries>
</ResourceDictionary>
</Application.Resources>
</Application>
▶ App.xaml.cs
using System;
using Windows.ApplicationModel;
using Windows.ApplicationModel.Activation;
using Windows.Foundation;
using Windows.Graphics.Display;
using Windows.UI.ViewManagement;
using Windows.UI.Xaml;
using Windows.UI.Xaml.Controls;
namespace TestProject
{
/// <summary>
/// 앱
/// </summary>
sealed partial class App : Application
{
//////////////////////////////////////////////////////////////////////////////////////////////////// Constructor
////////////////////////////////////////////////////////////////////////////////////////// Public
#region 생성자 - App()
/// <summary>
/// 생성자
/// </summary>
public App()
{
InitializeComponent();
Suspending += Application_Suspending;
}
#endregion
//////////////////////////////////////////////////////////////////////////////////////////////////// Method
////////////////////////////////////////////////////////////////////////////////////////// Protected
//////////////////////////////////////////////////////////////////////////////// Function
#region 런치시 처리하기 - OnLaunched(e)
/// <summary>
/// 런치시 처리하기
/// </summary>
/// <param name="e">이벤트 인자</param>
protected override void OnLaunched(LaunchActivatedEventArgs e)
{
Frame rootFrame = Window.Current.Content as Frame;
if(rootFrame == null)
{
rootFrame = new Frame();
Window.Current.Content = rootFrame;
}
if(rootFrame.Content == null)
{
if(!rootFrame.Navigate(typeof(MainPage), e.Arguments))
{
throw new Exception("초기 페이지 생성시 실패했습니다.");
}
}
#region 윈도우 크기를 설정한다.
double width = 800d;
double height = 600d;
double dpi = (double)DisplayInformation.GetForCurrentView().LogicalDpi;
ApplicationView.PreferredLaunchWindowingMode = ApplicationViewWindowingMode.PreferredLaunchViewSize;
Size windowSize = new Size(width * 96d / dpi, height * 96d / dpi);
ApplicationView.PreferredLaunchViewSize = windowSize;
Window.Current.Activate();
ApplicationView.GetForCurrentView().TryResizeView(windowSize);
#endregion
}
#endregion
////////////////////////////////////////////////////////////////////////////////////////// Private
//////////////////////////////////////////////////////////////////////////////// Event
#region 애플리케이션 실행 보류시 처리하기 - Application_Suspending(sender, e)
/// <summary>
/// 애플리케이션 실행 보류시 처리하기
/// </summary>
/// <param name="sender">이벤트 발생자</param>
/// <param name="e">이벤트 인자</param>
private void Application_Suspending(object sender, SuspendingEventArgs e)
{
SuspendingDeferral suspendingDeferral = e.SuspendingOperation.GetDeferral();
suspendingDeferral.Complete();
}
#endregion
}
}
▶ MainPage.xaml
<Page x:Class="TestProject.MainPage"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
FontFamily="나눔고딕코딩"
FontSize="16">
<Grid Background="{StaticResource ApplicationPageBackgroundThemeBrush}">
<TextBlock
HorizontalAlignment="Center"
VerticalAlignment="Center"
Foreground="Black"
FontSize="96"
FontStyle="Italic"
Text="Hello, World!" />
</Grid>
</Page>
▶ MainPage.xaml.cs
using Windows.UI.Xaml.Controls;
namespace TestProject
{
/// <summary>
/// 메인 페이지
/// </summary>
public sealed partial class MainPage : Page
{
//////////////////////////////////////////////////////////////////////////////////////////////////// Constructor
////////////////////////////////////////////////////////////////////////////////////////// Public
#region 생성자 - MainPage()
/// <summary>
/// 생성자
/// </summary>
public MainPage()
{
InitializeComponent();
}
#endregion
}
}
728x90
반응형
그리드형(광고전용)
'C# > UWP' 카테고리의 다른 글
[C#/UWP] DisplayInformation 클래스 : 디스플레이 정보 구하기 (0) | 2019.01.27 |
---|---|
[C#/UWP] TextBlock 클래스 : TextWrapping 속성 사용하기 (0) | 2019.01.22 |
[C#/UWP] Application 클래스 : RequestedTheme 속성을 사용해 테마 설정하기 (0) | 2019.01.22 |
[C#/UWP] Image 클래스 : 리소스 이미지 사용하기 (0) | 2019.01.22 |
[C#/UWP] Image 클래스 : 웹 사이트 이미지 사용하기 (0) | 2019.01.22 |
[C#/UWP] ApplicationView 클래스 : PreferredLaunchViewSize 정적 속성과 TryResizeView 메소드를 사용해 메인 윈도우 크기 설정하기 (0) | 2019.01.22 |
[C#/UWP] local XML 접두사 사용하기 (0) | 2019.01.22 |
[C#/UWP] x:Class 속성 사용하기 (0) | 2019.01.21 |
[C#/UWP] 웹 카메라 사용하기 (0) | 2017.05.09 |
[C#/UWP] SuspendingDeferral 클래스 : 비동기 처리 대기하기 (0) | 2016.06.04 |
댓글을 달아 주세요