Customize BrushEditor

Editors for WPF Forum

Posted 8 years ago by Moondance
Version: 16.1.0633
Avatar

Hello, I need to customize the BrushEditor by

1) Add a remove button to remove gradientstop (nobody can figure out they can remove stops by dragging)

2) Add a spinner that shows and modifies the offset of the seleted stop

 

I modified the BrushEditor.xaml by adding:


<Button Style="{DynamicResource {x:Static ToolBar.ButtonStyleKey}}"
Command="{x:Static shared:GradientBrushSlider.RemoveStopCommand}"
CommandTarget="{Binding ElementName=gradientBrushSlider}"
ToolTip="Remove Stop" IsEnabled="{Binding ElementName=gradientBrushSlider, Path=CanRemoveStops}">
<Rectangle Height="12" Width="12" Fill="{StaticResource StopBrush}" />
</Button>
</StackPanel>
<primitives:DoubleEditBox Grid.Row="10" Grid.Column="5" Margin="40,3,0,0"
VerticalAlignment="Center" Width="50" StepValue="0.01" SpinnerVisibility="Visible"
SpinnerInactiveVisibility="Visible" Minimum="0" Maximum="1" Format="F2"
Value="{Binding ElementName=gradientBrushSlider,Path=SelectedStop.Offset, Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"
Visibility="{Binding ElementName=gradientActionButtons, Path=Visibility}" />

Everything works except the setting of the offset via spinner. Is there a way to achieve this by just modifying this xaml file?

Comments (3)

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

Hello,

Unfortunately I don't think that's possible since we can't detect external changes made to the GradientStop.Offset property.  Sorry but I don't think there's another way to change things purely via XAML.


Actipro Software Support

Posted 8 years ago by Moondance
Avatar

I understand. Is there a way for me to place a request for this in the next release/patch? If there is a plus sign it is reasonable to expect a minus sign as well. Also it would be nice to give the user the ability to set the gradient offset with more precision and ease than just by using the slider.

[Modified 8 years ago]

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

Hello,

We will try to add the Remove Stop button for the next maintenance release.  As for adding another editor for setting the selected stop's offset, we will log that as a suggestion for now.


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.