Skip to content

Commit

Permalink
Merge branch 'main' into windows/update/8.1.240329-rc
Browse files Browse the repository at this point in the history
  • Loading branch information
jfversluis authored Apr 2, 2024
2 parents 443e2d6 + 3af1fa3 commit b123a97
Show file tree
Hide file tree
Showing 23 changed files with 106 additions and 35 deletions.
21 changes: 21 additions & 0 deletions .github/workflows/check-for-build-warnings.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: 'OPS status checker'

on:
pull_request_target:
types: [opened, synchronize, reopened]

jobs:
status_checker_job:
name: Look for build warnings
runs-on: ubuntu-latest
permissions:
statuses: write
issues: write
pull-requests: write
steps:
- uses: actions/checkout@v3
- uses: dotnet/docs-actions/actions/status-checker@main
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
docs_path: "docs"
url_base_path: "dotnet/communitytoolkit"
12 changes: 8 additions & 4 deletions docs/maui/behaviors/animation-behavior.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ The `AnimationBehavior` is a `Behavior` that provides the ability to animate any

The `AnimationType` property is required to be set, possible options for this can be found at [Animations](../animations/index.md).

[!INCLUDE [important note on bindings within behaviors](../includes/behavior-bindings.md)]

## Syntax

The following examples show how to add the `AnimationBehavior` to a `Label` and use the `FadeAnimation` to animate a change in opacity.
Expand All @@ -24,10 +26,12 @@ The following examples show how to add the `AnimationBehavior` to a `Label` and
#### Using the AnimationBehavior

```xaml
<ContentPage xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:toolkit="http://schemas.microsoft.com/dotnet/2022/maui/toolkit"
x:Class="CommunityToolkit.Maui.Sample.Pages.Behaviors.AnimationBehaviorPage">
<ContentPage
xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:toolkit="http://schemas.microsoft.com/dotnet/2022/maui/toolkit"
x:Class="CommunityToolkit.Maui.Sample.Pages.Behaviors.AnimationBehaviorPage"
x:Name="Page">

<Label Text="Click this Label">
<Label.Behaviors>
Expand Down
4 changes: 3 additions & 1 deletion docs/maui/behaviors/characters-validation-behavior.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@ ms.date: 04/20/2022

# CharactersValidationBehavior

The `CharactersValidationBehavior` is a `Behavior` that allows the user to validate text input depending on specified parameters. For example, an `Entry` control can be styled differently depending on whether a valid or an invalid text value is provided. This behavior includes built-in checks such as checking for a certain number of digits or alphanumeric characters.
The `CharactersValidationBehavior` is a `Behavior` that allows the user to validate text input depending on specified parameters. For example, an `Entry` control can be styled differently depending on whether a valid or an invalid text value is provided. This behavior includes built-in checks such as checking for a certain number of digits or alphanumeric characters.

[!INCLUDE [important note on bindings within behaviors](../includes/behavior-bindings.md)]

## Syntax

Expand Down
2 changes: 2 additions & 0 deletions docs/maui/behaviors/email-validation-behavior.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ When attached to an `InputView` (e.g. `Entry`, `Editor`, etc.), `EmailValidation

When detached from an `InputView`, `EmailValidationBehavior` will change `Keyboard.Email` back to `Keyboard.Default`. If a `Keyboard` other than `Keyboard.Email` has been specified for the `InputView`, `EmailValidationBehavior`, will not change the `Keyboard` when detaching.

[!INCLUDE [important note on bindings within behaviors](../includes/behavior-bindings.md)]

## Syntax

The following examples show how to add the `EmailValidationBehavior` to an `Entry` and change the `TextColor` based on whether the entered text is a valid email address.
Expand Down
14 changes: 9 additions & 5 deletions docs/maui/behaviors/event-to-command-behavior.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ ms.date: 04/23/2022

The `EventToCommandBehavior` is a `behavior` that allows the user to invoke a `Command` through an `Event`. It is designed to associate Commands to events exposed by controls that were not designed to support Commands. It allows you to map any arbitrary event on a control to a Command.

