【问题标题】:Where is the Silverlight Calendar Control?Silverlight 日历控件在哪里?
【发布时间】:2008-10-17 18:16:08
【问题描述】:

只是在玩现在发布的 Silverlight 2.0。我正在尝试将一个简单的日历放入控件中。但是该项目似乎不知道我在说什么:-

<UserControl x:Class="MyFirstSL2.Test"
 xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
 xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
>
  <Grid Background="#FF5C7590">
    <Calendar />
  </Grid>
</UserControl>

Visual Studio 2008 只是在日历下方放置蓝线,表示找不到日历类型。我需要添加一个程序集吗?哪一个?我需要向 Xaml 添加另一个命名空间吗?

【问题讨论】:

    标签: visual-studio-2008 silverlight xaml


    【解决方案1】:

    日历控件是程序集 System.Windows.Controls 命名空间中的 SDK 控件 -- 查看 %program files%\Microsoft SDKs\Silverlight\v2.0\Libraries\Client 将命名空间添加到您的 xaml(添加后参考):

    xmlns:basics="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls"
    

    然后使用:

    <basics:Calendar />
    

    希望这会有所帮助!

    【讨论】:

      【解决方案2】:

      添加对

      的引用

      C:\Program Files\Microsoft SDKs\Silverlight\v2.0\Libraries\Client

      system.windows.controls.dll

      使用 Expressions Blend 或 VS2008 SP1 将控件添加到 UI

      【讨论】:

        【解决方案3】:

        我很确定 Silverlight 中没有类似于 ASP.Net 控件或 windows 窗体控件的日历控件。我很确定没有像 WPF 这样的预打包控件。

        【讨论】:

        • 哈哈。好的,所以我想有一个:)
        • 微软也为 WPF 发布了一个。检查 CodePlex。
        【解决方案4】:

        我没有试图弄清楚该工具包如何允许嵌入日历控件,而是在http://slcalendarcontrol.codeplex.com/这里创建了一个自定义控件@查看。

        【讨论】:

          猜你喜欢
          • 1970-01-01
          • 1970-01-01
          • 1970-01-01
          • 1970-01-01
          • 1970-01-01
          • 2011-07-21
          • 1970-01-01
          • 1970-01-01
          • 1970-01-01
          相关资源
          最近更新 更多