how to arrange button in corner of the screen in windows phone 8.1? - windows-phone-8

I am developed windows phone app.but what happend is the screen was perfect in 4 inch resolution devices.but 5 inch or 6 inch resolution devices the design was not perfect.how to solve this problem.
please show above screen shots.
in the above screen short i want to set button is corner of the screen,In 4 inch resolution devices arrange perfectly.but 5 inch or 6 inch devices button was not set to corner of the screen.it comes up.how to set button in corner of the screen.
below is my code
<Grid Style="{StaticResource LayoutGridStyle}">
<Pivot Title="RELOAD" CommonNavigationTransitionInfo.IsStaggerElement="True" Style="{StaticResource CustomPivotStyle}" BorderBrush="{StaticResource PhoneAccentBrush}" >
<Pivot.TitleTemplate>
<DataTemplate>
<Grid Background="White">
<StackPanel Margin="0,0,0,10">
<Image Source="/Images/logo.png" Height="40" Margin="0,0,-362,0"/>
</StackPanel>
</Grid>
</DataTemplate>
</Pivot.TitleTemplate>
<Pivot.HeaderTemplate>
<DataTemplate>
<TextBlock Text="{Binding}" FontSize="25" />
</DataTemplate>
</Pivot.HeaderTemplate>
<PivotItem Header="MOBILE" Margin="0,10,0,0.167">
<StackPanel>
<Grid>
<Button x:Name="prepaidbtn" Content="PREPAID" HorizontalAlignment="Left" Foreground="White" Background="#1e365a" Margin="0,5,0,1" RenderTransformOrigin="1.079,0.516" Click="prepaidbtn_Click" Width="118"></Button>
<Button x:Name="postpaidbtn" Content="POSTPAID" HorizontalAlignment="Right" Foreground="#A9A9A9" Background="#1e365a" Margin="281,5,0,0" Click="postpaidbtn_Click" Height="57"/>
</Grid>
<Grid x:Name="gridprepaid" Height="437" >
<Grid>
<TextBox x:Name="rechargePhoneno" MaxLength="10" PlaceholderText="Mobile Number" BorderBrush="#FFABAABF" Margin="10,10,10,0" Height="44" BorderThickness="0,0,0,2" VerticalAlignment="Top" TextChanged="rechargePhoneno_TextChanged" InputScope="Number">
</TextBox>
<Button x:Name="Contactbtn" HorizontalAlignment="Right" Click="Contactbtn_Click" BorderThickness="0,0,0,0" Margin="315,-9,-9,366" Height="77">
<StackPanel>
<Image Source="Images/n_contacts.9.png" Width="55" Height="38"/>
</StackPanel>
</Button>
</Grid>
<ComboBox x:Name="rechargeOperator1" BorderBrush="#FFABAABF" Margin="10,80,10,0" Height="44" BorderThickness="0,0,0,2" VerticalAlignment="Top" PlaceholderText="Select Operator" RenderTransformOrigin="0.5,0.5" SelectionChanged="rechargeOperator1_SelectionChanged" >
</ComboBox>
<ComboBox x:Name="rechargeCircles1" BorderBrush="#FFABAABF" Margin="10,160,10,0" Height="44" BorderThickness="0,0,0,2" VerticalAlignment="Top" PlaceholderText="Select Circle" RenderTransformOrigin="0.5,0.5" SelectionChanged="rechargeCircles1_SelectionChanged">
</ComboBox>
<Grid x:Name="gridspecial" Visibility="Collapsed" >
<RadioButton x:Name="Topup" Content="Topup" FontSize="20" HorizontalAlignment="Left" Width="30" Margin="10,200,0,0" Foreground="#1e365a" Background="#1e365a" ></RadioButton>
<RadioButton x:Name="special" Content="Special" FontSize="20" HorizontalAlignment="Right" Margin="0,200,10,0" Foreground="#1e365a" Background="#1e365a" ></RadioButton>
</Grid>
<Grid >
<TextBox x:Name="txtamount" MaxLength="4" PlaceholderText="Amount" InputScope="Number" RenderTransformOrigin="0.5,0.5" BorderBrush="#FFABAABF" Margin="10,251,10,0" Height="44" BorderThickness="0,0,0,2" VerticalAlignment="Top"/>
<Button x:Name="plansbtn" Content="Browse Plans" RenderTransformOrigin="0.522,-0.018" Height="37" Foreground="#1e365a" Width="181" Click="plansbtn_Click" Margin="231,253,-12,123" FontSize="20" Background="{x:Null}" BorderBrush="{x:Null}" HorizontalAlignment="Right"/>
</Grid>
<Button x:Name="Recharge" Content="RECHARGE" Background="Red" Foreground="White" HorizontalAlignment="Stretch" Margin="10,0,0,42" RenderTransformOrigin="0.514,1.408" VerticalAlignment="Bottom" Height="70" Click="Recharge_Click" FontWeight="Bold" FontSize="25">
</Button>
<Button VerticalAlignment="Bottom" HorizontalAlignment="Right" Height="97" BorderThickness="0" Margin="331,0,-40,-62" >
<StackPanel>
<Image Source="Images/ic_navigation_drawer.png" Stretch="Fill" Width="59" Height="39" />
</StackPanel>
<Button.Flyout>
<MenuFlyout>
<MenuFlyoutItem x:Name="reloadcash" Text="Reloadcash" Click="reloadcash_Click" />
<MenuFlyoutItem x:Name="prevoiusorders" Text="Previous orders" Click="prevoiusorders_Click"/>
<MenuFlyoutItem x:Name="profile" Text="profile" Click="profile_Click"/>
<MenuFlyoutItem x:Name="changepassword" Text="changepassword" Click="changepassword_Click"/>
<MenuFlyoutItem x:Name="Contacts" Text="Contacts" Click="Contacts_Click"/>
<MenuFlyoutItem x:Name="busorderhistory" Text="Busorderhistory" Click="busorderhistory_Click"></MenuFlyoutItem>
</MenuFlyout>
</Button.Flyout>
</Button>
</Grid>
<Grid x:Name="gridpoastpaid" Visibility="Collapsed">
<Grid>
<TextBox x:Name="rechargePhonenopostpaid" MaxLength="10" PlaceholderText="Postpaid Mobile Number" BorderBrush="#FFABAABF" Margin="10,10,10,0" Height="44" BorderThickness="0,0,0,2" VerticalAlignment="Top" InputScope="Number" RenderTransformOrigin="0.5,0.5" TextChanged="rechargePhonenopostpaid_TextChanged" />
<Button x:Name="Contactbtn1" Click="Contactbtn_Click" BorderThickness="0" Margin="315,-9,-9,366" Width="102" Height="77" HorizontalAlignment="Right">
<StackPanel>
<Image Source="Images/n_contacts.9.png" Width="55" Height="38"/>
</StackPanel>
</Button>
</Grid>
<Grid>
<ComboBox x:Name="rechargeOperator1postpaid" PlaceholderText="Operator" SelectionChanged="rechargeOperator1postpaid_SelectionChanged" BorderBrush="#FFABAABF" Margin="10,80,10,0" Height="44" BorderThickness="0,0,0,2" VerticalAlignment="Top" />
</Grid>
<Grid>
<TextBox x:Name="txtamountpostpaid" MaxLength="4" PlaceholderText="Amount" InputScope="Number" BorderBrush="#FFABAABF" Margin="10,160,10,0" Height="44" BorderThickness="0,0,0,2" VerticalAlignment="Top" />
</Grid>
<Grid >
<Button x:Name="pay" Content="PAY" Background="Red" Foreground="White" HorizontalAlignment="Stretch" Margin="0,240,0,123" FontSize="25" FontWeight="Bold" Height="70" Click="pay_Click"/>
</Grid>
<Button VerticalAlignment="Bottom" HorizontalAlignment="Right" Height="106" BorderThickness="0" Width="74" Margin="0,392,-32,-65" >
<StackPanel>
<Image Source="Images/ic_navigation_drawer.png" Stretch="Fill" Width="70" Height="37" />
</StackPanel>
<Button.Flyout>
<MenuFlyout>
<MenuFlyoutItem x:Name="reloadcash6" Text="Reloadcash" Click="reloadcash_Click" />
<MenuFlyoutItem x:Name="prevoiusorders6" Text="Previous orders" Click="prevoiusorders_Click"/>
<MenuFlyoutItem x:Name="profile6" Text="profile" Click="profile_Click"/>
<MenuFlyoutItem x:Name="changepassword6" Text="changepassword" Click="changepassword_Click"/>
<MenuFlyoutItem x:Name="Contacts6" Text="Contacts" Click="Contacts_Click"/>
<MenuFlyoutItem x:Name="busorderhistory6" Text="Busorderhistory" Click="busorderhistory_Click"></MenuFlyoutItem>
</MenuFlyout>
</Button.Flyout>
</Button>
</Grid>
</StackPanel>
</PivotItem>
</Pivot>
</Grid>
required button is below of the recharge button.

