9
以下は、私が名前空間にTextColorConverter.csを書いていたは、Windowsの携帯電話にStaticResourceとしてValueConverterを使用する方法8
私のApp.xaml
<Application
x:Class="SpinrWindowsMobile.App"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone"
xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone"
>
<!--Application Resources-->
<Application.Resources >
<ResourceDictionary>
<local:LocalizedStrings xmlns:local="clr-namespace:SpinrWindowsMobile" x:Key="LocalizedStrings"/>
<converter:TextColorConverter xmlns:converter="clr-namespace:SpinrWindowsMobile.Common" x:Key="TextColorConverter"></converter:TextColorConverter>
</ResourceDictionary>
</Application.Resources>
....
</Application>
ある
SpinrWindowsMobile.Common アプリを起動すると、それは私に例外を与えている間
タイプSpinrWindowsMobile.Common.TextColorConverterのインスタンスを作成できません。私はどこに行方がないのか分からない。以下 は、私は私の開発ツールとして、Windows Phone用のMicrosoftのVisual Studio 2012を使用しています私の
TextColorConverter.csクラス
class TextColorConverter : IValueConverter
{
public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
{
// some code
}
public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
{
// some code
}
}
です。 私が共有したいことがもう1つありません。ValueConverstionAttributeクラスをに設定しました。System.Windows.Data名前空間。 私が間違っているところは誰でも案内できますか?
おかげpaul.Youは私の貴重な労働時間を救いました。 –