Setting UI information with static resources

Source: Internet
Author: User

First set up a file storage style settings (resource dictionary), all style settings can be done here

Add the following code:

<resourcedictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"xmlns:x="Http://schemas.microsoft.com/winfx/2006/xaml"> <!--form style settings-<style x:key="Userwindow"Targettype="{x:type Window}"> <setter property="FontFamily"Value="Microsoft Ya-Black"/> <setter property="FontSize"Value=" -"/> <setter property="BorderBrush"Value="Blue"/> <setter property="FontWeight"Value="Black"/> </Style></ResourceDictionary>
Resource Dictionary Code

Make the following settings in App.xaml

<application x:class="Oilsystem.app"xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"xmlns:x="Http://schemas.microsoft.com/winfx/2006/xaml"xmlns:d="http://schemas.microsoft.com/expression/blend/2008"XMLNS:MC="http://schemas.openxmlformats.org/markup-compatibility/2006"StartupUri="View\main\mainwindow.xaml"mc:ignorable="D"> <Application.Resources> <!--Global View Model locator--> <!--<vm:viewmodellocator x:key="Locator"D:isdatasource="True"/>--> <!--The following line of code is the resource dictionary that needs to be used--<resourcedictionary source="Skins/windowexpanderstyle.xaml"/> </Application.Resources></Application>
App.xaml File Settings

Called when the following method

<window x:class="OilSystem.View.Main.MainWindow"xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"xmlns:x="Http://schemas.microsoft.com/winfx/2006/xaml"Title="MainWindow"height="301"Width="509"style="{StaticResource Userwindow}">
See style= this setting

Run a look at the effect, the skin is set to do so, change the contents of the resource dictionary can be changed directly style

Setting UI information with static resources

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.