try this code
<Button VerticalAlignment="Bottom" HorizontalAlignment="Right" BorderThickness="0" >
<!--<StackPanel>
<Image Source="Assets/SmallLogo.png" Stretch="Fill" Width="59" Height="39" />
</StackPanel>-->
<Button.Background>
<ImageBrush ImageSource="Assets/SmallLogo.png"/>
</Button.Background>
<Button.Flyout>
<MenuFlyout>
<MenuFlyoutItem x:Name="reloadcash" Text="Reloadcash" Click="reloadcash_Click" />
<MenuFlyoutItem x:Name="prevoiusorders" Text="Previous orders" Click="prevoiusorders_Click"/>
<MenuFlyoutItem x:Name="profile" Text="profile" Click="profile_Click"/>
<MenuFlyoutItem x:Name="changepassword" Text="changepassword" Click="changepassword_Click"/>
<MenuFlyoutItem x:Name="Contacts" Text="Contacts" Click="Contacts_Click"/>
<MenuFlyoutItem x:Name="busorderhistory" Text="Busorderhistory" Click="busorderhistory_Click"></MenuFlyoutItem>
</MenuFlyout>
</Button.Flyout>
</Button>

Related

Avalonia invalidCastException

We're trying to built a UI with Avalonia for a project. One of our VM's needs to use MultiBinding, but it throws this message: "System.InvalidCastException: 'Unable to cast object of type 'Avalonia.Data.MultiBinding' to type 'Avalonia.Controls.IControl'.'". How do I come around this message?
<Grid ColumnDefinitions="Auto, Auto">
<StackPanel Grid.Column="0">
<Border Classes="Left">
<ScrollViewer MaxHeight="400">
<ItemsControl Items="{Binding PublicationTypes}" Name="PubType">
<ItemsControl.ItemTemplate>
<DataTemplate>
<Grid ColumnDefinitions="*,Auto,Auto">
<TextBox Text="{Binding Name}" Grid.Column="0" Name="PubName" />
<MultiBinding>
<Binding ElementName="MainView"/>
<Binding Path="Name"/>
</MultiBinding>
<Button Grid.Column="1" Classes="Options" Command="{Binding ElementName=MainView, Path=DataContext.EditPublicationType}" CommandParameter="{Binding ElementName=MainView, Path=DataContext.PublicationTypes}">
<!-- CommandParameter="{Binding ElementName=MainView}-->
<Image Source="avares://Zenref.Ava/Assets/options.ico" />
</Button>
<Button Grid.Column="2" Classes="Cross" Command="{Binding ElementName=MainView, Path=DataContext.DeletePublicationTypeCommand}" CommandParameter="{Binding Name}">
<Image Source="avares://Zenref.Ava/Assets/cross.ico" />
</Button>
</Grid>
</DataTemplate>
</ItemsControl.ItemTemplate>
</ItemsControl>
</ScrollViewer>
</Border>
</StackPanel>
<StackPanel Grid.Column="1" Orientation="Horizontal" Spacing="50" Margin="20" VerticalAlignment="Top">
<Border Width="250" Height="300" Padding="10">
<StackPanel Orientation="Vertical" Spacing="3">
<StackPanel Orientation="Horizontal" Spacing="10">
<TextBlock Text="Referencer importeret" Width="125"/>
<TextBlock Text=":"/>
<TextBlock Text="60000"/>
</StackPanel>
<StackPanel Orientation="Horizontal" Spacing="10">
<TextBlock Text="Identificeret" Width="125"/>
<TextBlock Text=":"/>
<TextBlock Text="0"/>
</StackPanel>
<StackPanel Orientation="Horizontal" Spacing="10">
<TextBlock Text="Uidentificeret" Width="125"/>
<TextBlock Text=":"/>
<TextBlock Text="0"/>
</StackPanel>
</StackPanel>
</Border>
</StackPanel>
<Button Name="menuButton" Command="{Binding OpenSearchCriteriaCommand}" CommandParameter="{Binding ElementName=MainView}" VerticalAlignment="Bottom" HorizontalAlignment="Left" Width="100" Margin="10">Menu</Button>
<Button Name="startButton" VerticalAlignment="Bottom" HorizontalAlignment="Right" Width="100" Margin="125,10">Start</Button>
<Button Name="exportButton" VerticalAlignment="Bottom" HorizontalAlignment="Right" Width="100" Margin="10,10">Exporter</Button>
</Grid>
We've tried looking through Avalonia's documentation and through stackoverflow, but we haven't found a similar problem.