[!INCLUDE [important note on bindings within behaviors](../includes/behavior-bindings.md)]

## Syntax

The following examples show how to add an `EventToCommandBehavior` to a `Button` control and then handle the clicked event.
Expand All @@ -24,16 +26,18 @@ The following examples show how to add an `EventToCommandBehavior` to a `Button`
The `EventToCommandBehavior` can be used as follows in XAML:

```xaml
<ContentPage xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:toolkit="http://schemas.microsoft.com/dotnet/2022/maui/toolkit"
x:Class="MyLittleApp.MainPage">
<ContentPage
xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:toolkit="http://schemas.microsoft.com/dotnet/2022/maui/toolkit"
x:Class="MyLittleApp.MainPage"
x:Name="Page">

<Button>
<Button.Behaviors>
<toolkit:EventToCommandBehavior
EventName="Clicked"
Command="{Binding MyCustomCommand}" />
Command="{Binding Source={x:Reference Page}, Path=BindingContext.MyCustomCommand}" />
</Button.Behaviors>
</Button>
</ContentPage>
Expand Down
4 changes: 3 additions & 1 deletion docs/maui/behaviors/icon-tint-color-behavior.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ ms.date: 06/27/2022

The `IconTintColorBehavior` is a `behavior` that allows you to tint an image.

[!INCLUDE [important note on bindings within behaviors](../includes/behavior-bindings.md)]

## Syntax

### XAML
Expand Down Expand Up @@ -73,7 +75,7 @@ class IconTintColorBehaviorPage : ContentPage
Content = new Image()
.Behaviors(new IconTintColorBehavior
{
Tintcolor = Color.Red
TintColor = Color.Red
});
}
}
Expand Down
2 changes: 2 additions & 0 deletions docs/maui/behaviors/image-touch-behavior.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ The `ImageTouchBehavior` extends the `TouchBehavior` by providing the ability to
> [!NOTE]
> For further customization options in the `ImageTouchBehavior` please refer to the [`TouchBehavior`](./touch-behavior.md) implementation that this `Behavior` extends.
[!INCLUDE [important note on bindings within behaviors](../includes/behavior-bindings.md)]

## Syntax

The following examples show how to add the `ImageTouchBehavior` to an `Image` and toggle between the `DefaultImageSource`, `HoveredImageSource` and the `PressedImageSource` when the users interacts with the image by either touch based or mouse based interactions.
Expand Down
2 changes: 2 additions & 0 deletions docs/maui/behaviors/masked-behavior.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ ms.date: 04/16/2022

The `MaskedBehavior` is a `Behavior` that allows the user to define an input mask for data entry. Adding this behavior to an `InputView` (e.g. an `Entry`) control will force the user to only input values matching a given mask. Examples of its usage include input of a credit card number or a phone number.

[!INCLUDE [important note on bindings within behaviors](../includes/behavior-bindings.md)]

## Syntax

The following examples show how to add the `MaskedBehavior` to an `Entry` to aid a user when entering a 16 digit credit card number.
Expand Down
14 changes: 9 additions & 5 deletions docs/maui/behaviors/maximum-length-reached-behavior.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ The `MaxLengthReachedBehavior` is a `Behavior` that allows the user to trigger a

Additionally it is possible to dismiss the keyboard when the maximum length is reached via the `ShouldDismissKeyboardAutomatically` property which defaults to `false`.

[!INCLUDE [important note on bindings within behaviors](../includes/behavior-bindings.md)]

## Syntax

### XAML
Expand All @@ -24,16 +26,18 @@ Additionally it is possible to dismiss the keyboard when the maximum length is r
The `MaxLengthReachedBehavior` can be used as follows in XAML:

```xaml
<ContentPage xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:toolkit="http://schemas.microsoft.com/dotnet/2022/maui/toolkit"
x:Class="CommunityToolkit.Maui.Sample.Pages.Behaviors.MaxLengthReachedBehaviorPage">
<ContentPage
xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:toolkit="http://schemas.microsoft.com/dotnet/2022/maui/toolkit"
x:Class="CommunityToolkit.Maui.Sample.Pages.Behaviors.MaxLengthReachedBehaviorPage"
x:Name="Page">

