Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <Style TargetType="local:CiccioFrame">
- <Setter Property="HorizontalContentAlignment" Value="Stretch"/>
- <Setter Property="VerticalContentAlignment" Value="Stretch"/>
- <Setter Property="Background" Value="#fff1f1f1"/>
- <Setter Property="Template">
- <Setter.Value>
- <ControlTemplate TargetType="local:CiccioFrame">
- <Border
- x:Name="ClientArea"
- Background="{TemplateBinding Background}"
- BorderBrush="{TemplateBinding BorderBrush}"
- BorderThickness="{TemplateBinding BorderThickness}"
- Margin="{TemplateBinding Margin}"
- Grid.Row="2">
- <zoom:ZoomBox x:Name="Zoom">
- <Grid>
- <ContentPresenter
- x:Name="FirstContentPresenter"
- HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
- VerticalAlignment="{TemplateBinding VerticalContentAlignment}" Grid.Row="1"/>
- <ContentPresenter
- x:Name="SecondContentPresenter"
- HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
- VerticalAlignment="{TemplateBinding VerticalContentAlignment}" Grid.Row="1"/>
- </Grid>
- </zoom:ZoomBox>
- </Border>
- </ControlTemplate>
- </Setter.Value>
- </Setter>
- </Style>
- public class CiccioFrame: TransitionFrame
- {
- public ZoomBox Zoom;
- public CiccioFrame()
- {
- DefaultStyleKey = typeof(CiccioFrame);
- }
- public override void OnApplyTemplate()
- {
- base.OnApplyTemplate();
- var zoom = new DisplayInformationEmulator();
- Zoom = GetTemplateChild("Zoom") as ZoomBox;
- Zoom.ZoomFactor = zoom.DisplayInformationEx.ViewPixelsPerHostPixel;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement