Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
114 commits
Select commit Hold shift + click to select a range
e483f1a
Initial articles
Thraka Aug 3, 2021
d4f5d76
Update include format/path
Thraka Aug 3, 2021
924e691
Merge pull request #75 from dotnet/adegeo-essentials-1
adegeo Aug 3, 2021
1efa438
First two articles ported
Thraka Aug 3, 2021
0065756
Feedback
Thraka Aug 4, 2021
f0c1c3d
Fix includes
Thraka Aug 4, 2021
8b7bb30
Remove xamarin vid include & vid sections
Thraka Aug 4, 2021
fd0b964
Add new include 4 essentials namespace
Thraka Aug 4, 2021
dc8fca0
Article updates
Thraka Aug 4, 2021
c3f8859
Merge pull request #76 from dotnet/adegeo-essentials-1
davidbritch Aug 5, 2021
e90285c
Merge pull request #80 from dotnet/adegeo-essentials-2
davidbritch Aug 5, 2021
85c72ff
Merge pull request #81 from dotnet/adegeo-essentials-3
davidbritch Aug 5, 2021
2f95dbf
Feedback
Thraka Aug 5, 2021
11916a9
Two docs; del color convert, n/a
Thraka Aug 6, 2021
f9a93e8
Mass find/replace on common problems
Thraka Aug 6, 2021
93faa42
Replace yes/no/warn with emoji
Thraka Aug 6, 2021
edaf576
Merge pull request #87 from dotnet/adegeo-essentials-4
adegeo Aug 6, 2021
26c4b23
Port sensor related essentials to sensor.md
adegeo Aug 9, 2021
d052df5
Updates to latex;intro
adegeo Aug 9, 2021
cf1042d
add description
adegeo Aug 9, 2021
5192be2
Fix copy\paste errors+more
adegeo Aug 10, 2021
e6e026d
more feedback
adegeo Aug 10, 2021
8048f54
Merge pull request #90 from dotnet/adegeo-essentials-sensors
davidbritch Aug 11, 2021
7ade130
Fix TOC
adegeo Aug 11, 2021
3810de9
Move essentials
adegeo Aug 11, 2021
4f91351
Merge pull request #106 from dotnet/adegeo-essentials-a
adegeo Aug 11, 2021
fca778a
Another set of migrated
adegeo Aug 13, 2021
e3b7d68
Merge pull request #109 from dotnet/adegeo-essentials-a
davidbritch Aug 13, 2021
5a53c56
Feedback from previous PR
adegeo Aug 16, 2021
9109d5c
Process more articles
adegeo Aug 16, 2021
793f840
Merge pull request #116 from dotnet/adegeo-essentials-a
adegeo Aug 16, 2021
c19ac78
Merge pull request #117 from dotnet/adegeo-essentials-b
davidbritch Aug 17, 2021
5f50822
handle feedback
adegeo Aug 17, 2021
bad8a48
Merge pull request #119 from dotnet/adegeo-essentials-feed
adegeo Aug 17, 2021
07d1b0c
More items for review
adegeo Aug 17, 2021
1945426
Merge pull request #120 from dotnet/adegeo-essentials-a
davidbritch Aug 18, 2021
f3b6433
feedback
adegeo Aug 18, 2021
3627bd5
Merge pull request #123 from dotnet/adegeo-essentials-feedback
adegeo Aug 18, 2021
f52e05f
Lots of updates
adegeo Aug 19, 2021
6781670
More fixes
adegeo Aug 19, 2021
ff3fe18
Merge pull request #127 from dotnet/adegeo-essentials-a
davidbritch Aug 20, 2021
18a54ed
Feedback
adegeo Aug 20, 2021
2ec586c
Merge pull request #131 from dotnet/adegeo-essentials-feedback
adegeo Aug 20, 2021
d0efd0b
Another set
adegeo Aug 27, 2021
cd8a3dd
Merge pull request #144 from dotnet/adegeo-essentials-a
davidbritch Aug 31, 2021
8ad448b
temp
adegeo Sep 14, 2021
d4b1670
temp
adegeo Sep 16, 2021
9c466a0
99% finished
adegeo Sep 17, 2021
0fba329
final article
adegeo Sep 21, 2021
1dfad97
Merge pull request #163 from dotnet/adegeo-essentials-a
davidbritch Sep 22, 2021
041514a
Handled feedback
adegeo Oct 4, 2021
b3c3320
Remove troubleshooting article
adegeo Oct 4, 2021
13c890e
SemanticScreenReader (#177)
davidbritch Oct 5, 2021
f083cc7
Merge branch 'main' of github.adegeo:dotnet/docs-maui into adegeo-ess…
adegeo Apr 23, 2022
62cc892
essentials restructure 1
adegeo Apr 24, 2022
a5c0696
Ported sensors and added code
adegeo Apr 29, 2022
7918d99
minor adjustments
adegeo Apr 29, 2022
940e1cb
add namespace note; under construction note
adegeo Apr 29, 2022
6fb2cee
fix sensors
adegeo Apr 29, 2022
1f606f0
link fixes
adegeo Apr 29, 2022
4331c0d
fix essentialsindex
adegeo Apr 29, 2022
3d8ba50
fix links to includes that will go away
adegeo Apr 29, 2022
f174701
move images
adegeo Apr 29, 2022
8b7b1ed
more include bugs
adegeo Apr 29, 2022
f674235
move includes to shared area
adegeo Apr 29, 2022
18ccff8
fix last errors hopefully!
adegeo Apr 29, 2022
216cebe
add battery
adegeo May 3, 2022
c49aea1
Minor
adegeo May 3, 2022
37cb852
more code
adegeo May 4, 2022
3ac24b6
Add more device features
adegeo May 4, 2022
fc7fd1e
fix toc
adegeo May 4, 2022
f4f0a20
Update code
adegeo May 5, 2022
29d76cf
updated more articles
adegeo May 5, 2022
3bdc9ad
toc
adegeo May 5, 2022
7278165
fix code snippet
adegeo May 5, 2022
14ff098
fix code snippet
adegeo May 5, 2022
64c2151
Add app info
adegeo May 6, 2022
85b6df3
more ported articles
adegeo May 10, 2022
32a8707
remove ref to source code
adegeo May 10, 2022
01286f7
Comms
adegeo May 11, 2022
0f930b7
reader
adegeo May 11, 2022
bf980fe
fixes
adegeo May 11, 2022
756ac51
moar!!!!
adegeo May 12, 2022
633ff2d
Toc; file rename
adegeo May 12, 2022
09c35a3
web auth
adegeo May 12, 2022
bdf63ff
storage area
adegeo May 13, 2022
7563717
networking
adegeo May 13, 2022
745a288
lint
adegeo May 13, 2022
232388c
remove old namespace
adegeo May 13, 2022
82db011
build fixes
adegeo May 13, 2022
21287e9
fix the snippet links
adegeo May 13, 2022
693f302
in progress 1
adegeo May 18, 2022
20578aa
in progress 2
adegeo May 19, 2022
84db9da
in progress 3
adegeo May 19, 2022
a6b2955
in progress 4
adegeo May 19, 2022
19b6b73
Update app-startup to talk about essentials
adegeo May 19, 2022
fccbbb0
in progress 5
adegeo May 19, 2022
b0156f0
more app startup updates
adegeo May 20, 2022
5df7813
handle build errors
adegeo May 20, 2022
f4a8e56
fix link
adegeo May 20, 2022
8dfb0e7
Merge branch 'main' of github.adegeo:dotnet/docs-maui into adegeo-ess…
adegeo May 20, 2022
e187bfa
Feedback fixes
adegeo May 21, 2022
91f0997
secure storage update
adegeo May 21, 2022
66af5d5
try fix build errs
adegeo May 21, 2022
74f3027
restore file
adegeo May 21, 2022
fe02dce
redirects
adegeo May 21, 2022
35721d3
Version tracking > geocoding.
davidbritch May 23, 2022
995975c
Android differences update.
davidbritch May 23, 2022
4f9b297
Update dates.
davidbritch May 23, 2022
98fc5d9
Comment out UWP API doc links for now.
davidbritch May 23, 2022
9967c62
Revert "redirects"
davidbritch May 23, 2022
225c707
Restore supported platforms.
davidbritch May 23, 2022
602f10d
Rearrange TOC.
davidbritch May 23, 2022
ddf1724
Edits.
davidbritch May 23, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
log/
bin/
obj/
_site/
.optemp/
_themes*/
_repo.*/
.vs/

.openpublishing.buildcore.ps1
.DS_Store
78 changes: 78 additions & 0 deletions docs/TOC.yml
Original file line number Diff line number Diff line change
Expand Up @@ -413,6 +413,84 @@
href: user-interface/visual-states.md
- name: Platform integration
items:
- name: Application model
items:
- name: App actions
href: platform-integration/appmodel/app-actions.md
- name: App information
href: platform-integration/appmodel/app-information.md
- name: Browser
href: platform-integration/appmodel/open-browser.md
- name: Launcher
href: platform-integration/appmodel/launcher.md
- name: Main thread
href: platform-integration/appmodel/main-thread.md
- name: Maps
href: platform-integration/appmodel/maps.md
- name: Permissions
href: platform-integration/appmodel/permissions.md
- name: Version tracking
href: platform-integration/appmodel/version-tracking.md
- name: Communication
items:
- name: Contacts
href: platform-integration/communication/contacts.md
- name: Email
href: platform-integration/communication/email.md
- name: Networking
href: platform-integration/communication/networking.md
- name: Phone dialer
href: platform-integration/communication/phone-dialer.md
- name: SMS (messaging)
href: platform-integration/communication/sms.md
- name: Web authentication
href: platform-integration/communication/authentication.md
- name: Device features
items:
- name: Battery
href: platform-integration/device/battery.md
- name: Device display
href: platform-integration/device/display.md
- name: Device information
href: platform-integration/device/information.md
- name: Device sensors
href: platform-integration/device/sensors.md
- name: Flashlight
href: platform-integration/device/flashlight.md
- name: Geocoding
href: platform-integration/device/geocoding.md
- name: Geolocation
href: platform-integration/device/geolocation.md
- name: Haptic feedback
href: platform-integration/device/haptic-feedback.md
- name: Vibration
href: platform-integration/device/vibrate.md
- name: Media
items:
- name: Photo picker
href: platform-integration/device-media/picker.md
- name: Screenshot
href: platform-integration/device-media/screenshot.md
- name: Text-to-speech
href: platform-integration/device-media/text-to-speech.md
- name: Unit converters
href: platform-integration/device-media/unit-converters.md
- name: Sharing
items:
- name: Clipboard
href: platform-integration/data/clipboard.md
- name: Share files and text
href: platform-integration/data/share.md
- name: Storage
items:
- name: File picker
href: platform-integration/storage/file-picker.md
- name: File system helpers
href: platform-integration/storage/file-system-helpers.md
- name: Preferences
href: platform-integration/storage/preferences.md
- name: Secure storage
href: platform-integration/storage/secure-storage.md
- name: Configure multi-targeting
href: platform-integration/configure-multi-targeting.md
- name: Invoke platform code
Expand Down
10 changes: 7 additions & 3 deletions docs/fundamentals/accessibility.md
Original file line number Diff line number Diff line change
Expand Up @@ -176,13 +176,17 @@ label.SetSemanticFocus();

## Semantic screen reader

.NET MAUI Essentials includes a `SemanticScreenReader` class that enables you to instruct a screen reader to announce specified text. This can be achieved by calling the `SemanticScreenReader.Announce` method, passing a `string` argument that represents the text:
.NET Maui provides the `ISemanticScreenReader` interface, with which you can instruct a screen reader to announce text to the user. The interface is exposed through the `SemanticScreenReader.Default` property, and is available in the `Microsoft.Maui.Accessability` namespace.

To instruct a screen reader to announce text, use the `Announce` method, passing a `string` argument that represents the text. The following example demonstrates using this method:

```csharp
SemanticScreenReader.Announce("This is the announcement text.");
SemanticScreenReader.Default.Announce("This is the announcement text.");
```

<!-- For more information, see [SemanticScreenReader]().-->
### Limitations

The default platform screen reader must be enabled for text to be read aloud.

<!--
### Semantic effects
Expand Down
2 changes: 0 additions & 2 deletions docs/index.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@ landingContent:
links:
- text: What is .NET Multi-platform App UI?
url: what-is-maui.md
- text: Supported platforms
url: supported-platforms.md
- title: Get started
linkLists:
- linkListType: how-to-guide
Expand Down
88 changes: 88 additions & 0 deletions docs/platform-integration/appmodel/app-actions.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
---
title: "App actions (shortcuts)"
description: "Describes the IAppActions interface in the Microsoft.Maui.ApplicationModel namespace, which lets you create and respond to app shortcuts from the app icon."
ms.date: 05/23/2022
no-loc: ["Microsoft.Maui", "Microsoft.Maui.ApplicationModel", "AppDelegate.cs", "AppActions", "Platforms/Android/MainActivity.cs", "Platforms/iOS/AppDelegate.cs", "Platforms/Windows/App.xaml.cs", "Id", "Title", "Subtitle", "Icon"]
---

# App actions

This article describes how you can use the .NET Multi-platform App UI (.NET MAUI) `IAppActions` interface, which lets you create and respond to app shortcuts. App shortcuts are helpful to users because they allow you, as the app developer, to present them with extra ways of starting your app. For example, if you were developing an email and calendar app, you could present two different app actions, one to open the app directly to the current day of the calendar, and another to open to the email inbox folder.

[!INCLUDE [docs under construction](~/includes/preview-note.md)]

The `IAppActions` interface is exposed through the `AppActions.Current` property, and is available in the `Microsoft.Maui.ApplicationModel` namespace.

## Get started

To access the `AppActions` functionality, the following platform specific setup is required.

<!-- markdownlint-disable MD025 -->

# [Android](#tab/android)

In the _Platforms/Android/MainActivity.cs_ file, add the following `IntentFilter` attribute to the `MainActivity` class:

:::code language="csharp" source="../snippets/shared_2/Platforms/Android/MainActivity.cs" id="intent_filter_1":::

# [iOS](#tab/ios)

No setup is required.

# [Windows](#tab/windows)

No setup is required.

-----

<!-- markdownlint-enable MD025 -->

## Create actions

App actions can be created at any time, but are often created when an app starts. To configure app actions, add the `ConfigureEssentials` step to the `CreateMauiApp` bootstrap code. The app startup code is configured in the _MauiProgram.cs_ file. There are two methods you must call to enable an app action:

01. `AddAppAction`

This method creates an action. It takes an `id` string to uniquely identify the action, and a `title` string that's displayed to the user. You can optionally provide a subtitle and an icon.

01. `OnAppAction`

The delegate passed to this method is called when the user invokes an app action, provided the app action instance. Check the `Id` property of the action to determine which app action was started by the user.

The following code demonstrates how to configure the app actions at app startup:

:::code language="csharp" source="../snippets/shared_1/MauiProgram.cs" id="bootstrap_appaction" highlight="12-18":::

## Responding to actions

After app actions [have been configured](#create-actions), the `OnAppAction` method is called for all app actions invoked by the user. Use the `Id` property to differentiate them. The following code demonstrates handling an app action:

:::code language="csharp" source="../snippets/shared_1/App.xaml.cs" id="appaction_handle":::

### Check if app actions are supported

When you create an app action, either at app startup or while the app is being used, check to see if app actions are supported by reading the `AppActions.Current.IsSupported` property.

### Create an app action outside of the startup bootstrap

To create app actions, call the `SetAsync` method:

:::code language="csharp" source="../snippets/shared_2/MainPage.xaml.cs" id="app_actions":::

### More information about app actions

If app actions aren't supported on the specific version of the operating system, a `FeatureNotSupportedException` will be thrown.

The following properties can be set on an `AppAction`:

- **Id**: A unique identifier used to respond to the action tap.
- **Title**: the visible title to display.
- **Subtitle**: If supported a subtitle to display under the title.
- **Icon**: Must match icons in the corresponding resources directory on each platform.

<!-- TODO icon in image needs update -->
:::image type="content" source="media/app-actions/appactions.png" alt-text="App actions on home screen.":::

## Get actions

You can get the current list of app actions by calling `AppActions.Current.GetAsync()`.
104 changes: 104 additions & 0 deletions docs/platform-integration/appmodel/app-information.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@
---
title: "App Information"
description: "Describes the IAppInfo interface in the Microsoft.Maui.ApplicationModel namespace, which provides information about your application. For example, it exposes the app name and version."
ms.date: 05/23/2022
no-loc: ["Microsoft.Maui", "Microsoft.Maui.ApplicationModel"]
---

# App information

This article describes how you can use the .NET Multi-platform App UI (.NET MAUI) `IAppInfo` interface, which provides information about your application. The `IAppInfo` interface is exposed through the `AppInfo.Current` property.

[!INCLUDE [docs under construction](~/includes/preview-note.md)]

The `AppInfo` and `IAppInfo` types are available in the `Microsoft.Maui.ApplicationModel` namespace.

## Read the app information

There are four properties exposed by the `IAppInfo` interface:

- `IAppInfo.Name` &mdash; The application name
- `IAppInfo.PackageName` &mdash; The package name or application identifier, such as `com.microsoft.myapp`.
- `IAppInfo.VersionString` &mdash; The application version, such as `1.0.0`.
- `IAppInfo.BuildString` &mdash; The build number of the version, such as `1000`.

The following code example demonstrates accessing these properties:

:::code language="csharp" source="../snippets/shared_1/AppModelPage.xaml.cs" id="read_info":::

## Read the current theme

The `RequestedTheme` property provides the current requested theme by the system for your application. One of the following values is returned:

- `Unspecified`
- `Light`
- `Dark`

`Unspecified` is returned when the operating system doesn't have a specific user interface style. An example of this is on devices running versions of iOS older than 13.0.

The following code example demonstrates reading the theme:

:::code language="csharp" source="../snippets/shared_1/AppModelPage.xaml.cs" id="read_theme":::

## Display app settings

The `IAppInfo` class can also display a page of settings maintained by the operating system for the application:

:::code language="csharp" source="../snippets/shared_1/AppModelPage.xaml.cs" id="show_settings":::

This settings page allows the user to change application permissions and perform other platform-specific tasks.

## Platform implementation specifics

This section describes platform-specific implementation details related to the `IAppInfo` interface.

<!-- markdownlint-disable MD025 -->

# [Android](#tab/android)

App information is taken from the _AndroidManifest.xml_ for the following fields:

- **Build** &mdash; `android:versionCode` in `manifest` node
- **Name** &mdash; `android:label` in the `application` node
- **PackageName** &mdash; `package` in the `manifest` node
- **VersionString** &mdash; `android:versionName` in the `application` node

### Requested theme

Android uses configuration modes to specify the type of theme to request from the user. Based on the version of Android, it can be changed by the user or may be changed when battery saver mode is enabled.

You can read more on the official [Android documentation for Dark Theme](https://developer.android.com/guide/topics/ui/look-and-feel/darktheme).

# [iOS](#tab/ios)

App information is taken from the _Info.plist_ for the following fields:

- **Build** &mdash; `CFBundleVersion`
- **Name** &mdash; `CFBundleDisplayName` if set, else `CFBundleName`
- **PackageName** &mdash; `CFBundleIdentifier`
- **VersionString** &mdash; `CFBundleShortVersionString`

### Requested theme

_Unspecified_ is always returned on versions of iOS older than 13.0

# [Windows](#tab/windows)

App information is taken from the _Package.appxmanifest_ for the following fields:

- **Build** &mdash; Uses the `Build` from the `Version` on the `Identity` node
- **Name** &mdash; `DisplayName` on the `Properties` node
- **PackageName** &mdash; `Name` on the `Identity` node
- **VersionString** &mdash; `Version` on the `Identity` node

### Requested theme

Code that accesses the `IAppInfo.RequestedTheme` property must be called on the UI thread or an exception will be thrown.

Windows applications respect the `RequestedTheme` property setting in the Windows _App.xaml_. If it's set to a specific theme, this API always returns this setting. To use the dynamic theme of the OS, remove this property from your application. When your app is run, it returns the theme set by the user in Windows settings: **Settings** > **Personalization** > **Colors** > **Choose your default app mode**.

<!-- TODO: You can read more on the [Windows Requested Theme Documentation](/uwp/api/windows.ui.xaml.application.requestedtheme). -->

--------------

<!-- markdownlint-enable MD025 -->
Loading