ActualWidth / ActualHeight will give you the actual window dimensions specified by the layout system, which is based on the actual rendering of the window. These should be the sizes you are looking for. However, there may be a slight delay in the calculation, because it is based on rendering, so if they are wrong, I think they have not been calculated yet - and you have a race condition. You can learn more about this in the links above, where there are some important notes about when the actual sizes are calculated, and therefore why they might be delayed.
Width / Height dimensions are requested, and if they are not specified explicitly, they will adhere to the default values, which are Double.NaN.
source
share