I have been trying to create a Data Binding so that a WrapPanel automatically resizes horizontally to match it's container (a StackPanel) when the window is resized, to no success.
I started to search how to do it, and at I arrived to this
Binding SomeBinding = new Binding ();
SomeBinding.Source = SomeEntry;
SomeBinding.UpdateSourceTrigger = UpdateSourceTrigger.PropertyChanged;
SomeBinding.Path = new PropertyPath ("Width");
SomeBinding.Mode = BindingMode.OneWay;
SomeStackPanel.SetBinding (StackPanel.WidthProperty, SomeBinding);
But it doesn't do anything when the window is resized. I looked at examples, but I don't really see the issue. Can someone explain what is wrong with the above snippet?
SomeEntry? Why useReportBindingwhen you just createdSomeBinding? All that shouldn't be necessary at all, since a WrapPanel inside a vertical StackPanel already stretches horizontally.