Advertisement
FrayxRulez

Untitled

Jun 12th, 2016
168
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.14 KB | None | 0 0
  1. <Style TargetType="local:CiccioFrame">
  2. <Setter Property="HorizontalContentAlignment" Value="Stretch"/>
  3. <Setter Property="VerticalContentAlignment" Value="Stretch"/>
  4. <Setter Property="Background" Value="#fff1f1f1"/>
  5. <Setter Property="Template">
  6. <Setter.Value>
  7. <ControlTemplate TargetType="local:CiccioFrame">
  8. <Border
  9. x:Name="ClientArea"
  10. Background="{TemplateBinding Background}"
  11. BorderBrush="{TemplateBinding BorderBrush}"
  12. BorderThickness="{TemplateBinding BorderThickness}"
  13. Margin="{TemplateBinding Margin}"
  14. Grid.Row="2">
  15. <zoom:ZoomBox x:Name="Zoom">
  16. <Grid>
  17. <ContentPresenter
  18. x:Name="FirstContentPresenter"
  19. HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
  20. VerticalAlignment="{TemplateBinding VerticalContentAlignment}" Grid.Row="1"/>
  21. <ContentPresenter
  22. x:Name="SecondContentPresenter"
  23. HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
  24. VerticalAlignment="{TemplateBinding VerticalContentAlignment}" Grid.Row="1"/>
  25. </Grid>
  26. </zoom:ZoomBox>
  27. </Border>
  28. </ControlTemplate>
  29. </Setter.Value>
  30. </Setter>
  31. </Style>
  32.  
  33.  
  34.  
  35.  
  36. public class CiccioFrame: TransitionFrame
  37. {
  38. public ZoomBox Zoom;
  39.  
  40. public CiccioFrame()
  41. {
  42. DefaultStyleKey = typeof(CiccioFrame);
  43. }
  44.  
  45. public override void OnApplyTemplate()
  46. {
  47. base.OnApplyTemplate();
  48.  
  49. var zoom = new DisplayInformationEmulator();
  50. Zoom = GetTemplateChild("Zoom") as ZoomBox;
  51. Zoom.ZoomFactor = zoom.DisplayInformationEx.ViewPixelsPerHostPixel;
  52. }
  53. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement