Same Application bar for different xaml pages Windows Phone 8 -
for wp8 application, have create same application bar different pages, need create in xaml pages or there way define once , use across..
you can define appbar in app.xaml this..
<application.resources> <local:localizedstrings xmlns:local="clr-namespace:phoneapp12" x:key="localizedstrings"/> <shell:applicationbar x:key="globalappbar" isvisible="true" ismenuenabled="true" backgroundcolor="black" foregroundcolor="white"> <shell:applicationbariconbutton x:name="asd" iconuri="/1.png" text="0" /> <shell:applicationbariconbutton iconuri="/1.png" text="1" /> <shell:applicationbariconbutton iconuri="/1.png" text="2" /> <shell:applicationbariconbutton iconuri="/1.png" text="3" /> </shell:applicationbar> </application.resources>
and on xaml pages add this.
applicationbar = "{staticresource globalappbar}"
so page.xaml top part this..
<phone:phoneapplicationpage x:class="phoneapp12.mainpage" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:phone="clr-namespace:microsoft.phone.controls;assembly=microsoft.phone" xmlns:shell="clr-namespace:microsoft.phone.shell;assembly=microsoft.phone" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" mc:ignorable="d" **applicationbar = "{staticresource globalappbar}"** fontfamily="{staticresource phonefontfamilynormal}" fontsize="{staticresource phonefontsizenormal}" foreground="{staticresource phoneforegroundbrush}" supportedorientations="portrait" orientation="portrait" shell:systemtray.isvisible="true">
hope you..
Comments
Post a Comment