Keep text block in view while scrolling in window phone 8.1 Runtime

my problem is exactly similar to this article
But I need to implement in wp8.1 runtime. I want textblock (name=txt_latest_update) in view while scrolling
here is my XAML code
<Grid Name="Root_content" Background="#FFF7FDF7">
<Grid.RowDefinitions>
<RowDefinition Height="70"/>
<RowDefinition Height="*"/>
</Grid.RowDefinitions>
<Border Grid.Row="0" Background="Red">
<Image Source="/Assets/nepaltoday.png" HorizontalAlignment="Left" Margin="10,0,0,0"/>
</Border>
<ScrollViewer Grid.Row="1" Name="frontpage_scrollview" VerticalScrollBarVisibility="Visible"
>
<StackPanel>
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="300"/>
<RowDefinition Height="*"/>
</Grid.RowDefinitions>
<Grid Grid.Row="0">
<Image Name="startscren" Stretch="Fill"/>
<Grid>
<Grid.Background>
<LinearGradientBrush StartPoint="0.3,0" EndPoint="1,0.">
<GradientStop Color="Transparent" Offset="0"/>
<GradientStop Color="Black" Offset="1.2" />
</LinearGradientBrush>
</Grid.Background>
</Grid>
<Grid HorizontalAlignment="Right" Margin="0,10,10,0">
<StackPanel>
<TextBlock Name="txt_nepali_date" Foreground="White" FontSize="26"/>
<TextBlock Name="txt_eng_date" Foreground="White" FontSize="26" />
<TextBlock Name="txt_temp" Foreground="Yellow" FontSize="44" Margin="0,20,0,0"/>
<TextBlock Name="txt_location" FontSize="22"/>
</StackPanel>
</Grid>
</Grid>
<Grid Grid.Row="1">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions>
<Grid.Resources>
<Style TargetType="Button">
<Setter Property="BorderBrush" Value="LightGray"/>
<Setter Property="BorderThickness" Value="0,1,1,1"/>
<Setter Property="Height" Value="Auto"/>
<Setter Property="Margin" Value="0,0,0,-20"/>
</Style>
</Grid.Resources>
<StackPanel Grid.Column="0">
<Button Name="btnNews" Click="btnNews_Click">
<Image Source="/Assets/FrontPage/horoscope.png" VerticalAlignment="Stretch"/>
</Button>
<Button Name="btnHoroscope" Click="btnHoroscope_Click">
<Image Source="/Assets/FrontPage/horoscope.png"/>
</Button>
<Button Name="btnCurrencyExchanges" Click="btnCurrencyExchanges_Click">
<Image Source="/Assets/FrontPage/currency exchange.png"/>
</Button>
<Button Name="btnStockExchanges" Click="btnStockExchange">
<Image Source="/Assets/FrontPage/on this day.png"/>
</Button>
<Button Name="btnOnthisday" Click="btnOnthisday_Click">
<Image Source="/Assets/FrontPage/horoscope.png"/>
</Button>
<Button Name="btnMovie" Click="btnMovie_Click">
<Image Source="/Assets/FrontPage/horoscope.png"/>
</Button>
</StackPanel>
<StackPanel Grid.Column="1" >
<Button Name="btnWeather" Click="btnWeather_Click">
<Image Source="/Assets/FrontPage/whether.png"/>
</Button>
<Button Name="btnLoadshedding" Click="btnLoadshedding_Click">
<Image Source="/Assets/FrontPage/loadshedding.png"/>
</Button>
<Button Name="btnGoldSilver" Click="btnGoldSilver_Click">
<Image Source="/Assets/FrontPage/gold_silver rates.png"/>
</Button>
<Button Name="btnTheatre" Click="btnTheatre_Click">
<Image Source="/Assets/FrontPage/theater.png"/>
</Button>
<Button Name="btnCalendar" Click="btnCalendars">
<Image Source="/Assets/FrontPage/horoscope.png"/>
</Button>
</StackPanel>
</Grid>
</Grid>
</StackPanel >
</ScrollViewer>
<Border Name="TitleBorder" Grid.Row="1"
Background="#FF264778" Opacity="0.7"
Margin="0,260,0,0"
Height="{Binding ElementName=TitleText, Path=Height}"
VerticalAlignment="Top">
<TextBlock Name="txt_lastest_update" HorizontalAlignment="Center"
Text="keep in view"
Foreground="White"
FontSize="22"
Margin="12" />
</Border>
</Grid>
Any suggestion?
hey i think your problem is, you want keep your textblock fixed while list is scroll. so you have to keep your list in different grid and textblock in different grid which need to fix. and make grid which contain list scrolable = true.

