Sharing Between Apps

 

Windows 8 supports a new low‑level feature called Contracts that works much like Copy and Paste does in that the applications (or, in this case, apps) on either end of the sequence–those that are participating in the contract–don’t need to know anything about the other. That is, they only need to support the appropriate contract. One of the most common is the Share contract, which lets one app share information with another.

A contract, of course, is a two‑way street, with one app initiating the operation, or “sending” the share request, and the other completing the operation by “accepting” it. So while you are able to share information between many Metro‑style apps using the Share contract, most will only support one end of the contract. That is, they will send, or they will receive.

The canonical example of such a transaction is the web: You’re browsing around your favorite website one morning and come across an article that you simply must share with someone else. In the days before Windows 8 and Metro, this kind of sharing would have occurred in two fairly limited ways. Either the browser would have been specifically designed (or “hard‑coded”) to facilitate the sharing of web pages (perhaps via e‑mail or a social networking service like Facebook) or a third‑party developer would have written a browser add‑on, or extension, to add that capability to the browser.

Either would work. But both solutions are specific to that one browser. If you decide to use a different web browser, you’re out of luck. And if you want to share via a service or other mechanism that’s not supported by the browser you use–perhaps one that’s not been invented yet–you’re equally out of luck.

In Windows 8, Metro‑style apps simply need to support the Share charm. They can support initiating a share action, and they can separately (or only) support receiving a share action. The Metro‑style version of Internet Explorer 10, Microsoft’s web browser, supports initiating a share action, so you can share web pages with others. But it doesn’t need to know which app you’re using to share that page. And that’s because any number of apps support receiving the share. One that’s included in Windows 8 is the Mail app: You can use this app to share a page from IE 10 via e‑mail, as shown in Figure 3‑21. But as time goes on, many other apps will appear that will let you share web pages via other means, such as with different social networks.

This capability means that Windows 8 will get better over time without Microsoft needing to update the OS itself. Third‑party developers will extend the system’s abilities by implementing the Share contract, and by doing so will make Windows 8, and many other apps that run within it, better than they were before.

Figure 3‑21: Sharing a web page from Internet Explorer, with Mail.

 








Дата добавления: 2015-05-13; просмотров: 906;


Поиск по сайту:

При помощи поиска вы сможете найти нужную вам информацию.

Поделитесь с друзьями:

Если вам перенёс пользу информационный материал, или помог в учебе – поделитесь этим сайтом с друзьями и знакомыми.
helpiks.org - Хелпикс.Орг - 2014-2024 год. Материал сайта представляется для ознакомительного и учебного использования. | Поддержка
Генерация страницы за: 0.004 сек.