Yes, there is an easy way to do this:
1. Create a model class like this:
public class Model
{
public double BorderWidth
{
get { return Window.Current.CoreWindow.Bounds.Width; }
}
}
2. Create an instance of the model and set it as the DataContext of your window. I go the simple way and do it like this:
protected override void OnNavigatedTo(NavigationEventArgs e)
{
var model = new Model();
this.DataContext = model;
}
3. Bind the Width-property of the border to the appropriate property of your model like this:
<Border Width="{Binding BorderWidth}">
Hope that helps! If not, please do not hesitate to contact me!
---------------------------------- Robin Sedlaczek @ Microsoft Forums