Adding user control as the DropDownContent of the BrushEditBox

Editors for WPF Forum

Posted 11 years ago by Karen Johnson
Version: 12.2.0573
Avatar

I could like to add my own user control as the DropDownContent for the BrushEditBox (which I am using in my PropertyGrid), but I am having trouble binding the value of my user control to the BrushEditBox.

I tried doing something like this in my xaml:

     <editors:BrushEditBox Value="{Binding Value}">

          <editors:BrushEditBox.DropDownContent>

                   <MyUserControl Value="{Binding Value, RelativeSource={RelativeSource AncestorType={x:Type propgrid:IPropertyDataAccessor}},
Mode=TwoWay>
                   </MyUserControl>

          </editors:BrushEditBox.DropDownContent>

     </editors:BrushEditBox>-->

 

Any suggestions please?

Comments (3)

Answer - Posted 11 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar

Hi KC,

Our default template for the DropDownContentTemplate does this when binding the BrushEditor's Brush property to the parent BrushEditBox:

Brush="{Binding Value, RelativeSource={RelativeSource AncestorType={x:Type editors:BrushEditBox}}}"


Actipro Software Support

Posted 11 years ago by Karen Johnson
Avatar

I am still having a problem with the binding.  The values don't seem to bind up, but when I use Snoop to look at the values then the binding occurs.

I changed my xaml to your example, and I'm seeing the same issue.  Am I missing something?

   <editors:BrushEditBox Value="{Binding Value}">

      <editors:BrushEditBox.DropDownContent>

         <editors:BrushEditor Brush="{Binding Value, RelativeSource={RelativeSource AncestorType={x:Type editors:BrushEditBox}}}">
         </editors:BrushEditor>

      </editors:BrushEditBox.DropDownContent>

   </editors:BrushEditBox>-->

Posted 11 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar

Hi KC,

I'm not sure, but one difference I see is that we set the DropDownContentTemplate instead of the DropDownContent.  Our DataTemplate has a BrushEditor in it that binds the way I said.

I believe your company has WPF Studio so someone listed on the company account can download the default styles/templates for you.  You can look in the Editors/Themes/Includes/Styles/PartEditBox.xaml file to see our default setup.  That may help too.


Actipro Software Support

The latest build of this product (v24.1.1) was released 2 months ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.