background preloader

UniversalApp

Facebook Twitter

Regroupement de diverses informations et tutoriels sur les universalApps

Windows 8 Save a collection to Application Storage sample in C# for Visual Studio 2012. Čeština, Deutsch, español, français, italiano, 日本語, 한국어, polski, português, русский, Türkçe, 中文(简体) 旧版, 中文(繁體) 舊版. How to get a content from Windows Phone webview control. Serialize / Deserialize an Object to an XML File (Windows Universal apps 8.1) | Developing for Modern Windows. EmailEmail WinRT’s built-in XML serialization makes it easy to save and load data in .xml files. This article will show you how to store an arbitrary object in an .xml file, and then how to load that data back. Typical uses for this would be saving game progress or storing a purchase order. This technique will work for WinRT 8.1 apps, and is therefore compatible with Universal Windows/Windows Phone apps that target version 8.1. Overview We will create a class with two methods – one takes an object and stores the data from that object in an .xml file; the other loads object data from an .xml file.

As an example we’ll create a simple class to demonstrate saving and loading an object. How to use this Code You can add the XmlIO class to any WinRT project. Note: Because this code targets WinRT8.1 you’ll need Visual Studio 2013. Once you have the XmlIO class in your project, just follow the example code for how to use it. Create the XmlIO Class The Code Here is the code for the serialization class. Quickstart: Navigating between pages (XAML) This topic discusses basic navigation concepts and demonstrates how to create an app that navigates between two pages. For help choosing the best navigation pattern for your app, see Navigation patterns. See the Flat navigation and Hierarchical navigation patterns in action as part of our App features, start to finish series. Roadmap: How does this topic relate to others? See: You can create multiple pages for your app and support the user navigating between the pages within the app, similar to how you navigate through pages on a single website.

Note When we discuss navigation for Windows Runtime apps, we mean navigating between pages within an app, not navigating between apps. Prerequisites This topic assumes that you can create a basic Windows Runtime app using C# or Visual Basic. Creating the navigation app Creating the blank app On the Visual Studio menu, choose File > New Project. Next, add two pages to the project. Adding the basic page Now we need to use the pages we added in the app. Developpement Windows Phone - Navigation. Cet article fait partie d’une série d’articles sur le développement Windows Phone. Il s’agit d’une traduction des articles se trouvant sur la MSDN. Sommaire Bien débuter et fondamentaux Visuels et média Travailler avec les données Sondes et autres fonctionnalités spécifiques au téléphone La navigation dans Windows Phone peut être définie comme la capacité qu’à l’utilisateur d’avancer dans différentes pages de contenu. Ce tutorial contient les sections suivantes : Frames et Pages Une page est une collection d’états persistants.

Seulement se déplacer entre deux pages est considéré comme de la navigation dans Windows Phone. Navigation entre Pages 1. 2. Astuce XAML pour MainPage.xaml C# pour MainPage.xaml.cs private void MyButton_Click(object sender, RoutedEventArgs e){ NavigationService.Navigate(new Uri("/SecondPage.xaml", UriKind.RelativeOrAbsolute));} Visual Basic pour MainPage.xam XAML pour SecondPage.xaml C# pour SecondPage.xaml.cs Visual Basic pour SecondPage.x Transmettre des données entre Pages. Quickstart: Local app data (XAML) Learn how to store and retrieve settings and files from the local app data store.

Roadmap: How does this topic relate to others? See: Get the containers for the app's settings and files Use the ApplicationData.LocalSettings property to get the settings in an ApplicationDataContainer object. Use the ApplicationData.LocalFolder property to get the files in a StorageFolder object. Windows.Storage.ApplicationDataContainer localSettings = Windows.Storage.ApplicationData.Current.LocalSettings; Windows.Storage.StorageFolder localFolder = Windows.Storage.ApplicationData.Current.LocalFolder; The next sections use the localSettings and localFolder variables from this section. Write data to a setting Use the ApplicationDataContainer.Values property to access the settings in the localSettings container we got in the previous step. // Simple setting localSettings.Values["exampleSetting"] = "Hello Windows"; An ApplicationDataCompositeValue object contains settings that must be accessed atomically.

Quickstart: Roaming app data (XAML) Learn how to store and retrieve settings and files from the roaming app data store. For info about the roaming app data store and why you'd want to use it, see Roaming app data. Roadmap: How does this topic relate to others? See: Register to receive notification when roaming data changes Register for the DataChanged event.

