how can i hide this icons,
?
problem is i always have same color background even if theme is black or light and it is not looking good, i know it is possible to hide it. in xaml but i dont know the best way !
i tried this one ! but not working :(
<Page
x:Class="App1.MainPage"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="using:PuzzleTalk"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d"
xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone"
Shell:SystemTray.IsVisiable="False"
Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">
There's a typo in your code - you have Shell:SystemTray.IsVisiable="False" try Shell:SystemTray.IsVisible="False" instead...
Based off your XAML tags, you're trying to do this with Windows Phone 8.1 runtime
<Page> was the dead give away.
The shell:SystemTray.IsVisible="True" is only forWindows Phone 8 Silverlight and Windows Phone 8.1 Silverlight
Code to hide Status Bar
StatusBar statusBar = Windows.UI.ViewManagement.StatusBar.GetForCurrentView();
// Hide the status bar
await statusBar.HideAsync();
//Show the status bar
await statusBar.ShowAsync();
Taken from Hide Status bar in Windows Phone 8.1 Universal Apps
Related
I would like to use a AppBar on multiple pages as a resource.
I found an MSDN document (link) but it's for Windows Phone.
Does anyone know if this is even possible for Universal Apps?
This is how my App.xaml looks like now:
<Application.Resources>
<AppBar x:Key="GlobalBar" ClosedDisplayMode="Minimal">
<!--Controls....-->
</AppBar>
</Application.Resources>
But how do I implement this on, let's say, MainPage.xaml?
The fastest and easiest way to do this is to have a page with the AppBar and a Main Frame.
Create a RootPage.
Add an Appbar.
Add a Frame and name it
something(ex rootFrame)
In the constructor or OnNavigatedTo of
rootPage navigate the rootFrame to your MainPage.
Now you have an AppBar in all pages. In the pages you can use this.Frame.Navigate(...) to navigate. In rootPage where your AppBar is you can use rootFrame.Navigate(...)
Sadly you can't do exactly as you want....But you can implement it with a different approach. Use a single master page - add Frame and a single AppBar. The Frame will take care of Page Navigation. I will also suggest you to use commandBar instead of AppBar in UWP apps.
You can use it in MainPage.xaml as -
<Page
x:Class="App2.MainPage"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="using:App2"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d">
<Page.BottomAppBar>
<AppBar>
</AppBar>
</Page.BottomAppBar>
<Grid Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">
<!--Your Code-->
</Grid>
For example in browsers I can manipulate DOM from JS.
Are there any analogue API?
Is it possible at all?
Update:
We define UI using XAML while developing UWP application.
Can I change UI defined by XAML or is it fixed forever?
You can absolutely change the UI at run time.
Add controls, remove controls, change properties, apply transforms or behaviours, restyle things. It's all possible.
As a simple example.
Given this XAML:
<Page
x:Class="SO33419586.MainPage"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<Grid x:Name="TheGrid"
Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">
<TextBlock>bye bye</TextBlock>
</Grid>
</Page>
we can do the following in code behind:
this.TheGrid.Background = new SolidColorBrush(Colors.Chartreuse);
this.TheGrid.Children.Clear();
this.TheGrid.Children.Add(new Button {Content = "click me"});
When run this creates a view with a green (chartreuse) background and containing a button but no textblock.
The key part here is the x:Name assigned in XAML as that makes it simple to reference controls created that way.
i want to show progress indicator in my windows phone app when System.Tray is not visible (my app is full screen). is there a simple way to show the progress indicator?
Why don't you use ProgresBar control which gives you the same result when you put it on the top of your layout? It's easy to use and looks exactly the same.
<Grid x:Name="LayoutRoot">
<!-- Your controls are here -->
<ProgressBar x:Name="MyProgressBar"
VerticalAlignment="Top"
IsIndeterminate="True" />
</Grid>
That is the benefit of showing SystemTray - you can use it for status messages and progress. If you choose not to use SystemTray, you have to add ProgressBar to the xaml of your Pages.
My Windows phone application working fine with dark color scheme but When the device's theme is set to light my background become white due to that my buttons disappear. How can i set my app background to black even device theme is light???
Try this:
find LayoutRoot and set the Background to your choice of color.
<Grid x:Name="LayoutRoot" Background="Black">
Please see the response at How to stop an (InputScope = Number) textbox from disappearing when it gains focus? for more information on templating controls to override the default system theme.
Also note that I recommend not doing this for the sake of forcing light or dark theme. Unless you've got your own custom branding / color scheme, this is a lot of work and could be annoying / confusing to the user.
How do I change a button's background image in a Metro Style app using VS 2012?
In Windows Forms, a button has a BackgroundImage property that you can set.
Is this feature available for Metro Style apps?
In Windows Forms, I can do the following in C#:
btnImage.BackgroundImage = System.Drawing.Image.FromFile("...\Pictures\flower.png");
How can you programmatically change the button's background image in Metro Style apps ?
Pretty straightforward, actually, just modify the Button's XAML to include a closing tag, and drop an image control in between, like so:
<Grid Background="{StaticResource ApplicationPageBackgroundThemeBrush}">
<Button HorizontalAlignment="Left" Margin="532,285,0,0" VerticalAlignment="Top" Height="135" Width="283">
<Image Source="Assets/Logo.png" />
</Button>
</Grid>
In the snippet above, I'm pointing the image source to the Logo.png file that is part of the built-in templates for C#/XAML apps.
Another way to do it is to open the project in Blend for Visual Studio, drag the image from the Assets tab onto the design surface (making sure you have the desired container selected in the Objects and Timeline pane), and then right-click the image and select Make into Control..., and choose the Button control.
The only downside to this technique is that you don't get the default VisualStates that the built-in Button control has. Instead, Blend defines a style for you with empty VisualStates which you can style as desired.
Hope that helps.