disable click event everywhere when Process Ring is Active in Windows phone 8.1

I have a XAML Page in that i have putted various control for login, whenever i click on Login Button , process will start for authenticate the user ,process ring is activated at the start of Login_click event and it will stop at the end of that event.
i Just want that during that process no buddy can click on any control of the page.
i think it is possible from both the methods from c# and also from and XAML
<Grid>
<ProgressRing Name="prcsring1" Foreground="Black" HorizontalAlignment="Center" VerticalAlignment="Center" Width="200" Height="200" Background="Transparent" Canvas.ZIndex="9999"/>
<Grid Margin="0,0,0,0" Background="White">
<Grid.RowDefinitions>
<RowDefinition Height="70" />
<!--1-->
<RowDefinition />
<!--2-->
<RowDefinition />
<!--3-->
<RowDefinition />
<!--4-->
<RowDefinition />
<!--5-->
<RowDefinition />
<!--6-->
<RowDefinition />
<!--7-->
<RowDefinition Height="25" />
<!--8-->
<RowDefinition Height="60"/>
<!--9-->
<RowDefinition Height="20"/>
<!--10-->
<RowDefinition />
<!--11-->
<RowDefinition Height="40"/>
<!--12-->
<RowDefinition />
<!--13-->
<RowDefinition Height="70" />
<!--14-->
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions>
<StackPanel Grid.Column="0" Grid.Row="0" x:Name="stackpanHead1" Background="#424242" />
<Image x:Name="imgstatusGreen" Visibility="Collapsed" Source="../Images/Confirmed Images/index_green1.png" HorizontalAlignment="Right" Margin="0,21,10,0" VerticalAlignment="Top" Width="20" />
<Image x:Name="imgstatusRed" Source="../Images/Confirmed Images/index_red1.png" Visibility="Collapsed" HorizontalAlignment="Right" Margin="0,21,10,0" VerticalAlignment="Top" Width="20" />
<Image x:Name="imgstatusOrange" Source="../Images/Confirmed Images/Orange.png" Visibility="Collapsed" HorizontalAlignment="Right" Margin="0,21,10,0" VerticalAlignment="Top" Width="20" />
<TextBlock Grid.Column="0" Grid.Row="1" HorizontalAlignment="Center" Margin="0,10,0,0" Foreground="#5C5C5C" FontSize="50" FontWeight="Bold" TextWrapping="Wrap" Text="Welcome to" />
<Image Grid.Column="0" Grid.Row="2" x:Name="imglogo" Source="../Images/alogo.png" Margin="40,0,40,0" VerticalAlignment="Center" />
<TextBlock Grid.Column="0" Grid.Row="3" FontSize="30" Margin="0,0,0,0" TextWrapping="Wrap" FontWeight="Bold" TextAlignment="Center" Text="Your Gateway to" VerticalAlignment="Top" HorizontalAlignment="Center" Foreground="#5C5C5C" />
<TextBlock Grid.Column="0" Grid.Row="4" FontSize="30" Margin="0,0,0,0" TextWrapping="Wrap" FontWeight="Bold" TextAlignment="Center" Text="e-Government and Visas" VerticalAlignment="Top" HorizontalAlignment="Center" Foreground="#5C5C5C" />
<Border Grid.Column="0" Grid.Row="5" Margin="50,5,50,5" Name="cornradusername" CornerRadius="10" Height="40" BorderThickness="2" Background="White" BorderBrush="Black" >
<TextBox x:Name="txtusername" BorderBrush="Transparent" BorderThickness="0" VerticalAlignment="Center" TextWrapping="Wrap" Text="" PlaceholderText="User Name" Background="White" />
</Border>
<Border Grid.Column="0" Grid.Row="6" Name="cornradpass" CornerRadius="10" Margin="50,5,50,5" Height="40" BorderThickness="2" Background="White" BorderBrush="Black" >
<PasswordBox x:Name="txtpass" BorderBrush="Transparent" BorderThickness="0" VerticalAlignment="Center" PlaceholderText="Password" Background="White" />
</Border>
<TextBlock Grid.Column="0" Grid.Row="7" Name="lblwrong" FontSize="15" Margin="0,0,0,0" TextWrapping="Wrap" TextAlignment="Center" Text="" FontWeight="Bold" VerticalAlignment="Top" HorizontalAlignment="Center" Foreground="Red" Width="390"/>
<TextBlock Grid.Column="0" Grid.Row="8" FontSize="15" Margin="0,0,0,0" TextWrapping="Wrap" TextAlignment="Center" Text="Enter credentials To Authenticate" HorizontalAlignment="Center" Foreground="#5C5C5C"/>
<WebView Grid.Column="0" Grid.Row="9" Name="WebView2" Margin="0,0,0,0" Width="360" Height="30" HorizontalAlignment="Center" />
<HyperlinkButton Grid.Column="0" Grid.Row="10" Foreground="#086A87" FontFamily="Arial Black" FontWeight="Bold" FontSize="20" Content="Forgot password? click here.." HorizontalAlignment="Center" Click="HyperlinkButton_Click"/>
<Grid Grid.Column="0" Grid.Row="11" Margin="0,0,0,0" Background="White">
<Grid.RowDefinitions>
<RowDefinition />
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*" />
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<Button Grid.Column="0" Grid.Row="0" Content="Login" Margin="0,0,5,0" x:Name="btnlogin1" HorizontalAlignment="Right" Click="Button_Click" BorderThickness="0" Foreground="White">
<Button.Background>
<ImageBrush ImageSource="../Images/button_green.png"/>
</Button.Background>
</Button>
<Button Grid.Column="1" Grid.Row="0" Margin="5,0,0,0" Content="New User" x:Name="btnnewuser1" HorizontalAlignment="left" BorderThickness="0" Foreground="White">
<Button.Background>
<ImageBrush Stretch="Fill" ImageSource="../Images/button_green.png"/>
</Button.Background>
</Button>
</Grid>
<TextBlock Grid.Column="0" Grid.Row="12" VerticalAlignment="Center" FontSize="15" Margin="0,0,0,0" TextWrapping="Wrap" TextAlignment="Center" Text="Version: 1.79" HorizontalAlignment="Center" Foreground="#5C5C5C"/>
<StackPanel Grid.Column="0" Grid.Row="13" x:Name="Add" Background="Aqua" />
</Grid>
</Grid>
private async void Button_Click(object sender, RoutedEventArgs e)
{
Ringprocess_Activate(prcsring1);
----------------------My Code for Process--------------------
Ringprocess_DeActivate(prcsring1);
}
Can be as simple as
private async void Button_Click(object sender, RoutedEventArgs e)
{
this.IsEnabled = false; // disable the page
Ringprocess_Activate(prcsring1);
// .. your code
Ringprocess_DeActivate(prcsring1);
this.IsEnabled = true; // enable the page
}
If you do it this way make sure you comment out any StoryBoard that enables the "Disable" state, other wise, it will kinda grey out the controls which you probably don't want on that RingProcess Control.