<Entry Placeholder="Start typing until MaxLength is reached..."
MaxLength="100">
<Entry.Behaviors>
<toolkit:MaxLengthReachedBehavior
Command="{Binding MaxLengthReachedCommand}" />
Command="{Binding Source={x:Reference Page}, Path=BindingContext.MaxLengthReachedCommand}" />
</Entry.Behaviors>
</Entry>

Expand Down
2 changes: 2 additions & 0 deletions docs/maui/behaviors/multi-validation-behavior.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ ms.date: 05/18/2022

The `MultiValidationBehavior` is a `Behavior` that allows the user to combine multiple validators to validate text input depending on specified parameters. For example, an `Entry` control can be styled differently depending on whether a valid or an invalid text input is provided. By allowing the user to chain multiple existing validators together, it offers a high degree of customization when it comes to validation.

[!INCLUDE [important note on bindings within behaviors](../includes/behavior-bindings.md)]

## Syntax

The following examples show how to add the `MultiValidationBehavior` to an `Entry` and include 4 different validation behaviors to enforce a password policy.
Expand Down
2 changes: 2 additions & 0 deletions docs/maui/behaviors/numeric-validation-behavior.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ ms.date: 04/16/2022

The `NumericValidationBehavior` is a `Behavior` that allows the user to determine if text input is a valid numeric value. For example, an `Entry` control can be styled differently depending on whether a valid or an invalid numeric input is provided.

[!INCLUDE [important note on bindings within behaviors](../includes/behavior-bindings.md)]

## Syntax

The following examples show how to add the `NumericValidationBehavior` to an `Entry` and change the `TextColor` when the number entered is considered invalid (not between 1 and 100).
Expand Down
14 changes: 9 additions & 5 deletions docs/maui/behaviors/progressbar-animation-behavior.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ ms.date: 05/02/2022

The ProgressBar Animation Behavior animates a `ProgressBar` from its current Progress value to a provided value over time. The method accepts a `Double` progress value, a `uint` duration in milliseconds and an `Easing` enum value.

[!INCLUDE [important note on bindings within behaviors](../includes/behavior-bindings.md)]

## Syntax

### XAML
Expand All @@ -22,18 +24,20 @@ The ProgressBar Animation Behavior animates a `ProgressBar` from its current Pro
The `ProgressBarAnimationBehavior` can be used as follows in XAML:

