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

TestProject.zip
0.35MB

▶ 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"
    xmlns:media="using:Windows.UI.Xaml.Media"
    Background="{ThemeResource ApplicationPageBackgroundThemeBrush}"
    FontFamily="나눔고딕코딩"
    FontSize="16">
    <Page.Resources>
        <media:AcrylicBrush x:Key="CustomAcrylicBrushKey"
            BackgroundSource="Backdrop"
            TintOpacity="0.45"
            TintColor="#ff8ff0fb"
            FallbackColor="#ff8ff0fb" />
        <media:AcrylicBrush x:Key="CustomDarkAcrylicBrushKey"
            BackgroundSource="Backdrop"
            TintOpacity="0.45"
            TintColor="#ff0e5a5c"
            FallbackColor="#ff0e5a5c" />
    </Page.Resources>
    <Grid>
        <Grid
            HorizontalAlignment="Center"
            VerticalAlignment="Center">
            <Image
                Width="512"
                Height="275"
                Source="ms-appx:///IMAGE/background.png" />
            <StackPanel
                HorizontalAlignment="Stretch"
                VerticalAlignment="Center">
                <StackPanel
                    HorizontalAlignment="Center"
                    VerticalAlignment="Center"
                    Orientation="Horizontal">
                    <Grid
                        HorizontalAlignment="Center"
                        Margin="5"
                        Background="{ThemeResource SystemControlAcrylicElementBrush}">
                        <StackPanel Orientation="Vertical">
                            <StackPanel Orientation="Horizontal">
                                <AppBarButton
                                    Style="{ThemeResource AppBarButtonRevealStyle}"
                                    Margin="1 2 0 0"
                                    Icon="World" />
                                <AppBarButton
                                    Style="{ThemeResource AppBarButtonRevealStyle}"
                                    Margin="0 2 1 0"
                                    Icon="CellPhone" />
                            </StackPanel>
                            <StackPanel Orientation="Horizontal">
                                <AppBarButton
                                    Style="{ThemeResource AppBarButtonRevealStyle}"
                                    Margin="1 2 0 2"
                                    Icon="Delete" />
                                <AppBarButton
                                    Style="{ThemeResource AppBarButtonRevealStyle}"
                                    Margin="0 2 1 2"
                                    Icon="Comment" />
                            </StackPanel>
                        </StackPanel>
                    </Grid>
                    <Grid
                        HorizontalAlignment="Center"
                        Margin="5"
                        Background="{ThemeResource CustomAcrylicBrushKey}"
                        RequestedTheme="Light">
                        <StackPanel Orientation="Vertical">
                            <StackPanel Orientation="Horizontal">
                                <AppBarButton
                                    Style="{ThemeResource AppBarButtonRevealStyle}"
                                    Margin="1 2 0 0"
                                    Icon="World" />
                                <AppBarButton
                                    Style="{ThemeResource AppBarButtonRevealStyle}"
                                    Margin="0 2 1 0"
                                    Icon="CellPhone" />
                            </StackPanel>
                            <StackPanel Orientation="Horizontal">
                                <AppBarButton
                                    Style="{ThemeResource AppBarButtonRevealStyle}"
                                    Margin="1 2 0 2"
                                    Icon="Delete" />
                                <AppBarButton
                                    Style="{ThemeResource AppBarButtonRevealStyle}"
                                    Margin="0 2 1 2"
                                    Icon="Comment" />
                            </StackPanel>
                        </StackPanel>
                    </Grid>
                    <Grid
                        HorizontalAlignment="Center"
                        Margin="5"
                        Background="{ThemeResource CustomDarkAcrylicBrushKey}"
                        RequestedTheme="Dark">
                        <StackPanel Orientation="Vertical">
                            <StackPanel Orientation="Horizontal">
                                <AppBarButton
                                    Style="{ThemeResource AppBarButtonRevealStyle}"
                                    Margin="1 2 0 0"
                                    Icon="World" />
                                <AppBarButton
                                    Style="{ThemeResource AppBarButtonRevealStyle}"
                                    Margin="0 2 1 0"
                                    Icon="CellPhone" />
                            </StackPanel>
                            <StackPanel Orientation="Horizontal">
                                <AppBarButton
                                    Style="{ThemeResource AppBarButtonRevealStyle}"
                                    Margin="1 2 0 2"
                                    Icon="Delete" />
                                <AppBarButton
                                    Style="{ThemeResource AppBarButtonRevealStyle}"
                                    Margin="0 2 1 2"
                                    Icon="Comment" />
                            </StackPanel>
                        </StackPanel>
                    </Grid>
                </StackPanel>
            </StackPanel>
        </Grid>
    </Grid>
</Page>

 

728x90

 

▶ MainPage.xaml.cs

using Windows.Foundation;
using Windows.Graphics.Display;
using Windows.UI.ViewManagement;
using Windows.UI.Xaml;
using Windows.UI.Xaml.Controls;

namespace TestProject
{
    /// <summary>
    /// 메인 페이지
    /// </summary>
    public sealed partial class MainPage : Page
    {
        //////////////////////////////////////////////////////////////////////////////////////////////////// Constructor
        ////////////////////////////////////////////////////////////////////////////////////////// Public

        #region 생성자 - MainPage()

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

            #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
            #region 윈도우 제목을 설정한다.

            ApplicationView.GetForCurrentView().Title = "AppBarButton 엘리먼트 : Style 속성에서 AppBarButtonRevealStyle 리소스 사용하기";

            #endregion
        }

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

댓글을 달아 주세요