Windows8 App FileOpenPicker - Setting the Position and Size - windows-8

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.

Related

Xamarin: How do I set a placeholder image in my Image element in XAML?

In Android, it is quite easy to set a image placeholder for development purposes in an imageview.
All one would do is use the tools:src for the placeholder image during development so you could see it in your layout design preview and your actual image you would put into your android:src
. Frequently, you don't set the android:src put would populate that imageview with images that you download off the internet once you connect your app to the net:
<ImageView
android:layout_width="28dp"
android:layout_height="28dp"
android:src=#drawable/activated_icon"
tools:src="#mipmap/white_activated_icon" />
In Xamarin, you have this to display images:
<Image Source="http://lorempixel.com/1920/1080/nature/3" />
Once the app connects, the image is downloaded from the internet and displayed. How do I put in a placeholder image for development purposes (similar to the way you would do it through tools:src in android) so I can see it within the layout design previews?
I'm assuming you want to achieve this with Xamarin Forms, as you referring to XAML in the question title.
Or possibly you are referring to the Xamarin Forms Previewer? In that case, disregard the following answer. You can only use local images in the Previewer as far as I can tell.
Answer in case the question is related to runtime Xamarin Forms
There is no standard option to do this in Xamarin Forms. Take a look at this example suggested by Stephane Delcroix from the Xamarin Forums. The important part of this approach is to stack 2 images on top of each other in a grid. 1 is the placeholder that is placed beneath the image that is being loaded, like this:
var grid = new Grid();
grid.RowDefinitions.Add (new RowDefinition());
grid.Children.Add (image);
grid.Children.Add (placeholderImage);
As an alternative option, WebImage of Xamarin Forms Labs allows an option for a DefaultImage, but I'm not sure if that shows immediately. See this class for the code of the Web Image. Keep in mind that Xamarin Forms Labs is no longer under active maintenance.
Of course you can also write a custom renderer. Maybe based on the Xamarin Forms Labs example.
I use FFImageLoading for this Case.
Just install the Nuget Package and Use the "CachedImage" in XAML.
<ff:CachedImage Source="your url" Placeholder="placeholder while loading"/>
You donĀ“t need to download (and cache) the Image manually then. It will automatically displayed when the download is done.
You can use local files (from Resources or Drawable) and files from HTTP/HTTPS.

Setting ApplicationBarButton.IconUri with icon from Isolated Storage

I am working on windows phone application in which i need to change ApplicationBarButton icon dinamically, for example to show current date like in default Windows Phone Calendar app. Regarding to this article, we can use only png images previously added to solution and reference to them with relative Uri.
It is not a problem for me to generate correct png image (this way and using ToolStack C# PNG Writer Library) and save it to isolated storage, but when i'm initializing AppBarButton with absolute Uri to this image and trying to add it to ApplicationBar, my app throws ArgumentException.
Am i doing something wrong or i just have to draw 366 icons and add them to my project? :)
Thanks in advance!

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.

Directions Side Bar in Windows 8 Maps Application?

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.

How to display a Windows 8 metro style tile within an app?

Windows 8 metro style app tiles are created based on pre-defined xml templates (found here).
Is there any way to hook up to Windows' rendering of the tile to allow a tile preview within an app?
In my app I would like to offer the user a subset of the tile templates listed in the above link and let the user customize the tile content. A live preview of the customized tile rendered within my app would greatly improve the user experience.
you should look into HubTile.
I don't know any free control's right now, but Telerik and Syncfusion have HubTile control
You can't get access to real Windows tile rendering, but you can simulate it since all templates are known. It is very unlikely that Microsoft would change the way tiles are rendered and even if they do you should be able to issue app update to keep up with Microsoft.