Handling Back button on Windows Phone 8.1

I have 2 pages in my Windows Phone 8.1 app.
The 1st page displays 9 image buttons. Its purpose is to allow the User to enter their 4 digit PIN to proceed to the next screen.
Scenario:
the User enters PIN and goes to 2nd screen.
I go to bed.
i wake up.
I go to my mobile.
I am on the 2nd screen.
I press the back button.
The images on my buttons do not show.
I can still press my 'invisible' buttons.
Why do my images not show?
My xaml:
<Button BorderThickness="0" Name="btn4" Grid.Row="2" Grid.Column="0" Width="75" Height="75" HorizontalAlignment="Center" >
<Button.Background >
<ImageBrush ImageSource="/Images/Number-4-icon.png" Stretch="Uniform"/>
</Button.Background>
</Button>
<Button BorderThickness="0" Name="btn5" Grid.Row="2" Grid.Column="1" Width="75" Height="75" HorizontalAlignment="Center" >
<Button.Background >
<ImageBrush ImageSource="/Images/Number-5-icon.png" Stretch="Uniform"/>
</Button.Background>
</Button>
<Button BorderThickness="0" Name="btn6" Grid.Row="2" Grid.Column="2" Width="75" Height="75" HorizontalAlignment="Center" >
<Button.Background >
<ImageBrush ImageSource="/Images/Number-6-icon.png" Stretch="Uniform"/>
</Button.Background>
</Button>
<Button BorderThickness="0" Name="btn7" Grid.Row="3" Grid.Column="0" Width="75" Height="75" HorizontalAlignment="Center" >
<Button.Background >
<ImageBrush ImageSource="/Images/Number-7-icon.png" Stretch="Uniform"/>
</Button.Background>
</Button>
<Button BorderThickness="0" Name="btn8" Grid.Row="3" Grid.Column="1" Width="75" Height="75" HorizontalAlignment="Center" >
<Button.Background >
<ImageBrush ImageSource="/Images/Number-8-icon.png" Stretch="Uniform"/>
</Button.Background>
</Button>
<Button BorderThickness="0" Name="btn9" Grid.Row="3" Grid.Column="2" Width="75" Height="75" HorizontalAlignment="Center" >
<Button.Background >
<ImageBrush ImageSource="/Images/Number-9-icon.png" Stretch="Uniform"/>
</Button.Background>
</Button>
<Button BorderThickness="0" Name="btnReset" Grid.Row="4" Grid.Column="0" Width="75" Height="75" HorizontalAlignment="Center" Margin="0" Padding="9.5,0,9.5,3.5" >
<Button.Background >
<ImageBrush ImageSource="ms-appx:///Images/undo.png" Stretch="Uniform" />
</Button.Background>
</Button>
<Button BorderThickness="0" Name="btn0" Grid.Row="4" Grid.Column="1" Width="75" Height="75" HorizontalAlignment="Center" >
<Button.Background >
<ImageBrush ImageSource="/Images/Number-0-icon.png" Stretch="Uniform"/>
</Button.Background>
</Button>
<Button BorderThickness="0" Name="btnDel" Grid.Row="4" Grid.Column="2" Width="75" Height="75" HorizontalAlignment="Center" >
<Button.Background >
<ImageBrush ImageSource="/Images/delete_key.png" Stretch="Uniform"/>
</Button.Background>
</Button>
</Grid>
<Grid x:Name="Footer" Background="Black" Grid.Row="4" >
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions>
<TextBlock Name="txtError" Grid.Column="0" FontSize="18" Margin="10,10,10,10" Text="Enter PIN" HorizontalAlignment="Center" VerticalAlignment="Center" TextAlignment="Center" Foreground="#FFE8E82F" FontWeight="Bold" />
</Grid>
</Grid>

