Extended WPF Toolkit - using the RichTextBoxFormatBar

社会主义新天地 提交于 2019-11-27 18:51:22

问题


I've been trying to use the Extended WPF Toolkit so that I can make use of the RichTextBoxFormatBar but I seem to be going round in cirlces. Despite trying several examples on here and other sites I keep getting the same error messages:

The attachable property 'FormatBar' was not found in type 'RichTextBoxFormatBarManager'.

The type 'toolkit:RichTextBoxFormatBar' was not found. Verify that you are not missing an assembly reference and that all referenced assemblies have been built.

I'm new to WPF so I'm know it's something I'm not picking up on rather than a bug, can anyone tell me what I'm doing wrong and save my sanity?

<UserControl x:Class="TestWPF_Richtextbox.UserControl1" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:toolkit="http://schemas.xceed.com/wpf/xaml/toolkit" mc:Ignorable="d" d:DesignHeight="300" d:DesignWidth="300"> <Grid> <RichTextBox> <toolkit:RichTextBoxFormatBarManager.FormatBar> <toolkit:RichTextBoxFormatBar /> </toolkit:RichTextBoxFormatBarManager.FormatBar> </RichTextBox> </Grid> </UserControl>

EDIT: Both the library and the project are .Net 4. The version of the WPFToolkit.Extended.dll is V.1.6.0.0.


回答1:


My own stupid fault.

I'd forgotten to unblock the DLL when I downloaded it as per the instructions which say that after downloading the ExtendedWPFToolkit_Binaries.zip you should then right click on it, select "Properties" and then "Unblock".

Hopefully this post will help someone else who has made the same mistake.




回答2:


I'm hardly a rookie - but had the same issue. Frankly I've never heard of unblocking a .zip file. Like most people I just skimmed the instructions, after all I know how unzip a file - or so I thought.

I had fought with extended toolkit 1.9.0 for two hours because my app would compile, run and work, but VS12 designer couldn't render the window. THen I saw the above post about unblocking the zip before expanding. Thought to myself "whiskey tango foxtrot" is this guy talking about. But I was desperate, so I closed VS. Deleted my expanded files. This time did the unblock. THen expanded into the very same locations. Restarted Visual Studio and to my amazement the designer now renders the controls and don't complain about the WatermarkTextBox not being in the namespace etc.

Really a humbling experience about reading the directions more closely.




回答3:


This same thing happened to me and I eventually figured out it was either because I had the dll or the solution stored on the network instead of my local computer. I moved both to the local computer and it started working.



来源:https://stackoverflow.com/questions/10188373/extended-wpf-toolkit-using-the-richtextboxformatbar

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!