```xaml
<ContentPage xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:toolkit="http://schemas.microsoft.com/dotnet/2022/maui/toolkit"
x:Class="MyLittleApp.MainPage">
<ContentPage
xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:toolkit="http://schemas.microsoft.com/dotnet/2022/maui/toolkit"
x:Class="MyLittleApp.MainPage"
x:Name="Page">

<Label Text="The ProgressBarAnimationBehavior is a behavior that animates a ProgressBar" />

<ProgressBar>
<ProgressBar.Behaviors>
<toolkit:ProgressBarAnimationBehavior
x:Name="ProgressBarAnimationBehavior"
Progress="{Binding Progress}"
Progress="{Binding Source={x:Reference Page}, Path=BindingContext.Progress}"
Length="250"/>
</ProgressBar.Behaviors>
</ProgressBar>
Expand Down
2 changes: 2 additions & 0 deletions docs/maui/behaviors/required-string-validation-behavior.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ ms.date: 04/20/2022

The `RequiredStringValidationBehavior` is a `Behavior` that allows the user to determine if text input is equal to specific text. For example, an `Entry` control can be styled differently depending on whether a valid or an invalid text input is provided.

[!INCLUDE [important note on bindings within behaviors](../includes/behavior-bindings.md)]

## Syntax

The following examples show how to add the `RequiredStringValidationBehavior` to an `Entry` and change the `TextColor` based on whether the `RequiredString` has been entered.
Expand Down
2 changes: 2 additions & 0 deletions docs/maui/behaviors/select-all-text-behavior.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ ms.date: 09/12/2023

The `SelectAllTextBehavior` is a [`Behavior`](/dotnet/maui/fundamentals/behaviors) that will select all text in an `InputView` (e.g. an `Entry` or `Editor`) when it becomes focused.

[!INCLUDE [important note on bindings within behaviors](../includes/behavior-bindings.md)]

## Syntax

The following examples show how to add the `SelectAllTextBehavior` to an `Entry`.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ ms.date: 05/18/2022

The `SetFocusOnEntryCompletedBehavior` is a `Behavior` that gives focus to a specified `VisualElement` when an `Entry` is completed. For example, a page might have several `Entry`s in sequence, and this makes it convenient to the user if completing an `Entry` automatically switched focus to the next `Entry`.

[!INCLUDE [important note on bindings within behaviors](../includes/behavior-bindings.md)]

## Syntax

The following examples show how to add the `SetFocusOnEntryCompletedBehavior` to an `Entry` so that when the `Next` button on the soft keyboard is pressed another `Entry` is given focus.
Expand Down
2 changes: 2 additions & 0 deletions docs/maui/behaviors/statusbar-behavior.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ The `StatusBarBehavior` applies the color and style values when the properties a
> [!NOTE]
> If your application changes the status bar appearance on a per page basis then you should make use of the `StatusBarApplyOn.OnPageNavigatedTo` value for the `ApplyOn` property. Otherwise when navigating back the system will preserve the status bar appearance from the page the user navigated from and not to.
[!INCLUDE [important note on bindings within behaviors](../includes/behavior-bindings.md)]

## Syntax

### XAML
Expand Down
2 changes: 2 additions & 0 deletions docs/maui/behaviors/text-validation-behavior.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ ms.date: 04/20/2022

The `TextValidationBehavior` is a `Behavior` that allows the user to validate a given text depending on specified parameters. By adding this behavior to any `InputView` control it can be styled differently depending on whether a valid or an invalid text value is provided. It offers various built-in checks such as checking for a certain length or whether or not the input value matches a specific regular expression.

[!INCLUDE [important note on bindings within behaviors](../includes/behavior-bindings.md)]

## Syntax

The following examples show how to add the `TextValidationBehavior` to an `Entry` and change the `TextColor` based on whether the entered text is between 1 and 10 characters long.
Expand Down
12 changes: 7 additions & 5 deletions docs/maui/behaviors/touch-behavior.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ The `TouchBehavior` is a `Behavior` that provides the ability to interact with a
> [!NOTE]
> The toolkit also provides the [`ImageTouchBehavior`](./image-touch-behavior.md) implementation that extends this `TouchBehavior` by also providing the ability to customize the `Source` of an `Image` element.
[!INCLUDE [important note on bindings within behaviors](../includes/behavior-bindings.md)]

## Syntax

The following examples show how to add the `TouchBehavior` to a parent `HorizontalStackLayout` and perform the following animations when a user touches or clicks on the `HorizontalStackLayout` or any of its children:
Expand All @@ -36,7 +38,7 @@ The following examples show how to add the `TouchBehavior` to a parent `Horizont
xmlns:toolkit="http://schemas.microsoft.com/dotnet/2022/maui/toolkit"
x:Class="CommunityToolkit.Maui.Sample.Pages.Behaviors.TouchBehaviorPage">

<HorizontalStackLayout HorizontalOptions="CenterAndExpand" VerticalOptions="Center">
<HorizontalStackLayout HorizontalOptions="Center" VerticalOptions="Center">
<HorizontalStackLayout.Behaviors>
<toolkit:TouchBehavior
DefaultAnimationDuration="250"
Expand Down Expand Up @@ -91,7 +93,7 @@ class TouchBehaviorPage : ContentPage

