我在论坛和 msdn 上到处搜索,它说 SelectedDate、DisplayStartDate、DisplayEndDate,无论是在 XAML 还是 C# 中都可以使其工作,但是每次我尝试使用任何这些时,我都会丢失指令引用或程序集。我该如何解决?我知道我缺少一个参考,但是使用 System 或 xlmns ....?请告诉我如何使其工作,以便在我尝试使用该属性时不会出错。
XAML 代码和参考:
x:Class="Data_Query.MainPage"
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"
xmlns:toolkit="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone.Controls.Toolkit"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d"
FontFamily="{StaticResource PhoneFontFamilyNormal}"
FontSize="{StaticResource PhoneFontSizeNormal}"
Foreground="{StaticResource PhoneForegroundBrush}"
SupportedOrientations="Portrait" Orientation="Portrait"
shell:SystemTray.IsVisible="True">
<toolkit:DatePicker HorizontalAlignment="Left" VerticalAlignment="Top" x:Name="dateOfBirthPicker" ValueChanged="dateOfBirthPicker_ValueChanged" Margin="0,369,0,0"/>
Run Code Online (Sandbox Code Playgroud)
C# 代码参考:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Navigation;
using System.Windows.Media; // added to support SolidColorBrush, FontWeights, etc...
using Microsoft.Phone.Controls;
using Microsoft.Phone.Shell;
using Data_Query.Resources;
using System.Windows.Input;
using System.Windows.Media.Animation;
using System.Text.RegularExpressions;
Run Code Online (Sandbox Code Playgroud)
完整的 XAML 代码:
<!--LayoutRoot is …Run Code Online (Sandbox Code Playgroud)