Windows Controls in Viewbox
I have a problem when putting several elements in a group and try to specify the coordinate space.
I am writing an application to export XAML from our internal vector graphics. The source graphics has group concept and each group has its own coordinate space.
To simulate the group concept, we use a Viewbox containing Canvas. Also specify the Width and Height.
However, found that it works for shapes but has issue with controls like CheckBox.
<Viewbox HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Width="Auto" Height="Auto" x:Name="Viewbox">
<Canvas HorizontalAlignment="Stretch" VerticalAlignment="Stretch"Width="1000" Height="1000" x:Name="Canvas">
<Rectangle Fill="#FF000000"Width="500" Height="140" x:Name="Rectangle"Canvas.Left="300" Canvas.Top="660"/>
<CheckBox Content="CheckBox" x:Name="CheckBox"/>
</Canvas>
</Viewbox>
In the example, the Rectangle's Width and Height is only an arbitary number relative to the Canvas Width and Height. However, the CheckBox becomes very small. I can use a very large FontSize and the text will show up, but the checkbox square is still tiny.
Is there a way to scale the CheckBox according to the Canvas Width and Height ?
Is "Canvas in Viewbox" the proper way to handle resizing of a group ?
Thanks!
Tony

