Directions Side Bar in Windows 8 Maps Application? - windows-8

I'm new to Windows 8 development. I want to implement something similar to the following in Microsoft Maps application for Windows 8:
In the maps app, when the user clicks on Directions menu item in the app bar, a side bar appears on the right.
How can I implement such a side bar ?

Unfortunately there's no such control built-in in WinRT. The closest to what your looking for would be SettingsFlyout control from Callisto. It's not ideal for this case, since it was designed to be used as settings flyout. Most notably you'd need to get rid of the back button which opens up the settings charm. You could try overriding the style or taking the control source code and modifying it.
It's really simple to use, though:
var flyout = new SettingsFlyout();
flyout.FlyoutWidth = SettingsFlyout.SettingsFlyoutWidth.Narrow;
flyout.HeaderText = "Flyout";
flyout.Content = new FlyoutControl();
flyout.IsOpen = true;
FlyoutControl would be a custom UserControl you want to display.

Related

Changing the chrome of a Windows 10 Universal XAML app

I would like to modify the design of the chrome and top menu panel of my app where the close and minify icons are.
How do I do this and in what XAML file? Should it be done in App.xaml, or in my main page's xaml file? I can find instructions on how to do this in a WPF app, but the concepts don't seem to carry over to Univeral App XAML.
As far as I know, you can change some settings from the chrome bar in the uwp, but not fully customize it by default.
The starting point for doing so would be the ApplicationView's TitleBar property.
This allows you to change the colors of the buttons and the bar itself:
var titleBar = ApplicationView.GetForCurrentView().TitleBar;
if (titleBar != null)
{
titleBar.ButtonBackgroundColor = Colors.DarkBlue;
titleBar.ButtonForegroundColor = Colors.White;
titleBar.BackgroundColor = Colors.Blue;
titleBar.ForegroundColor = Colors.White;
}
It is worth mentioning that when running the application on a PC, the control is called TitleBar but on a mobile device, it is called StatusBar. Full example for handling both devices can be found here.
If you need more personalization options, creating your own TitleBar component should be possible, look for the ExtendViewIntoTitleBar property of the CoreApplicationViewTitleBar object.
More info can be found here.
You need to use a resource dictionary with the custom styles. You can import these themes via App.Xaml to apply it.
These links might be of help. If you have any specific questions feel free to ask.
ResourceDictionary and XAML resource references
XAML theme resources

Programmatically change page background in Windows 8 Metro App

I'm new to Windows 8 development and I'm stuck on the this question. Basically, I have main page and I want change its background image every time when application is started. Please help !!!!
Create a Uri in your ViewModel, and have your Background's ImageBrush bind to this Uri. Then, on app startup, have your app just change the Uri to whatever new image you want, using whatever logic you want.
Also, when using ImageSource as you mentioned in the comments, you should be using SetSource.

Windows8 App FileOpenPicker - Setting the Position and Size

Developing a windows 8 application in which i am using FileOpenPicker.
FileOpenPicker picker = new FileOpenPicker();
picker.SuggestedStartLocation = PickerLocationId.PicturesLibrary;
picker.ViewMode = PickerViewMode.Thumbnail;
picker.FileTypeFilter.Add(".jpg");
picker.FileTypeFilter.Add(".jpeg");
picker.FileTypeFilter.Add(".png");
picker.FileTypeFilter.Add(".tiff");
picker.FileTypeFilter.Add(".gif");
Is there a way to adjust the location and size of the FileOpenPicker? I do not want the FileOpenPicker to occupy the complete screen. I did not see any options in FileOpenPicker class.
I do not want to go with the option of developing a custom file picker since I would have to then do all the functionality of FileOpenPicker (like integrating with File Picker contracts) etc.
Please provide input whether it is feasible.
It is not possible. Windows Store apps are designed so they could be immersive and display only relevant content on the screen. So, they are always full screen, except when you snap them.

WinRt WebView control handling navigation within the control

I have a Metro app using a WebView control. I'm using NavigateToString to load a html file which may contain hyperlinks. What I then want to do is detect when one of these hyperlinks is selected and, instead of allowing navigation within the WebView control, to launch IE and view the page there instead.
Is this possible within the WinRT constraints, and if so, how?
So far, I've tried capturing the WebView_LoadCompleted() event, but although it does fire at the right time, I can't see any details about the URI from the NavigationEventArgs.
Unfortunately this isn't possible directly because WebView does not include events like Navigating (which were present in Windows Phone).
Luckily Nick Randolph (brilliant Windows Phone and Windows 8 developer) has created a workaround using script events. He's got a great write up on his blog:
http://nicksnettravels.builttoroam.com/post/2012/04/21/Limitations-of-the-WebView-in-Windows-8-Metro-Apps.aspx

How to use AssistiveTouch UI in iOS

I'm now developing an app on iOS. With some reason, I want to use AssistiveTouch UI in my app. For example, there will display a button in my app like AssistiveTouch, if anyone press this button, four buttons will appear like AssistiveTouch, if anyone press one of there four buttons again, some action i set before will excuse.
Does apple support api about this? Or Is there any source code available?
You would have to reimplement this from scratch. There is no public API for either accessing the existing Assistive Touch feature (it has to be turned on by the user in the settings) or for creating a similar UI.