C# 扩展 WPF 工具包 - 如何添加对项目的引用?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/14809446/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Extended WPF Toolkit - How to add reference to project?
提问by Mahesh Alle
I am new to WPF. I want to use datetime picker. I have downloaded the "Extended WPF Toolkit - 1.9.0" from below site.
我是 WPF 的新手。我想使用日期时间选择器。我已经从下面的站点下载了“扩展 WPF 工具包 - 1.9.0”。
http://wpftoolkit.codeplex.com/releases/view/96972
http://wpftoolkit.codeplex.com/releases/view/96972
I have unzip file and found two dll. One is "WPFToolkit.dll" and "Xceed.Wpf.Toolkit.dll".
我解压了文件并找到了两个 dll。一种是“WPFToolkit.dll”和“Xceed.Wpf.Toolkit.dll”。
Now How to add these two dll in my project? and How to use datetime control in my project.
现在如何在我的项目中添加这两个 dll?以及如何在我的项目中使用日期时间控制。
采纳答案by Anand Murali
First, reference those dlls in your project.
Right click on References
in the Solution Explorer and click Add Reference
, now browse and add the two dlls.
首先,在您的项目中引用这些 dll。在解决方案资源管理器中
右键单击References
并单击Add Reference
,现在浏览并添加两个 dll。
Second, build the project once to enable intellisense in XAML for the newly added dlls.
其次,构建一次项目以在 XAML 中为新添加的 dll 启用智能感知。
Third, in your XAML file add the following namespace
第三,在您的 XAML 文件中添加以下命名空间
xmlns:wpfTool="clr-namespace:Xceed.Wpf.Toolkit;assembly=Xceed.Wpf.Toolkit"
Tip: Type xmlns:customName="wpftool"
and you should be able to see the intellisense list all the relevant namespaces.
提示:键入xmlns:customName="wpftool"
,您应该能够看到智能感知列表所有相关的命名空间。
Heres the XAML code:
下面是 XAML 代码:
<Window x:Class="WpfApplication1.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:wpfTool="clr-namespace:Xceed.Wpf.Toolkit;assembly=Xceed.Wpf.Toolkit"
Title="MainWindow" Height="350" Width="525">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="*"/>
<RowDefinition Height="*"/>
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions>
<wpfTool:DateTimePicker Grid.Row="0">
</wpfTool:DateTimePicker>
</Grid>
</Window>
回答by for-each
If you want to stick to the method you are currently using, right-click on your project then choose Add Reference. Go to Browse and locate the dlls you downloaded.
如果您想坚持当前使用的方法,请右键单击您的项目,然后选择添加引用。转到“浏览”并找到您下载的 dll。
or
或者
Download NuGet here. It's much easier to install third-party libraries.
在此处下载 NuGet 。安装第三方库要容易得多。
回答by jithesh
Installation Extended Toolkit using NuGet
使用 NuGet 安装扩展工具包
Install NuGet
Open your Visual Studio.
Open your solution/project.
Open Tools menu, select Library Package Manager and select Package Manager Console
Run the following command "Install-Package Extended.Wpf.Toolkit"
then try you will get the namespace.
然后尝试你会得到命名空间。
NuGet package page(available since 17 June 2016)
NuGet 包页面(自 2016 年 6 月 17 日起提供)
回答by Sawarkar vikas
Graphical Way to add the controls in VS 2013
在 VS 2013 中添加控件的图形方式
- First, reference those dlls in your project.
- Right click on References in the Solution Explorer and click Add Reference, now browse and add the two dlls.
- Right Click to toolbox > General Area and Choose "Add Tab" - Give the name to the Tab say "WPF Toolkit Controls"!
- Now Clcik on Choose Items..It opens choose toolbox Items dialog box...!
- In WPF Component tab - Now Click on Browse button and locate the downloaded dll and click on open
- WPF Component Tab will show all the control
- By Clicking on OK "WPF Toolkit Controls" will populate all the controls of the WPF Toolkit
- Now Drag and Drop the Required Control - It will automatically add the namespace reference required.
- 首先,在您的项目中引用这些 dll。
- 右键单击解决方案资源管理器中的引用,然后单击添加引用,现在浏览并添加两个 dll。
- 右键单击工具箱 > 常规区域并选择“添加选项卡” - 为选项卡命名为“WPF 工具包控件”!
- 现在点击选择项目..它打开选择工具箱项目对话框......!
- 在 WPF 组件选项卡中 - 现在单击浏览按钮并找到下载的 dll 并单击打开
- WPF Component Tab 将显示所有控件
- 单击确定“WPF Toolkit Controls”将填充 WPF Toolkit 的所有控件
- 现在拖放所需的控件 - 它将自动添加所需的命名空间引用。
回答by Wouter
In XAML you should add:
在 XAML 中,您应该添加:
For AvalonDock:
对于 AvalonDock:
xmlns:xcad="http://schemas.xceed.com/wpf/xaml/avalondock"
For WPF Toolkit:
对于 WPF 工具包:
xmlns:xctk="http://schemas.xceed.com/wpf/xaml/toolkit"