This example sets DataChangeHandler as the handler for roaming data changes. Get the containers for the app's settings and files Use the ApplicationData.RoamingSettings property to get the settings and the ApplicationData.RoamingFolder property to get the files. Windows.Storage.ApplicationDataContainer roamingSettings = Windows.Storage.ApplicationData.Current.RoamingSettings; Windows.Storage.StorageFolder roamingFolder = Windows.Storage.ApplicationData.Current.RoamingFolder; Write data to a setting Use the ApplicationDataContainer.Values property to access the settings in the roamingSettings container we got in the previous section. Read data from a setting Remarks. Accessing app data with the Windows Runtime (Windows Runtime apps) - Windows app development. App data is mutable data that is specific to a particular app. It includes runtime state, user preferences, and other settings.

App data is created, read, updated, and deleted when the app is running. We recommend that desktop apps use the registry to store their settings and the Program Files folder to store their files. We recommend that Windows Runtime apps use app data stores for settings and files that are specific to each app and user. The system manages the data stores for an app, ensuring that they are kept isolated from other apps and other users. The system also preserves the contents of these data stores when the user installs an update to your app and removes the contents of these data stores completely and cleanly when your app is uninstalled. The application data sample shows how to use the Windows Runtime app data APIs to store and retrieve data that is specific to each user and Windows Runtime app. App data storage These are the data stores: local roaming temporary localcache. Developing Universal Windows Apps with C# and XAML.

Applications universelles - Développement d’applications Windows. Développez une seule fois pour tous les appareils Windows à l’aide de Windows Runtime et d’outils VS unifiés qui vous permettent à la fois de prendre en charge les expériences propres à un appareil en XAML, HTML et DirectX, et de partager le code qui prend en charge ces expériences sur tous les appareils qui utilisent C++, C# ou JavaScript. Une fois votre travail de développement terminé, vous pouvez produire les packages d’application que vous allez soumettre au Windows Store et au Windows Phone Store en une seule action pour mettre votre application à la disposition de vos clients sur n’importe quel appareil Windows.

En ce qui concerne l’expérience du Store, les clients bénéficient d’une identité d’application partagée par le Windows Store et le Windows Phone Store. Using Visual Studio to build Universal XAML Apps - The Visual Studio Blog. At the Build conference, we announced the release of the new converged Windows Phone 8.1 and Windows 8.1 platforms. As a developer, this means you can now build XAML and HTML universal apps that run on both Phone and Tablets by sharing a significant amount of code and content.

To enable building universal apps, we added a number of new features to Visual Studio as part of the Visual Studio Update 2 RC. You have two ways to learn more about these features. One way is through this blog post. The other way is by watching my Build talk that covers all of the material you will see here in more detail: There is no right or wrong way here, so pick either the video or the blog depending on how much time you have. Without further delay, let’s take a quick look at universal apps! To help you get started with building universal apps in C#, C++, and JS, we created new project templates that contain the basic structure and behind-the-scenes configurations to allow you to share code and content:

Quick Start Challenge: Universal App. Developing Universal Windows Apps with HTML and JavaScript Jump Start. Créez des applications en C# pour Windows Phone 8. La révolution de la mobilité est en marche. Nous connaissons tous l’iPhone qui a su conquérir un grand nombre d’utilisateurs, ainsi que les téléphones Android dont le nombre ne cesse de croitre… Ces téléphones intelligents (ou smartphones) deviennent omniprésents dans nos usages quotidiens. Microsoft se devait de monter dans le TGV de la mobilité ! Sont donc apparus, peu après ses deux grands concurrents, les téléphones Windows. Avec un peu plus de retard sur eux, Microsoft attaque ce marché avec plus de maturité qu’Apple qui a foncé en tant que pionnier et nous propose son système d’exploitation : Windows Phone. C’est une bonne nouvelle pour nous !

