Windows phone 7 本地化默认windows phone日期选择器

Windows phone 7 本地化默认windows phone日期选择器,windows-phone-7,localization,toolkit,Windows Phone 7,Localization,Toolkit,我已经本地化了整个应用程序,但无法本地化日期选择器。论坛上的一些搜索给了我一些答案 但我找不到不同lang for toolkit的resx属性文件夹!我已经在解决方案资源管理器的reference下添加了toolkit引用,这样我就可以访问日期选择器了。我制作了一个名为toolkit.content的文件夹,用于放置“确定”和“取消”图像 那么,我如何为工具箱日期选择器添加resx:(您必须获取工具箱的源代码,并使用您的本地化重新构建它 您必须获取工具包的源代码,并使用本地化重新构建它 您还可

我已经本地化了整个应用程序,但无法本地化日期选择器。论坛上的一些搜索给了我一些答案

但我找不到不同lang for toolkit的resx属性文件夹!我已经在解决方案资源管理器的reference下添加了toolkit引用,这样我就可以访问日期选择器了。我制作了一个名为toolkit.content的文件夹,用于放置“确定”和“取消”图像


那么,我如何为工具箱日期选择器添加resx:(

您必须获取工具箱的源代码,并使用您的本地化重新构建它


您必须获取工具包的源代码,并使用本地化重新构建它


您还可以创建从原始日期选择器继承的自定义控件

 public class MyDatePicker : Microsoft.Phone.Controls.DatePicker
{
    public string PickerPageHeader
    {
        get { return (string)GetValue(PickerPageHeaderProperty); }
        set { SetValue(PickerPageHeaderProperty, value); }
    }

    // Using a DependencyProperty as the backing store for PickerPageHeader.  This enables animation, styling, binding, etc...
    public static readonly DependencyProperty PickerPageHeaderProperty =
        DependencyProperty.Register("PickerPageHeader", typeof(string), typeof(MyDatePicker)
        , new PropertyMetadata("Choose date text in your language"));

    public MyDatePicker()
    {
        base.PickerPageUri = new Uri("/Sample;component/CustomControls/MyDatePickerPage.xaml?Header=" + PickerPageHeader, UriKind.Relative);
       //Don't forget to change the project name and xaml location
    }
}
并在CustomControls文件夹中创建选择器页面xaml文件:

<toolkit:DatePickerPage
x:Class="Sample.MyDatePickerPage"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:toolkit="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone.Controls.Toolkit"
/>

还可以创建从原始日期选择器继承的自定义控件

 public class MyDatePicker : Microsoft.Phone.Controls.DatePicker
{
    public string PickerPageHeader
    {
        get { return (string)GetValue(PickerPageHeaderProperty); }
        set { SetValue(PickerPageHeaderProperty, value); }
    }

    // Using a DependencyProperty as the backing store for PickerPageHeader.  This enables animation, styling, binding, etc...
    public static readonly DependencyProperty PickerPageHeaderProperty =
        DependencyProperty.Register("PickerPageHeader", typeof(string), typeof(MyDatePicker)
        , new PropertyMetadata("Choose date text in your language"));

    public MyDatePicker()
    {
        base.PickerPageUri = new Uri("/Sample;component/CustomControls/MyDatePickerPage.xaml?Header=" + PickerPageHeader, UriKind.Relative);
       //Don't forget to change the project name and xaml location
    }
}
并在CustomControls文件夹中创建选择器页面xaml文件:

<toolkit:DatePickerPage
x:Class="Sample.MyDatePickerPage"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:toolkit="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone.Controls.Toolkit"
/>

它非常简单:参数语言。 Xaml代码:

<toolkit:DatePicker Language="ru-RU" Margin="-12, 0" Value="{Binding BirthDate, Mode=TwoWay}" />

非常简单:参数-语言。 Xaml代码:

<toolkit:DatePicker Language="ru-RU" Margin="-12, 0" Value="{Binding BirthDate, Mode=TwoWay}" />


我确实下载了源代码并进行了修改,现在如何添加此工具包?我找不到dll:(工具箱的源代码生成到根父级。因此,无论您在哪里提取源代码,它都是一个Bin文件夹。它应该位于其中的调试或发布文件夹中。我已修复了它。这是一个有用的博客。我下载了源代码,进行了修改,现在如何添加此工具箱?我找不到dll:(工具包的源代码生成到根父级。因此,无论您在哪里提取源代码,都是一个Bin文件夹。它应该位于其中的Debug或Release文件夹中。我修复了它。这是一个有用的博客。)