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

TestProject.zip
0.00MB

▶ Project.csproj

<Project Sdk="Microsoft.NET.Sdk">
    <PropertyGroup>
        <OutputType>WinExe</OutputType>
        <TargetFramework>net5.0-windows</TargetFramework>
        <UseWPF>true</UseWPF>
        <Authors>DSCore</Authors>
        <Company>DSCore</Company>
        <Copyright>Copyright © DSCore 2021</Copyright>
    </PropertyGroup>
    <ItemGroup>
        <ApplicationDefinition Include="MainApplication.xaml">
            <Generator>MSBuild:Compile</Generator>
        </ApplicationDefinition>
    </ItemGroup>
    <ItemGroup>
        <PackageReference Include="MaterialDesignThemes" Version="4.2.1" />
    </ItemGroup>
</Project>

 

728x90

 

▶ 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="pack://application:,,,/MaterialDesignThemes.Wpf;component/Themes/MaterialDesignTheme.Light.xaml" />
                <ResourceDictionary Source="pack://application:,,,/MaterialDesignThemes.Wpf;component/Themes/MaterialDesignTheme.Defaults.xaml" />
                <ResourceDictionary Source="pack://application:,,,/MaterialDesignColors;component/Themes/Recommended/Primary/MaterialDesignColor.DeepPurple.xaml" />
                <ResourceDictionary Source="pack://application:,,,/MaterialDesignColors;component/Themes/Recommended/Accent/MaterialDesignColor.Lime.xaml" />
            </ResourceDictionary.MergedDictionaries>
        </ResourceDictionary>
    </Application.Resources>
</Application>

 

반응형

 

▶ 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"
    xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
    Width="800"
    Height="600"
    Title="머터리얼 디자인(Material Design) 사용하기"
    Background="{DynamicResource MaterialDesignPaper}"
    FontFamily="나눔고딕코딩"
    FontSize="16">
    <Grid>
        <materialDesign:Card
            HorizontalAlignment="Center"
            VerticalAlignment="Center"
            Padding="30"
            TextOptions.TextFormattingMode="Ideal"
            TextOptions.TextRenderingMode="Auto"
            TextElement.FontFamily="{DynamicResource MaterialDesignFont}"
            TextElement.FontSize="30"
            TextElement.FontWeight="Regular"
            TextElement.Foreground="{DynamicResource MaterialDesignBody}">
            <TextBlock
                Style="{DynamicResource MaterialDesignTitleTextBlock}">
                First Material Design App
            </TextBlock>
        </materialDesign:Card>
    </Grid>
</Window>
728x90
반응형
그리드형(광고전용)
Posted by icodebroker

댓글을 달아 주세요