I have a XAML element (grid) which has it's horizontal and vertical alignment set to "Stretch".
I want to get the width and the height of the grid when it's on the screen and reflect that to my property in my viewmodel (not the property telling the grid how big it should be but the other way around).
I've tried multiple variations of this but none work:
<Grid Margin="100" Name="mainHMapGrid" Background="Transparent"
HorizontalAlignment="Stretch" VerticalAlignment="Stretch"
Width="{Binding HMapGridWidth, Mode=OneWay,
UpdateSourceTrigger=PropertyChanged}"
Height="{Binding HMapGridHeight, Mode=OneWay,
UpdateSourceTrigger=PropertyChanged}
<Grid Margin="100" Name="mainHMapGrid" Background="Transparent"
HorizontalAlignment="Stretch" VerticalAlignment="Stretch"
Width="{Binding HMapGridWidth, Mode=OneWayToSource,
UpdateSourceTrigger=PropertyChanged}"
Height="{Binding HMapGridHeight, Mode=OneWayToSource,
UpdateSourceTrigger=PropertyChanged}
<Grid Margin="100" Name="mainHMapGrid" Background="Transparent"
HorizontalAlignment="Stretch" VerticalAlignment="Stretch"
Width="{Binding HMapGridWidth, Mode=TwoWay,
UpdateSourceTrigger=PropertyChanged}"
Height="{Binding HMapGridHeight, Mode=TwoWay,
UpdateSourceTrigger=PropertyChanged}
What am I missing?...