小编Fra*_*Fra的帖子

Windows Phone 8.1 - 转换器无法使用平台目标ARM

我在Windows Phone 8.1上开发了应用程序.我的几个页面都有自定义转换器; 例如:

 using System;
 using System.Globalization;
 using Windows.UI.Xaml.Data;

 namespace XXXXX.Model.Converters
 {
     public sealed class DateTimeToStringConverter : IValueConverter
     {
         public object Convert(object value, Type targetType, object parameter, string language)
         {
             var date = (DateTime)value;

             return date.ToString("g", new CultureInfo("it-IT"));
         }

         public object ConvertBack(object value, Type targetType, object parameter, string language)
         {
             throw new NotImplementedException();
         }
     }
 }
Run Code Online (Sandbox Code Playgroud)

在XAML我有:

 <Page
     x:Class="XXXXX.Views.VehiclesView"
     xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
     xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
     xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
     xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
     xmlns:converters="using:XXXXX.Model.Converters"
     mc:Ignorable="d"
     FontFamily="{StaticResource PhoneFontFamilyNormal}"
     Foreground="{StaticResource PhoneForegroundBrush}">

     <Page.Resources>
         <converters:DateTimeToStringConverter x:Key="DateTimeToStringConverter" />
         <converters:StringFormatConverter x:Key="StringFormatConverter" />
     </Page.Resources>
Run Code Online (Sandbox Code Playgroud)

并以这种方式使用它:

 <TextBlock …
Run Code Online (Sandbox Code Playgroud)

c# arm converter winrt-xaml windows-phone-8.1

5
推荐指数
1
解决办法
1639
查看次数

标签 统计

arm ×1

c# ×1

converter ×1

windows-phone-8.1 ×1

winrt-xaml ×1