Reputation: 1
I have a main window where I want the "anchor" to be the right so that the window will expand to the left when the width changes. I did this by overriding the OnRenderSizeChanged event like so:
protected override void OnRenderSizeChanged(SizeChangedInfo sizeInfo)
{
var vm = DataContext as MainViewModel;
var widthDif = sizeInfo.NewSize.Width - sizeInfo.PreviousSize.Width;
Left -= widthDif;
}
The problem with this approach is that there is a flickering effect when this occurs as you see the window move to the left. Any ideas on how to fix this? Thanks.
Upvotes: 0
Views: 128