var layout = new HorizontalStackLayout
{
HorizontalOptions = LayoutOptions.CenterAndExpand,
HorizontalOptions = LayoutOptions.Center,
VerticalOptions = LayoutOptions.Center,
Children =
{
Expand Down Expand Up @@ -129,7 +131,7 @@ class TouchBehaviorPage : ContentPage
{
Content = new HorizontalStackLayout
{
HorizontalOptions = LayoutOptions.CenterAndExpand,
HorizontalOptions = LayoutOptions.Center,
VerticalOptions = LayoutOptions.Center,
Children =
{
Expand Down Expand Up @@ -172,7 +174,7 @@ The following example shows how to attach the `TouchBehavior` to a `HorizontalSt
<HorizontalStackLayout
Padding="20"
Background="Black"
HorizontalOptions="CenterAndExpand">
HorizontalOptions="Center">
<HorizontalStackLayout.Behaviors>
<toolkit:TouchBehavior
HoveredBackgroundColor="{StaticResource Gray900}"
Expand All @@ -191,7 +193,7 @@ The following example shows how to add the `TouchBehavior` to a `HorizontalStack
<HorizontalStackLayout
Padding="20"
Background="Black"
HorizontalOptions="CenterAndExpand">
HorizontalOptions="Center">
<HorizontalStackLayout.Behaviors>
<toolkit:TouchBehavior
LongPressDuration="750"
Expand Down
2 changes: 2 additions & 0 deletions docs/maui/behaviors/uri-validation-behavior.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ ms.date: 04/20/2022

The `UriValidationBehavior` is a `Behavior` that allows users to determine whether or not text input is a valid URI. For example, an `Entry` control can be styled differently depending on whether a valid or an invalid URI is provided.

[!INCLUDE [important note on bindings within behaviors](../includes/behavior-bindings.md)]

## Syntax

The following examples show how to add the `UriValidationBehavior` to an `Entry` and change the `TextColor` based on whether the entered text is a valid absolute URI.
Expand Down
14 changes: 9 additions & 5 deletions docs/maui/behaviors/user-stopped-typing-behavior.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ ms.date: 04/13/2022

The `UserStoppedTypingBehavior` is a `Behavior` that will trigger an action when a user has stopped data input on controls for example `Entry`, `SearchBar` and `Editor`. Examples of its usage include triggering a search when a user has stopped entering their search query.

[!INCLUDE [important note on bindings within behaviors](../includes/behavior-bindings.md)]

## Syntax

### XAML
Expand All @@ -22,15 +24,17 @@ The `UserStoppedTypingBehavior` is a `Behavior` that will trigger an action when
The `UserStoppedTypingBehavior` can be used as follows in XAML:

```xaml
<ContentPage xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:toolkit="http://schemas.microsoft.com/dotnet/2022/maui/toolkit"
x:Class="MyLittleApp.MainPage">
<ContentPage
xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:toolkit="http://schemas.microsoft.com/dotnet/2022/maui/toolkit"
x:Class="MyLittleApp.MainPage"
x:Name="Page">

<Entry Placeholder="Start typing when you stop the behavior will trigger...">
<Entry.Behaviors>
<toolkit:UserStoppedTypingBehavior
Command="{Binding SearchCommand}"
Command="{Binding Source={x:Reference Page}, Path=BindingContext.SearchCommand}"
StoppedTypingTimeThreshold="1000"
MinimumLengthThreshold="3"
ShouldDismissKeyboardAutomatically="True" />
Expand Down
2 changes: 2 additions & 0 deletions docs/maui/includes/behavior-bindings.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
> [!IMPORTANT]
> The .NET MAUI Community Toolkit Behaviors do not set the `BindingContext` of a behavior, because behaviors can be shared and applied to multiple controls through styles. For more information refer to [.NET MAUI Behaviors](/dotnet/maui/fundamentals/behaviors#net-maui-behaviors)
4 changes: 2 additions & 2 deletions docs/maui/views/DrawingView.md
Original file line number Diff line number Diff line change
Expand Up @@ -130,8 +130,8 @@ To get the full benefits, the `DrawingView` provides the methods to get the imag
OnDrawingLineCompleted="OnDrawingLineCompletedEvent"
LineColor="Red"
LineWidth="5"
HorizontalOptions="FillAndExpand"
VerticalOptions="FillAndExpand">
HorizontalOptions="Fill"
VerticalOptions="Fill">
<toolkit:DrawingView.Background>
<LinearGradientBrush StartPoint="0,0"
EndPoint="0,1">
Expand Down
Loading

0 comments on commit b123a97

Please sign in to comment.