Hello everyone,
I need to get the dynamical Height and Width of my Viewbox
The hierarchy of my xaml is like this:
<Grid>
<DockPanel>
<Border>
<ViewBox/>
</border>
</DockPanel>
</Grid>
The Viewbox Width is on "Auto" and the Height is binded to a variable in my Controller.
The Class hierarchy is like this:
Xaml <--> Controller
(the xaml.cs is mostly ignored)
Now my problem is that even in the direct code-behind (xaml.cs), I get 0 as ActualWidth and ActualHeight. So I don't even get the standart Width and Height not to mention the dynamical one if I change the dimension of my mainwindow.
If Code-Snippets or information are missing. Please tell me.
Regards
Richard
What I have tried:
I tried to get the Dimensions with in the Code-Behind:
Height/Width (Only get the standard Height and NaN for Width)
ActualHeight/ActualWidth (both are 0)
RenderSize.Height/RenderSize.Width (both are 0)