Closed PJonHar closed 3 years ago
Could you remove the FallbackValue
and try it again?
I have seen very strange behavior of bindings in combination with fallback values recently.
I have tried removing the FallbackValue but the value doesnt show on the ribbon button.
Could you share a repro?
Sure, see attached.
That's quite strange. Most controls in Fluent.Ribbon use a TemplateBinding for the header, which does not seem to work when the bound value is not a string. It works again if using a Binding with a relative source...
If possible could you show me a workaround please?
A workaround for you would be:
public string ProgramSpeedString { get => programSpeed.ToString(); }
public int ProgramSpeed { get => programSpeed; set { programSpeed = value; NotifyPropertyChanged(nameof(ProgramSpeed)); NotifyPropertyChanged(nameof(ProgramSpeedString)); } }
And then bind to ProgramSpeedString instead of ProgramSpeed.
Thanks. I ended up using a converter to return the ToString() of an object.
I have added a binding to the header property of a fluent.button, however when the application is running the value is not seen? I have used snoop and i can see that the binding is happy and with the correct value but it does not show?
the value 100 should be showing in the button header.
any ideas?
`<Fluent:Button Command="{Binding ProgramSpeedCommand}" Header="{Binding ApplicationRobotControl.Robot.ProgramSpeed, FallbackValue=0}" Icon="pack://application:,,,/KUKA.RGI v3;component/Icons/hand.ico" LargeIcon="pack://application:,,,/KUKA.RGI v3;component/Icons/hand.ico">