答案 0 :(得分:1)
sys
的XAML命名空间:xmlns:sys="clr-namespace:System;assembly=mscorlib"
<Application.Resources>
<ResourceDictionary>
<sys:String x:Key="EmailPattern">... some regex patterm ...</sys:String>
</ResourceDictionary>
</Application.Resources>
if (Application.Current.Resources.TryGetValue("EmailPattern", out object regexPattern))
{
Console.WriteLine(regexPattern);
}