English 中文(简体)
使用 c # xaml 的地热格式应用中更改背景
原标题:change background in a metrostyle app using c # xaml

当我开始选择网格选项时, 我用 c# 创造了一个地铁式的 Ap, 但我需要改变应用程序的背景, 改变成图像或另一种颜色 。

我跟踪微软教程link

我下个代码是普通的/可观的Style, 但不管用, 我知道这很简单,但对我没用。

<Grid Background="{StaticResource WindowsBlogBackgroundBrush}">
// Add this brush to the resource dictionary in App.xaml.
<SolidColorBrush x:Key="WindowsBlogBackgroundBrush" Color="#FF0A2562"/>
最佳回答

你可以试试这个:

<Grid>
    <Grid.Background>
        <SolidColorBrush
            Color="#FF0A2562" />
    </Grid.Background>

    ...
</Grid>

如果它没有帮助,那么也许你的网格是看不见的 - 它的内容可能有不同的颜色,完全填满网格 - 那么你看不到它的颜色。

问题回答

设置网格的背景属性

  grid.Background = new SolidColorBrush(Windows.UI.Color.FromArgb(1,10,37,98));

最简单的方式是:使用程序搅拌器,(微软站点开发商的软件包中加入wich)打开一个新的工程(当我们在 vs 中制作的新项目时打开)左键,打开工具设计师,您可以选择固色刷或梯度刷。





相关问题
Anyone feel like passing it forward?

I m the only developer in my company, and am getting along well as an autodidact, but I know I m missing out on the education one gets from working with and having code reviewed by more senior devs. ...

NSArray s, Primitive types and Boxing Oh My!

I m pretty new to the Objective-C world and I have a long history with .net/C# so naturally I m inclined to use my C# wits. Now here s the question: I feel really inclined to create some type of ...

C# Marshal / Pinvoke CBitmap?

I cannot figure out how to marshal a C++ CBitmap to a C# Bitmap or Image class. My import looks like this: [DllImport(@"test.dll", CharSet = CharSet.Unicode)] public static extern IntPtr ...

How to Use Ghostscript DLL to convert PDF to PDF/A

How to user GhostScript DLL to convert PDF to PDF/A. I know I kind of have to call the exported function of gsdll32.dll whose name is gsapi_init_with_args, but how do i pass the right arguments? BTW, ...

Linqy no matchy

Maybe it s something I m doing wrong. I m just learning Linq because I m bored. And so far so good. I made a little program and it basically just outputs all matches (foreach) into a label control. ...

热门标签