-
-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added IsBusy functionality to CustomSwitch control (#16)
Two new files, `IsBusyTestPage.xaml.cs` and `IsBusyTestPage.xaml`, have been added to `App.csproj`. The `CustomSwitch` control in `IosSwitch.xaml` and `CustomSwitch.xaml` now has a new `IsBusy` property, indicating whether the switch is busy, and an `IsBusyContent` property, which displays an `ActivityIndicator` when the switch is busy. A new button has been added to `MainPage.xaml` that navigates to the `IsBusyTestPage`. The `IsBusyTestPage.xaml` contains two `IosSwitch` controls bound to the `IsToggled` property of a `DynamicToggle` switch.
- Loading branch information
1 parent
26d465c
commit 4baa20e
Showing
9 changed files
with
88 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
<?xml version="1.0" encoding="utf-8" ?> | ||
<ContentPage x:Class="App.Pages.IsBusyTestPage" | ||
xmlns="http://schemas.microsoft.com/dotnet/2021/maui" | ||
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" | ||
xmlns:controls="clr-namespace:App.Controls;assembly=App" | ||
xmlns:examples="clr-namespace:App.Controls.CustomSwitchExamples;assembly=App" | ||
Title="IsBusy Test Page"> | ||
<ScrollView Padding="{StaticResource PagePadding}"> | ||
<VerticalStackLayout BackgroundColor="Transparent" MinimumHeightRequest="1000"> | ||
<controls:BackButton /> | ||
|
||
<HorizontalStackLayout Margin="0,20"> | ||
<Label Style="{StaticResource sectionHeading}" Text="Toggle IsBusy: " /> | ||
<examples:AndroidSwitch x:Name="DynamicToggle" /> | ||
</HorizontalStackLayout> | ||
|
||
<examples:IosSwitch IsBusy="{Binding Source={x:Reference DynamicToggle}, Path=IsToggled}" IsToggled="False"> | ||
<examples:IosSwitch.Triggers> | ||
<DataTrigger Binding="{Binding Source={x:Reference DynamicToggle}, Path=IsToggled}" | ||
TargetType="examples:IosSwitch" | ||
Value="True"> | ||
<Setter Property="IsEnabled" Value="False" /> | ||
</DataTrigger> | ||
</examples:IosSwitch.Triggers> | ||
</examples:IosSwitch> | ||
<examples:IosSwitch IsBusy="{Binding Source={x:Reference DynamicToggle}, Path=IsToggled}" IsToggled="True"> | ||
<examples:IosSwitch.Triggers> | ||
<DataTrigger Binding="{Binding Source={x:Reference DynamicToggle}, Path=IsToggled}" | ||
TargetType="examples:IosSwitch" | ||
Value="True"> | ||
<Setter Property="IsEnabled" Value="False" /> | ||
</DataTrigger> | ||
</examples:IosSwitch.Triggers> | ||
</examples:IosSwitch> | ||
</VerticalStackLayout> | ||
</ScrollView> | ||
</ContentPage> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
namespace App.Pages; | ||
|
||
public partial class IsBusyTestPage : ContentPage | ||
{ | ||
public IsBusyTestPage() | ||
{ | ||
InitializeComponent(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters