有没有办法在我的 C# 代码中访问静态资源? [英] Is there a way I can access a static resource in my C# code?

查看:22
本文介绍了有没有办法在我的 C# 代码中访问静态资源?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的 App.XAML 中,我有这个:

<Application xmlns:converters="clr-namespace:Japanese" xmlns="http://xamarin.com/schemas/2014/forms" xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" x:Class="Japanese.App"><应用程序.资源><Color x:Key="TextColor1">#123456</Color>

我可以像这样在 XAML 中访问这个值: