A square FrameworkElement in XAML fitting/filling its parent for Windows Store 8 or Windows Phone 8 -
i'd have frameworkelement in xaml equal width , height, fitting (or filling) parent, without hardcoding width , height specific values, both windows store 8 , windows phone 8 (not same solution).
for purpose of example, i'll use <image/>
, frameworkelement.
i've attempted following, make frameworkelement square based on parent's width. wasn't able make square based on "minimal" (or maximal) value between parent's height , width.
<grid x:name="layoutroot"> <image height="{binding actualwidth, elementname=layoutroot, mode=oneway}" horizontalalignment="stretch" /> </grid>
i've attempted following, said scale , doesn't size frameworkelement. height , width still "1":
<viewbox stretch="uniform"> <image height="1" width="1" /> </viewbox>
i've heard <multibinding/>
(for windows store 8 only, not windows phone 8 sadly), wasn't able code square behavior.
Comments
Post a Comment