HexView.Wpf icon indicating copy to clipboard operation
HexView.Wpf copied to clipboard

Change view offset via binding?

Open josh2112 opened this issue 1 year ago • 0 comments

First of all, I love this control!!

I want to be able to move the viewer to a predefined position when I press a button. I thought the Offset dependency property would do the job here:

<Button Command="{Binding JumpToOffsetCommand}"/>
<hv:HexViewer x:Name="hexViewer" DataSource="{Binding MemoryReader}" Offset="{Binding MemoryOffset}"/>
[ObservableProperty]
private long _memoryOffset;

[RelayCommand]
public void JumpToOffset() => MemoryOffset = 0x192;

The command is working and MemoryOffset is firing a property-changed notification as per the Community MVVM Toolkit docs, but the hex viewer doesn't move.

However, if I set the Offset property directly on the control, it works:

hexViewer.Offset = 0x192;

Is there something going on with the OffsetProperty dependency property here?

josh2112 avatar Nov 02 '23 00:11 josh2112