次のようなコードを使用して、Windows ストア アプリアセンブリのTitle
属性を取得します。
まず、次のアセンブリが必要です。
using System.Reflection;
using System.Linq;
...そして、次のようなコードが機能するはずです(おそらく、より多くのチェックが必要です):
// Get the assembly with Reflection:
Assembly assembly = typeof(App).GetTypeInfo().Assembly;
// Get the custom attribute informations:
var titleAttribute = assembly.CustomAttributes.Where(ca => ca.AttributeType == typeof(AssemblyTitleAttribute)).FirstOrDefault();
// Now get the string value contained in the constructor:
return titleAttribute.ConstructorArguments[0].Value.ToString();
お役に立てれば...