WPF Border element background animation

I want to animate the background of a border when the mouse is enters and leaves.
Here is my code
<Style TargetType="{x:Type Border}">
<Style.Triggers>
<EventTrigger RoutedEvent="Border.MouseEnter">
<EventTrigger.Actions>
<BeginStoryboard>
<Storyboard>
<ColorAnimation Storyboard.TargetProperty="(Background).(SolidColorBrush.Color)" To="#6990EE90" Duration="0:0:0.3" />
</Storyboard>
</BeginStoryboard>
</EventTrigger.Actions>
</EventTrigger>
<EventTrigger RoutedEvent="Border.MouseLeave">
<EventTrigger.Actions>
<BeginStoryboard>
<Storyboard>
<ColorAnimation Storyboard.TargetProperty="(Background).(SolidColorBrush.Color)" To="Transparent" Duration="0:0:3" />
</Storyboard>
</BeginStoryboard>
</EventTrigger.Actions>
</EventTrigger>
</Style.Triggers>
</Style>
...
<ListBox Height="158" Name="lstStats" Width="Auto" HorizontalAlignment="Stretch" Margin="0" ItemsSource="{Binding ApplicationStatsValues}" Background="Transparent" BorderThickness="0">
<ListBox.ItemTemplate>
<DataTemplate>
<Border Name="lulu" BorderThickness="1" Opacity="0.8" BorderBrush="LightGreen" CornerRadius="3" Margin="0,0,0,2">
<Border.Background>
<SolidColorBrush />
</Border.Background>
<DockPanel Height="60" Width="284" HorizontalAlignment="Stretch" VerticalAlignment="Top">
<TextBlock DockPanel.Dock="Bottom" Text="{Binding Description}" Height="30" Width="Auto" VerticalAlignment="Center" />
<TextBlock DockPanel.Dock="Left" Text="{Binding Title}" Height="30" Width="220" VerticalAlignment="Center" />
<TextBlock DockPanel.Dock="Right" Text="{Binding Value}" Height="30" Width="80" VerticalAlignment="Center" />
</DockPanel>
</Border>
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
The problem is that i always get this error :
'Background' property does not point to a DependencyObject in path '(Background).(0)'.
This works perfectly with <Style Targetype="ListBoxItem"> but I don't want the background of the list item to change, it looks ugly. I want the border background to change because of the round border.
So the question is : how those DependencyObject works and how can i determine which one is the correct one for a given object, and can anyone make this works ?
Thanks for your help !
I finally found a solution to make it work by putting the triggers inside the ItemTemplate itself.
Any explanation why it cannot work by targetting the type with an external style would be very welcome.
<ListBox Height="158" Name="lstStats" Width="Auto" HorizontalAlignment="Stretch" Margin="0" ItemsSource="{Binding ApplicationStatsValues}" Background="Transparent" BorderThickness="0">
<ListBox.ItemTemplate>
<DataTemplate>
<Border BorderThickness="1" Opacity="0.8" BorderBrush="LightGreen" CornerRadius="3" Margin="0,0,0,2">
<Border.Background>
<SolidColorBrush />
</Border.Background>
<Border.Triggers>
<EventTrigger RoutedEvent="Border.MouseEnter">
<EventTrigger.Actions>
<BeginStoryboard>
<Storyboard>
<ColorAnimation Storyboard.TargetProperty="(Border.Background).(SolidColorBrush.Color)" To="#6990EE90" Duration="0:0:0.3" />
</Storyboard>
</BeginStoryboard>
</EventTrigger.Actions>
</EventTrigger>
<EventTrigger RoutedEvent="Border.MouseLeave">
<EventTrigger.Actions>
<BeginStoryboard>
<Storyboard>
<ColorAnimation Storyboard.TargetProperty="(Border.Background).(SolidColorBrush.Color)" To="Transparent" Duration="0:0:3" />
</Storyboard>
</BeginStoryboard>
</EventTrigger.Actions>
</EventTrigger>
</Border.Triggers>
<DockPanel Height="60" Width="284" HorizontalAlignment="Stretch" VerticalAlignment="Top">
<TextBlock DockPanel.Dock="Bottom" Text="{Binding Description}" Height="30" Width="Auto" VerticalAlignment="Center" />
<TextBlock DockPanel.Dock="Left" Text="{Binding Title}" Height="30" Width="220" VerticalAlignment="Center" />
<TextBlock DockPanel.Dock="Right" Text="{Binding Value}" Height="30" Width="80" VerticalAlignment="Center" />
</DockPanel>
</Border>
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>