首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >"XDG0062资源“"BlueButton”无法解析

"XDG0062资源“"BlueButton”无法解析
EN

Stack Overflow用户
提问于 2022-09-20 22:45:48
回答 1查看 23关注 0票数 1

我用xaml写,我试着放一个样式按钮,所以它抛给我这个错误XDG0062资源"BlueButton“无法解决。

这是我的密码

代码语言:javascript
复制
<Window x:Class="grafic.MainWindow"
    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"
    xmlns:local="clr-namespace:grafic"
    mc:Ignorable="d"
    Title="welcome" Height="450" Width="800">

<Grid>
    <Grid.Background>
        <ImageBrush Stretch="Fill" ImageSource="thil.png" AlignmentY="Top" AlignmentX="Center"/>
    </Grid.Background>

    <Button 
        Style="{StaticResource BlueButton}"
        BorderBrush="#fff"
        x:Name="signIn"
        Content="Sign in"
        Background="RED" Margin="297,40,347,333" FontWeight="Bold" FontSize="36" Click="signIn_Click"
        />
</Grid>
EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2022-09-21 08:08:50

您需要定义“BlueButton”按钮样式,并在App.xaml或graffic.MainWindow.xaml中作为Window.Resource对其进行引用。

查看一下Microsoft文档:

https://learn.microsoft.com/en-us/windows/apps/design/style/xaml-resource-dictionary

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/73793347

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档