How to load an xml page in windows phone? - windows-phone

I'm working on a windows phone project where I have some xml files with a layout in each of them. How can I make programmatically one of them the current layout displayed in the application???? I'm working with C#. Thanks!!!

Use XamlReader Class.
Load the xaml into that XAMLReader, it will return which ever control it is.
Bind that to the view.

Related

Windows Phone equivalent to Android "tools:text"

When creating layout in Android I can preview texts and others properties without actually applying the value using tools attribute. There something like that for Windows Phone ? I want to preview how my layout without change the Binding properties.
If I understand what the Android attributes do correctly the similar feature to allow fake data in the Xaml designer is design-time attributes. You can apply attributes such as d:DataContext and d:DesignSource to provide preview data in the designer.
See Displaying Data in the Designer in MSDN's data binding overview for example code.

Windows phone 8.1 wizard control

I need to create an app that has a few setttings that need to be set before the application can continue i would like to do that using some sort of wizard. I looked at other apps and found that the 'Kid's corner' app does exactly what i want.
My question is is that a default control or is it a custom control. If it's a custom control how would one create one.
There is no specific template to accomplish this task. The most common way to do it would be to create a separate page for the wizard. On the page you'll use various controls to actually create a settings page. Most likely these will include Textblock (for static text), TextBox (for text entry), and ToggleSwitch for binary (e.g. On/Off) options. Here's an example of what you could use to create a very simple welcome wizard that allows the user to turn live tiles on or off.
<TextBlock Text="Welcome to the app!">
<ToggleSwitch x:Name="toggleSwitch1" Header="Turn on live tiles?"
OnContent="On" OffContent="Off"
Toggled="ToggleSwitch_Toggled"/>
If you need more info please ask :)
Reference for ToggleSwitch: http://msdn.microsoft.com/en-us/library/windows/apps/xaml/hh868198.aspx

Refering Image in User Control Library in Windows Phone

I am creating a user control Library in windows phone. It has default images in it for background and icons.
The code I am writing in my user control file is
<ImageBrush ImageSource="/Assets/dropDownArrow.png"/>
/Assets/dropDownArrow.png is refered to the location in the project where the usercontrol is being used.
But I want to store these images or any file in my user controller's .dll.
Can anyone help me in this?
Thanks
In VS's solution explorer right-click on your image, select Properties and here set Build Content to Resource. Image will be compiled into DLL.
For this, Use DependencyProperty. Set The DependencyProperty To ImageSource.
and whereever you want to use this in code, make a function and pass values

Windows Store app - Grid app with different items

I have to do a Windows Store application in XAML and C#, and the "Grid app" template is almost exactly what I need...
The problem is that this template displays same items, divided in groups.
For my app, I would like to do exactly the same thing but for different type of items instead and have a different details page for each type of item...
This is my first app and I don't manage to do it... How can I do it easily ?
The new "Hub" control of Windows 8.1 would be really perfect, But I can't work with Visual studio 2013 and Windows 8.1... :
http://mikaelkoskinen.net/winrt-xaml-hub-control-getting-started-tutorial-semanticzoom/
Thanks
I finally found the solution.
I had to use a TemplateSelector :
http://channel9.msdn.com/Series/Migrating-apps-from-Windows-Phone-to-Windows-8/Custom-Styling-in-Windows-Store-Apps

Refer to an element of a another page (Windows 8)

i am using a c# flyout in my windows 8 store app. When i open my custom flyout (i.e. Settings) i want to hide the advertisment that is in the page below the flyout. Is
there a way that i can refer to this Ad within the code of my flyout page?
Thanks very much
The best practice is to use attached behavior (see nuget package winrtbehavior), you can attach the property and when the popup is loaded you can invoke the command to hide the adcontrol