C’est aujourd’hui un nouveau marché qui s’ouvre à nous avec plein d’applications potentielles à réaliser grâce à nos talents de développeur. Si c’est pour ça que vous vous trouvez sur cette page, alors restez-y ! Des applications dites de gestiondes jeux. Stratégies de partage de code XAML dans les applications universelles (1/2) - Stéphanie Hertrich - Site Home - MSDN Blogs. [Please find the EN version here] Grâce aux applications universelles (Universal apps), les applications multi-plateformes conçues pour Windows 8.1 et Windows Phone 8.1 peuvent accéder à de nouveaux scénarios de partage de code. Dans Visual Studio, une solution “universelle” contient au minimum 3 projets : un pour Windows 8.1 (application du store), un pour Windows Phone 8.1 (version WinRT), et un autre appelée “Shared” pour les éléments communs. Dans le projet shared, on ne partage pas les binaires comme c’est le cas pour les projets de type PCL, mais des fichiers comme des ressources, des images, du xml, du XAML, du code, etc, qui seront réutilisés dans chaque projet spécifique à une plateforme.

Dans cet article, je me focaliserai sur le partage de code XAML. C’est une possibilité attrayante même si l’idée n’est pas de partager 100% du code XAML entre les plateformes. L’article est divisé en 2 parties: Vous pouvez télécharger le code source de cette application de démo ici: MainPageVM.cs. Implementing a SettingsFlyout (settings pane) in Windows Store Apps 8.1 » Iris Classon. Time for me to start updating the old blog posts on Windows Store Apps, or rather- provide the Windows 8.1 equivalents. The first one is the Settingspane blog post. Previously you had to either hand craft one, or pull in a third party library. Now a control has been provided which makes it easier to add a Settingspane to an application. Here is how you do it: (and yes, images and code is same as in the answer I provided on StackOverflow, they dislike links as links die, so therefore the duplication.) Right click on project and select : Add => New => SettingsFlyout Then you simply register your commands.

Commands are the text links that the user will see in the *system* settings pane- the one that you cannot change the look of. Here is how to add the command, and have the MySettingsFlyout that we created open. In case the gets all messed up again, here is an image of the code above. Adding settings to Windows 8.1 Store apps with the new SettingsFlyout control.

We need to follow precise guidelines to add settings management in Windows Store apps: we must add commands to the Settings Charm and create a UI that respects strict rules. However, Windows 8 doesn’t provide a built-in control to define the so called Settings Flyout, so it is necessary to manually create it starting from the Popup control, or use third-party toolkits like Callisto. Things change with Windows 8.1. The new SettingsFlyout control makes it easy to create settings panels that conform to UI guidelines. First of all, we need to add a new Settings Flyout item to the project: Settings Flyout definitions Let’s take a look to the XAML declaration of the item: This code defines the following user interface: The IconSource and Title properties represent, respectively, the icon image and the title displayed in the settings flyout header.

Note that the Back button is added automatically and is fully funcional, so we don’t need to write any code to handle it. Like this: Like Loading... Add navigation and views in a C++ universal Windows app (tutorial 3 of 4) - Windows app development. This part of the C++ tutorial series teaches how to add pages and navigation, arrange controls and content on a page, and adapt the page layout to different orientations and views. We're going to use the design tools in Visual Studio, but you can also create and modify a UI by typing XAML directly into the code editor.

The UI design for your Store app is about defining its pages, the navigation between the pages, and the layout of content and commands on each page. Navigation patterns can help you choose the best navigation pattern for your app. Note See the two primary navigation patterns (Flat navigation and Hierarchical navigation) in action as part of our App features, start to finish series. Before you start... This is the third tutorial in a series. Step 1: Add pages and navigation In this tutorial, we go over the basics of creating a user interface in XAML.

The first thing to do is add a new page and a way to get to it from the MainPage. Add the photo viewer page To add a page. Quickstart: Add app settings (XAML) Add customized settings to your app's Settings pane using the XAML SettingsFlyout control. All Windows Store apps automatically participate in the Settings contract. Even if you never modify your app's settings, a user will be able to click on the Settings charm from within your app and see a default Settings pane. This default, system-provided Settings pane contains a Permissions link as well as six system settings, including volume, network information, and power. However, you can customize this pane by creating your own app settings with the SettingsFlyout control and linking to these new custom settings from the Settings pane. This quickstart shows you how to make a new SettingsFlyout, add app-specific content and controls, and incorporate the new setting into the Settings pane using a new SettingsCommand and the SettingsPane.CommandsRequested event.

See this feature in action as part of our App features, start to finish series: Windows Store app UI, start to finish Prerequisites. SettingsFlyout class - Windows app development.