Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Extended WPF Toolkit - using the RichTextBoxFormatBar

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.

like image 834
GrandMasterFlush Avatar asked Nov 29 '22 17:11

GrandMasterFlush


2 Answers

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.

like image 135
GrandMasterFlush Avatar answered Dec 16 '22 12:12

GrandMasterFlush


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.

like image 41
Clint StLaurent Avatar answered Dec 16 '22 12:12

Clint StLaurent