LayoutTransform problem

Dec 4, 2007 at 8:36 AM
I'm triying to scale the content of a tab item containing both wpf and winform controls using a LayoutTransform.
The problem is that the interop form does not know that a scalatransform is done and so, clicking on the rendered winform control, does give the focus in the right place in the interop form.
Do you think that this could be resolved ?

Here the code i added in your sample to make the try :

<TabItem Header="2D example with scale">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition/>
</Grid.RowDefinitions>
<Slider Grid.Row="0" Minimum="0.1" Maximum="5" Value="1" x:Name="_slider"/>
<ScrollViewer x:Name="ScrollViewer" Grid.Row="1" VerticalScrollBarVisibility="Auto" HorizontalScrollBarVisibility="Auto">
<Border>
<Border.LayoutTransform>
<ScaleTransform
ScaleX="{Binding ElementName=_slider,Path=Value}"
ScaleY="{Binding ElementName=_slider,Path=Value}"
/>
</Border.LayoutTransform>
<Border
Width="{Binding ElementName=ScrollViewer, Path=ActualWidth}"
Height="{Binding ElementName=ScrollViewer, Path=ActualHeight}">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition/>
</Grid.RowDefinitions>
<TextBox Text="wpf control"/>
<Border BorderBrush="Blue" BorderThickness="4" Grid.Row="1">
<interop:Win32HostRenderer Debug="{Binding ElementName=Debug, Path=IsChecked}">
<interop:Win32HostRenderer.ContentControl>
<forms:WebBrowser Url="http://www.google.fr"/>
</interop:Win32HostRenderer.ContentControl>
</interop:Win32HostRenderer>
</Border>
</Grid>
</Border>
</Border>
</ScrollViewer>
</Grid>
</TabItem>

Perhaps a solution should be to "inform" the win32hostrenderer that a scale is done, using a new property , then it could probably does "something" to give the focus at the right place :
<interop:Win32HostRenderer Scale="{Binding ElementName=_slider,Path=Value}" >