這是我的「示例代碼」,包括我正在嘗試做的事情。顯然,目前它不工作,但有什麼辦法可以使它工作?如何從WPF中的其他字符串資源構建字符串資源?
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:System="clr-namespace:System;assembly=mscorlib"
>
<System:String x:Key="ProductName">Foo</System:String>
<System:String x:Key="WindowTitle">{ProductName} + Main Window</System:String>
</ResourceDictionary>
您可以使用xaml中的字符串格式來實現相同的目標嗎?http://blogs.msdn.com/llobo/archive/2008/05/19/wpf-3-5-sp1-feature-stringformat.aspx – 2010-01-12 22:42:01