Monday, December 30, 2013

How to make snapped view for a viewbox

Hey thanks for the quick reply here is the XAML please do have a look and suggest



<Page
x:Class="Calculator_Hub.MainPage"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="using:Calculator_Hub"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d" Loaded="Page_Loaded">

<Grid Background="{StaticResource ApplicationPageBackgroundThemeBrush}">
<Viewbox>
<Canvas Height="768" Width="1366">
<Canvas.Background>
<ImageBrush ImageSource="Assets/hub.jpg"/>
</Canvas.Background>
<Button x:Name="Simple_Interest" BorderThickness="0" Content="" Height="253" Canvas.Left="113" Canvas.Top="131" Width="242" Click="Simple_Interest_Click"/>
<Button x:Name="Calculator" Content="" BorderThickness="0" Height="253" Canvas.Left="375" Canvas.Top="131" Width="239" Click="Calculator_Click"/>
<Button x:Name="Temperature" Content="" Height="253" BorderThickness="0" Canvas.Left="635" Canvas.Top="131" Width="241" Click="Temperature_Click"/>
<Button x:Name="BMI" Content="" Height="252" Canvas.Left="113" BorderThickness="0" Canvas.Top="407" Width="242" Click="BMI_Click"/>
<Button x:Name="Age" Content="" Height="252" Canvas.Left="375" Canvas.Top="407" BorderThickness="0" Width="239" Click="Age_Click"/>
<Button x:Name="Compound" Content="" Height="252" Canvas.Left="635" Canvas.Top="407" BorderThickness="0" Width="241" Click="Compound_Click"/>
</Canvas>
</Viewbox>
<VisualStateManager.VisualStateGroups>

<!-- Visual states reflect the application's view state -->
<VisualStateGroup x:Name="ApplicationViewStates">
<VisualState x:Name="FullScreenLandscape"/>
<VisualState x:Name="Filled"/>

<!-- The entire page respects the narrower 100-pixel margin convention for portrait -->
<VisualState x:Name="FullScreenPortrait"/>

<!-- The back button and title have different styles when snapped -->
<VisualState x:Name="Snapped"/>
</VisualStateGroup>
</VisualStateManager.VisualStateGroups>

</Grid>
</Page>





pratik


No comments:

Post a Comment