Custom Editor in Custom Control Library

Editors for WPF Forum

Posted 8 years ago by John Dunn
Version: 11.1.0540
Avatar
I have a working custom editor that I'd like to move to a Custom Control Library so I can use it in multiple places. I've moved the code over and it all compiles but I can't get the styles to work. Is there anything special I need to do so I can use these controls when referenced by another assembly?

I've uploaded my Custom Control Library here.

Comments (2)

Posted 8 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
Hi John,

You would need to merge the IpAddressEditor\Resources.xaml contents into your Themes\Generic.xaml. The Resources.xaml file will not be automatically loaded for you. The Generic.xaml will be automatically loaded though.

Our Custom PartEditBox sample used Resources.xaml to keep the code together, and it was merged as needed.


Actipro Software Support

Posted 8 years ago by John Dunn
Avatar
Thanks.

Copying and pasting the contents of IpAddressEditor\Resources into Themes\Generic.xaml works. I would rather merge it but the following doesn't work - no style is applied


<ResourceDictionary
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
  
  <ResourceDictionary.MergedDictionaries>
    <ResourceDictionary Source="/IpAddressLibrary;component/Themes/IpAddress.xaml" />    
  </ResourceDictionary.MergedDictionaries>

</ResourceDictionary>

I've made sure that both Generic.xaml and IpAddress.xaml are set as Resource for Build Action. Any idea what might be the issue?

EDIT : Never mind. Switched them both to Page and it worked. Thanks again.

[Modified at 02/10/2011 11:55 AM]
The latest build of this product (v2018.1 build 0675) was released 8 days ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.