Custom dependency property won't update the source
I'm creating a custom control, and I want to add a dependency property which works like CheckBox.IsChecked, i.e. when the user clicks the control the binding will update the source. The declaration for this custom control is as follows:
public class QuadStateSelector : Control
{
static QuadStateSelector()
{
PropertyChangedCallback callback = new PropertyChangedCallback(OnValueChanged);
FrameworkPropertyMetadata md = new FrameworkPropertyMetadata(0, callback);
md.BindsTwoWayByDefault = true;
md.DefaultUpdateSourceTrigger = System.Windows.Data.UpdateSourceTrigger.PropertyChanged;
ValueProperty = DependencyProperty.Register(nameof(Value), typeof(int), typeof(QuadStateSelector), md);
DefaultStyleKeyProperty.OverrideMetadata(typeof(QuadStateSelector), new FrameworkPropertyMetadata(typeof(QuadStateSelector)));
}
private static void OnValueChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
{
}
public int Value
{
get { return (int)this.GetValue(ValueProperty); }
set { this.SetValue(ValueProperty, value); }
}
public static readonly DependencyProperty ValueProperty;
As you can see, the default binding is 2 way, triggered on a source changed. I've also added a callback so that I can see when the property changes.
My XAML is:
<rt:QuadStateSelector Name="qss" Value="{Binding LineState}" Canvas.Left="262" Canvas.Top="10" Background="Azure"/>
<xctk:IntegerUpDown Value="{Binding ElementName=qss, Path=Value }"/>
And my source is:
public int LineState
{
get => _LineState;
set => _LineState = value; // This line is never called
}
Changes to the value of the dependency property are being made by event triggers in the control template, as below:
<Style TargetType="{x:Type local:QuadStateSelector}">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type local:QuadStateSelector}">
<StackPanel Orientation="Horizontal" Background="{Binding Background, RelativeSource={RelativeSource TemplatedParent}}">
<Ellipse Margin="1,0,1,0" Name="Button1" Width="14" Height="14" Stroke="{Binding Button1Brush, RelativeSource={RelativeSource TemplatedParent}}" StrokeThickness="2" Fill="AntiqueWhite"/>
<Ellipse Margin="1,0,1,0" Name="Button2" Width="14" Height="14" Stroke="{Binding Button2Brush, RelativeSource={RelativeSource TemplatedParent}}" StrokeThickness="2" Fill="AntiqueWhite"/>
<Ellipse Margin="1,0,1,0" Name="Button3" Width="14" Height="14" Stroke="{Binding Button3Brush, RelativeSource={RelativeSource TemplatedParent}}" StrokeThickness="2" Fill="AntiqueWhite"/>
<Ellipse Margin="1,0,1,0" Name="Button4" Width="14" Height="14" Stroke="{Binding Button4Brush, RelativeSource={RelativeSource TemplatedParent}}" StrokeThickness="2" Fill="AntiqueWhite"/>
</StackPanel>
<ControlTemplate.Triggers>
<Trigger Property="Value" Value="0">
<Setter TargetName="Button1" Property="Fill" Value="{Binding Button1Brush, RelativeSource={RelativeSource TemplatedParent}}"/>
</Trigger>
<Trigger Property="Value" Value="1">
<Setter TargetName="Button2" Property="Fill" Value="{Binding Button2Brush, RelativeSource={RelativeSource TemplatedParent}}"/>
</Trigger>
<Trigger Property="Value" Value="2">
<Setter TargetName="Button3" Property="Fill" Value="{Binding Button3Brush, RelativeSource={RelativeSource TemplatedParent}}"/>
</Trigger>
<Trigger Property="Value" Value="3">
<Setter TargetName="Button4" Property="Fill" Value="{Binding Button4Brush, RelativeSource={RelativeSource TemplatedParent}}"/>
</Trigger>
<EventTrigger RoutedEvent="Control.MouseDown" SourceName="Button1">
<BeginStoryboard>
<Storyboard>
<Int32AnimationUsingKeyFrames Storyboard.TargetProperty="Value" Duration="0:0:1">
<DiscreteInt32KeyFrame KeyTime="0" Value="0"/>
</Int32AnimationUsingKeyFrames>
</Storyboard>
</BeginStoryboard>
</EventTrigger>
<EventTrigger RoutedEvent="Control.MouseDown" SourceName="Button2">
<BeginStoryboard>
<Storyboard>
<Int32AnimationUsingKeyFrames Storyboard.TargetProperty="Value" Duration="0:0:1">
<DiscreteInt32KeyFrame KeyTime="0" Value="1"/>
</Int32AnimationUsingKeyFrames>
</Storyboard>
</BeginStoryboard>
</EventTrigger>
<EventTrigger RoutedEvent="Control.MouseDown" SourceName="Button3">
<BeginStoryboard>
<Storyboard>
<Int32AnimationUsingKeyFrames Storyboard.TargetProperty="Value" Duration="0:0:1">
<DiscreteInt32KeyFrame KeyTime="0" Value="2"/>
</Int32AnimationUsingKeyFrames>
</Storyboard>
</BeginStoryboard>
</EventTrigger>
<EventTrigger RoutedEvent="Control.MouseDown" SourceName="Button4">
<BeginStoryboard>
<Storyboard>
<Int32AnimationUsingKeyFrames Storyboard.TargetProperty="Value" Duration="0:0:1">
<DiscreteInt32KeyFrame KeyTime="0" Value="3"/>
</Int32AnimationUsingKeyFrames>
</Storyboard>
</BeginStoryboard>
</EventTrigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
There are two interconnected controls and when I run the application, changes in one control are reflected in the other, but only changes made in the IntegerUpDown cause the setter to be triggered. So the event triggers are definitely modifying the dependency property because (a) the property changed callback gets called, and (b) the value in the IntegerUpDown (bound to the dependency property) is updated.
What am I missing here?
c# wpf custom-controls dependency-properties
add a comment |
I'm creating a custom control, and I want to add a dependency property which works like CheckBox.IsChecked, i.e. when the user clicks the control the binding will update the source. The declaration for this custom control is as follows:
public class QuadStateSelector : Control
{
static QuadStateSelector()
{
PropertyChangedCallback callback = new PropertyChangedCallback(OnValueChanged);
FrameworkPropertyMetadata md = new FrameworkPropertyMetadata(0, callback);
md.BindsTwoWayByDefault = true;
md.DefaultUpdateSourceTrigger = System.Windows.Data.UpdateSourceTrigger.PropertyChanged;
ValueProperty = DependencyProperty.Register(nameof(Value), typeof(int), typeof(QuadStateSelector), md);
DefaultStyleKeyProperty.OverrideMetadata(typeof(QuadStateSelector), new FrameworkPropertyMetadata(typeof(QuadStateSelector)));
}
private static void OnValueChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
{
}
public int Value
{
get { return (int)this.GetValue(ValueProperty); }
set { this.SetValue(ValueProperty, value); }
}
public static readonly DependencyProperty ValueProperty;
As you can see, the default binding is 2 way, triggered on a source changed. I've also added a callback so that I can see when the property changes.
My XAML is:
<rt:QuadStateSelector Name="qss" Value="{Binding LineState}" Canvas.Left="262" Canvas.Top="10" Background="Azure"/>
<xctk:IntegerUpDown Value="{Binding ElementName=qss, Path=Value }"/>
And my source is:
public int LineState
{
get => _LineState;
set => _LineState = value; // This line is never called
}
Changes to the value of the dependency property are being made by event triggers in the control template, as below:
<Style TargetType="{x:Type local:QuadStateSelector}">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type local:QuadStateSelector}">
<StackPanel Orientation="Horizontal" Background="{Binding Background, RelativeSource={RelativeSource TemplatedParent}}">
<Ellipse Margin="1,0,1,0" Name="Button1" Width="14" Height="14" Stroke="{Binding Button1Brush, RelativeSource={RelativeSource TemplatedParent}}" StrokeThickness="2" Fill="AntiqueWhite"/>
<Ellipse Margin="1,0,1,0" Name="Button2" Width="14" Height="14" Stroke="{Binding Button2Brush, RelativeSource={RelativeSource TemplatedParent}}" StrokeThickness="2" Fill="AntiqueWhite"/>
<Ellipse Margin="1,0,1,0" Name="Button3" Width="14" Height="14" Stroke="{Binding Button3Brush, RelativeSource={RelativeSource TemplatedParent}}" StrokeThickness="2" Fill="AntiqueWhite"/>
<Ellipse Margin="1,0,1,0" Name="Button4" Width="14" Height="14" Stroke="{Binding Button4Brush, RelativeSource={RelativeSource TemplatedParent}}" StrokeThickness="2" Fill="AntiqueWhite"/>
</StackPanel>
<ControlTemplate.Triggers>
<Trigger Property="Value" Value="0">
<Setter TargetName="Button1" Property="Fill" Value="{Binding Button1Brush, RelativeSource={RelativeSource TemplatedParent}}"/>
</Trigger>
<Trigger Property="Value" Value="1">
<Setter TargetName="Button2" Property="Fill" Value="{Binding Button2Brush, RelativeSource={RelativeSource TemplatedParent}}"/>
</Trigger>
<Trigger Property="Value" Value="2">
<Setter TargetName="Button3" Property="Fill" Value="{Binding Button3Brush, RelativeSource={RelativeSource TemplatedParent}}"/>
</Trigger>
<Trigger Property="Value" Value="3">
<Setter TargetName="Button4" Property="Fill" Value="{Binding Button4Brush, RelativeSource={RelativeSource TemplatedParent}}"/>
</Trigger>
<EventTrigger RoutedEvent="Control.MouseDown" SourceName="Button1">
<BeginStoryboard>
<Storyboard>
<Int32AnimationUsingKeyFrames Storyboard.TargetProperty="Value" Duration="0:0:1">
<DiscreteInt32KeyFrame KeyTime="0" Value="0"/>
</Int32AnimationUsingKeyFrames>
</Storyboard>
</BeginStoryboard>
</EventTrigger>
<EventTrigger RoutedEvent="Control.MouseDown" SourceName="Button2">
<BeginStoryboard>
<Storyboard>
<Int32AnimationUsingKeyFrames Storyboard.TargetProperty="Value" Duration="0:0:1">
<DiscreteInt32KeyFrame KeyTime="0" Value="1"/>
</Int32AnimationUsingKeyFrames>
</Storyboard>
</BeginStoryboard>
</EventTrigger>
<EventTrigger RoutedEvent="Control.MouseDown" SourceName="Button3">
<BeginStoryboard>
<Storyboard>
<Int32AnimationUsingKeyFrames Storyboard.TargetProperty="Value" Duration="0:0:1">
<DiscreteInt32KeyFrame KeyTime="0" Value="2"/>
</Int32AnimationUsingKeyFrames>
</Storyboard>
</BeginStoryboard>
</EventTrigger>
<EventTrigger RoutedEvent="Control.MouseDown" SourceName="Button4">
<BeginStoryboard>
<Storyboard>
<Int32AnimationUsingKeyFrames Storyboard.TargetProperty="Value" Duration="0:0:1">
<DiscreteInt32KeyFrame KeyTime="0" Value="3"/>
</Int32AnimationUsingKeyFrames>
</Storyboard>
</BeginStoryboard>
</EventTrigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
There are two interconnected controls and when I run the application, changes in one control are reflected in the other, but only changes made in the IntegerUpDown cause the setter to be triggered. So the event triggers are definitely modifying the dependency property because (a) the property changed callback gets called, and (b) the value in the IntegerUpDown (bound to the dependency property) is updated.
What am I missing here?
c# wpf custom-controls dependency-properties
The only other snippet that might be relevant is that my control is modifying the Value property in EventTriggers in the default style. I don't see why that would make a difference, but who knows?
– Russell Jones
Nov 15 '18 at 1:56
You aren't showing any code where the control actually modifies the property. The Style and the EventSetters are definitely relevant, so please add them to your question.
– Clemens
Nov 15 '18 at 6:48
add a comment |
I'm creating a custom control, and I want to add a dependency property which works like CheckBox.IsChecked, i.e. when the user clicks the control the binding will update the source. The declaration for this custom control is as follows:
public class QuadStateSelector : Control
{
static QuadStateSelector()
{
PropertyChangedCallback callback = new PropertyChangedCallback(OnValueChanged);
FrameworkPropertyMetadata md = new FrameworkPropertyMetadata(0, callback);
md.BindsTwoWayByDefault = true;
md.DefaultUpdateSourceTrigger = System.Windows.Data.UpdateSourceTrigger.PropertyChanged;
ValueProperty = DependencyProperty.Register(nameof(Value), typeof(int), typeof(QuadStateSelector), md);
DefaultStyleKeyProperty.OverrideMetadata(typeof(QuadStateSelector), new FrameworkPropertyMetadata(typeof(QuadStateSelector)));
}
private static void OnValueChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
{
}
public int Value
{
get { return (int)this.GetValue(ValueProperty); }
set { this.SetValue(ValueProperty, value); }
}
public static readonly DependencyProperty ValueProperty;
As you can see, the default binding is 2 way, triggered on a source changed. I've also added a callback so that I can see when the property changes.
My XAML is:
<rt:QuadStateSelector Name="qss" Value="{Binding LineState}" Canvas.Left="262" Canvas.Top="10" Background="Azure"/>
<xctk:IntegerUpDown Value="{Binding ElementName=qss, Path=Value }"/>
And my source is:
public int LineState
{
get => _LineState;
set => _LineState = value; // This line is never called
}
Changes to the value of the dependency property are being made by event triggers in the control template, as below:
<Style TargetType="{x:Type local:QuadStateSelector}">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type local:QuadStateSelector}">
<StackPanel Orientation="Horizontal" Background="{Binding Background, RelativeSource={RelativeSource TemplatedParent}}">
<Ellipse Margin="1,0,1,0" Name="Button1" Width="14" Height="14" Stroke="{Binding Button1Brush, RelativeSource={RelativeSource TemplatedParent}}" StrokeThickness="2" Fill="AntiqueWhite"/>
<Ellipse Margin="1,0,1,0" Name="Button2" Width="14" Height="14" Stroke="{Binding Button2Brush, RelativeSource={RelativeSource TemplatedParent}}" StrokeThickness="2" Fill="AntiqueWhite"/>
<Ellipse Margin="1,0,1,0" Name="Button3" Width="14" Height="14" Stroke="{Binding Button3Brush, RelativeSource={RelativeSource TemplatedParent}}" StrokeThickness="2" Fill="AntiqueWhite"/>
<Ellipse Margin="1,0,1,0" Name="Button4" Width="14" Height="14" Stroke="{Binding Button4Brush, RelativeSource={RelativeSource TemplatedParent}}" StrokeThickness="2" Fill="AntiqueWhite"/>
</StackPanel>
<ControlTemplate.Triggers>
<Trigger Property="Value" Value="0">
<Setter TargetName="Button1" Property="Fill" Value="{Binding Button1Brush, RelativeSource={RelativeSource TemplatedParent}}"/>
</Trigger>
<Trigger Property="Value" Value="1">
<Setter TargetName="Button2" Property="Fill" Value="{Binding Button2Brush, RelativeSource={RelativeSource TemplatedParent}}"/>
</Trigger>
<Trigger Property="Value" Value="2">
<Setter TargetName="Button3" Property="Fill" Value="{Binding Button3Brush, RelativeSource={RelativeSource TemplatedParent}}"/>
</Trigger>
<Trigger Property="Value" Value="3">
<Setter TargetName="Button4" Property="Fill" Value="{Binding Button4Brush, RelativeSource={RelativeSource TemplatedParent}}"/>
</Trigger>
<EventTrigger RoutedEvent="Control.MouseDown" SourceName="Button1">
<BeginStoryboard>
<Storyboard>
<Int32AnimationUsingKeyFrames Storyboard.TargetProperty="Value" Duration="0:0:1">
<DiscreteInt32KeyFrame KeyTime="0" Value="0"/>
</Int32AnimationUsingKeyFrames>
</Storyboard>
</BeginStoryboard>
</EventTrigger>
<EventTrigger RoutedEvent="Control.MouseDown" SourceName="Button2">
<BeginStoryboard>
<Storyboard>
<Int32AnimationUsingKeyFrames Storyboard.TargetProperty="Value" Duration="0:0:1">
<DiscreteInt32KeyFrame KeyTime="0" Value="1"/>
</Int32AnimationUsingKeyFrames>
</Storyboard>
</BeginStoryboard>
</EventTrigger>
<EventTrigger RoutedEvent="Control.MouseDown" SourceName="Button3">
<BeginStoryboard>
<Storyboard>
<Int32AnimationUsingKeyFrames Storyboard.TargetProperty="Value" Duration="0:0:1">
<DiscreteInt32KeyFrame KeyTime="0" Value="2"/>
</Int32AnimationUsingKeyFrames>
</Storyboard>
</BeginStoryboard>
</EventTrigger>
<EventTrigger RoutedEvent="Control.MouseDown" SourceName="Button4">
<BeginStoryboard>
<Storyboard>
<Int32AnimationUsingKeyFrames Storyboard.TargetProperty="Value" Duration="0:0:1">
<DiscreteInt32KeyFrame KeyTime="0" Value="3"/>
</Int32AnimationUsingKeyFrames>
</Storyboard>
</BeginStoryboard>
</EventTrigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
There are two interconnected controls and when I run the application, changes in one control are reflected in the other, but only changes made in the IntegerUpDown cause the setter to be triggered. So the event triggers are definitely modifying the dependency property because (a) the property changed callback gets called, and (b) the value in the IntegerUpDown (bound to the dependency property) is updated.
What am I missing here?
c# wpf custom-controls dependency-properties
I'm creating a custom control, and I want to add a dependency property which works like CheckBox.IsChecked, i.e. when the user clicks the control the binding will update the source. The declaration for this custom control is as follows:
public class QuadStateSelector : Control
{
static QuadStateSelector()
{
PropertyChangedCallback callback = new PropertyChangedCallback(OnValueChanged);
FrameworkPropertyMetadata md = new FrameworkPropertyMetadata(0, callback);
md.BindsTwoWayByDefault = true;
md.DefaultUpdateSourceTrigger = System.Windows.Data.UpdateSourceTrigger.PropertyChanged;
ValueProperty = DependencyProperty.Register(nameof(Value), typeof(int), typeof(QuadStateSelector), md);
DefaultStyleKeyProperty.OverrideMetadata(typeof(QuadStateSelector), new FrameworkPropertyMetadata(typeof(QuadStateSelector)));
}
private static void OnValueChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
{
}
public int Value
{
get { return (int)this.GetValue(ValueProperty); }
set { this.SetValue(ValueProperty, value); }
}
public static readonly DependencyProperty ValueProperty;
As you can see, the default binding is 2 way, triggered on a source changed. I've also added a callback so that I can see when the property changes.
My XAML is:
<rt:QuadStateSelector Name="qss" Value="{Binding LineState}" Canvas.Left="262" Canvas.Top="10" Background="Azure"/>
<xctk:IntegerUpDown Value="{Binding ElementName=qss, Path=Value }"/>
And my source is:
public int LineState
{
get => _LineState;
set => _LineState = value; // This line is never called
}
Changes to the value of the dependency property are being made by event triggers in the control template, as below:
<Style TargetType="{x:Type local:QuadStateSelector}">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type local:QuadStateSelector}">
<StackPanel Orientation="Horizontal" Background="{Binding Background, RelativeSource={RelativeSource TemplatedParent}}">
<Ellipse Margin="1,0,1,0" Name="Button1" Width="14" Height="14" Stroke="{Binding Button1Brush, RelativeSource={RelativeSource TemplatedParent}}" StrokeThickness="2" Fill="AntiqueWhite"/>
<Ellipse Margin="1,0,1,0" Name="Button2" Width="14" Height="14" Stroke="{Binding Button2Brush, RelativeSource={RelativeSource TemplatedParent}}" StrokeThickness="2" Fill="AntiqueWhite"/>
<Ellipse Margin="1,0,1,0" Name="Button3" Width="14" Height="14" Stroke="{Binding Button3Brush, RelativeSource={RelativeSource TemplatedParent}}" StrokeThickness="2" Fill="AntiqueWhite"/>
<Ellipse Margin="1,0,1,0" Name="Button4" Width="14" Height="14" Stroke="{Binding Button4Brush, RelativeSource={RelativeSource TemplatedParent}}" StrokeThickness="2" Fill="AntiqueWhite"/>
</StackPanel>
<ControlTemplate.Triggers>
<Trigger Property="Value" Value="0">
<Setter TargetName="Button1" Property="Fill" Value="{Binding Button1Brush, RelativeSource={RelativeSource TemplatedParent}}"/>
</Trigger>
<Trigger Property="Value" Value="1">
<Setter TargetName="Button2" Property="Fill" Value="{Binding Button2Brush, RelativeSource={RelativeSource TemplatedParent}}"/>
</Trigger>
<Trigger Property="Value" Value="2">
<Setter TargetName="Button3" Property="Fill" Value="{Binding Button3Brush, RelativeSource={RelativeSource TemplatedParent}}"/>
</Trigger>
<Trigger Property="Value" Value="3">
<Setter TargetName="Button4" Property="Fill" Value="{Binding Button4Brush, RelativeSource={RelativeSource TemplatedParent}}"/>
</Trigger>
<EventTrigger RoutedEvent="Control.MouseDown" SourceName="Button1">
<BeginStoryboard>
<Storyboard>
<Int32AnimationUsingKeyFrames Storyboard.TargetProperty="Value" Duration="0:0:1">
<DiscreteInt32KeyFrame KeyTime="0" Value="0"/>
</Int32AnimationUsingKeyFrames>
</Storyboard>
</BeginStoryboard>
</EventTrigger>
<EventTrigger RoutedEvent="Control.MouseDown" SourceName="Button2">
<BeginStoryboard>
<Storyboard>
<Int32AnimationUsingKeyFrames Storyboard.TargetProperty="Value" Duration="0:0:1">
<DiscreteInt32KeyFrame KeyTime="0" Value="1"/>
</Int32AnimationUsingKeyFrames>
</Storyboard>
</BeginStoryboard>
</EventTrigger>
<EventTrigger RoutedEvent="Control.MouseDown" SourceName="Button3">
<BeginStoryboard>
<Storyboard>
<Int32AnimationUsingKeyFrames Storyboard.TargetProperty="Value" Duration="0:0:1">
<DiscreteInt32KeyFrame KeyTime="0" Value="2"/>
</Int32AnimationUsingKeyFrames>
</Storyboard>
</BeginStoryboard>
</EventTrigger>
<EventTrigger RoutedEvent="Control.MouseDown" SourceName="Button4">
<BeginStoryboard>
<Storyboard>
<Int32AnimationUsingKeyFrames Storyboard.TargetProperty="Value" Duration="0:0:1">
<DiscreteInt32KeyFrame KeyTime="0" Value="3"/>
</Int32AnimationUsingKeyFrames>
</Storyboard>
</BeginStoryboard>
</EventTrigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
There are two interconnected controls and when I run the application, changes in one control are reflected in the other, but only changes made in the IntegerUpDown cause the setter to be triggered. So the event triggers are definitely modifying the dependency property because (a) the property changed callback gets called, and (b) the value in the IntegerUpDown (bound to the dependency property) is updated.
What am I missing here?
c# wpf custom-controls dependency-properties
c# wpf custom-controls dependency-properties
edited Nov 15 '18 at 23:58
Russell Jones
asked Nov 15 '18 at 1:30
Russell JonesRussell Jones
113
113
The only other snippet that might be relevant is that my control is modifying the Value property in EventTriggers in the default style. I don't see why that would make a difference, but who knows?
– Russell Jones
Nov 15 '18 at 1:56
You aren't showing any code where the control actually modifies the property. The Style and the EventSetters are definitely relevant, so please add them to your question.
– Clemens
Nov 15 '18 at 6:48
add a comment |
The only other snippet that might be relevant is that my control is modifying the Value property in EventTriggers in the default style. I don't see why that would make a difference, but who knows?
– Russell Jones
Nov 15 '18 at 1:56
You aren't showing any code where the control actually modifies the property. The Style and the EventSetters are definitely relevant, so please add them to your question.
– Clemens
Nov 15 '18 at 6:48
The only other snippet that might be relevant is that my control is modifying the Value property in EventTriggers in the default style. I don't see why that would make a difference, but who knows?
– Russell Jones
Nov 15 '18 at 1:56
The only other snippet that might be relevant is that my control is modifying the Value property in EventTriggers in the default style. I don't see why that would make a difference, but who knows?
– Russell Jones
Nov 15 '18 at 1:56
You aren't showing any code where the control actually modifies the property. The Style and the EventSetters are definitely relevant, so please add them to your question.
– Clemens
Nov 15 '18 at 6:48
You aren't showing any code where the control actually modifies the property. The Style and the EventSetters are definitely relevant, so please add them to your question.
– Clemens
Nov 15 '18 at 6:48
add a comment |
0
active
oldest
votes
Your Answer
StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53311190%2fcustom-dependency-property-wont-update-the-source%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
0
active
oldest
votes
0
active
oldest
votes
active
oldest
votes
active
oldest
votes
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53311190%2fcustom-dependency-property-wont-update-the-source%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
The only other snippet that might be relevant is that my control is modifying the Value property in EventTriggers in the default style. I don't see why that would make a difference, but who knows?
– Russell Jones
Nov 15 '18 at 1:56
You aren't showing any code where the control actually modifies the property. The Style and the EventSetters are definitely relevant, so please add them to your question.
– Clemens
Nov 15 '18 at 6:48