Created
November 3, 2017 19:51
-
-
Save juanpaexpedite/14c3ce90bba9f30f3fbeee591640846f to your computer and use it in GitHub Desktop.
WPFConverterBinding2_2
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!--Remember to RaisePropertyChanged the ZIndex when Size Changes in the Model--> | |
<!-- And the viewmodel is defined like the following: | |
<Application.Resources> | |
<vm:PackViewModel x:Key="PackViewModel"/> | |
... | |
--> | |
<Grid Opacity="0.7" SnapsToDevicePixels="False" x:Name="ObjectZIndex" Visibility="{Binding IsZIndexSelector, Converter={StaticResource BoolVisibilityConverter}}" VerticalAlignment="Top" HorizontalAlignment="Left" Background="Transparent" Width="{Binding ElementName=BackPanel, Path=ActualWidth}" Height="1" RenderTransformOrigin="0,0"> | |
<Grid.Resources> | |
<cvt:ZIndexConverter x:Key="ZIndexConverter" Size="{Binding Source={StaticResource PackViewModel}, Path=Thing.Size}"/> | |
</Grid.Resources> | |
<Grid.RenderTransform> | |
<TranslateTransform Y="{Binding Thing.ZIndex, Converter={StaticResource ZIndexConverter}}"> | |
</TranslateTransform> | |
</Grid.RenderTransform> | |
<Rectangle Height="1" SnapsToDevicePixels="False" Fill="Red" StrokeThickness="0" RenderOptions.BitmapScalingMode="NearestNeighbor" VerticalAlignment="Top" HorizontalAlignment="Stretch"/> | |
</Grid> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment