-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #233 from trimble-oss/179-Alert-Dialogue
179 alert dialogue
- Loading branch information
Showing
21 changed files
with
1,116 additions
and
979 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
12 changes: 6 additions & 6 deletions
12
DemoApp/DemoApp/Platforms/Android/Resources/values/colors.xml
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 |
---|---|---|
@@ -1,6 +1,6 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<resources> | ||
<color name="colorPrimary">#0063a3</color> | ||
<color name="colorPrimaryDark">#0063a3</color> | ||
<color name="colorAccent">#0063a3</color> | ||
</resources> | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<resources> | ||
<color name="colorPrimary">#0063a3</color> | ||
<color name="colorPrimaryDark">#0063a3</color> | ||
<color name="colorAccent">#0063a3</color> | ||
</resources> |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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,35 @@ | ||
using CommunityToolkit.Mvvm.ComponentModel; | ||
using CommunityToolkit.Mvvm.Input; | ||
using Trimble.Modus.Components; | ||
|
||
namespace DemoApp.ViewModels | ||
{ | ||
public partial class DisplayAlertSampleViewModel : ObservableObject | ||
{ | ||
[ObservableProperty] string _title; | ||
[ObservableProperty] string _message; | ||
[ObservableProperty] string _primaryButtonText; | ||
[ObservableProperty] string _secondaryButtonText; | ||
public DisplayAlertSampleViewModel() | ||
{ | ||
Title = "Alert"; | ||
Message = "Do you want to delete?"; | ||
PrimaryButtonText = "Okay"; | ||
SecondaryButtonText = ""; | ||
} | ||
|
||
[RelayCommand] | ||
async Task ShowAlert() | ||
{ | ||
var confirmationDialog = new AlertDialogue(Title, Message, PrimaryButtonText, SecondaryButtonText); | ||
try | ||
{ | ||
var result = await confirmationDialog.Show(); | ||
Console.WriteLine(result ? "Primary button tapped" : "Secondary button tapped"); | ||
} catch (Exception ex) | ||
{ | ||
Console.WriteLine("Invalid result " + ex.Message); | ||
} | ||
} | ||
} | ||
} |
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,20 @@ | ||
<?xml version="1.0" encoding="utf-8" ?> | ||
<ContentPage xmlns="http://schemas.microsoft.com/dotnet/2021/maui" | ||
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" | ||
xmlns:modus="http://modus.trimble.com/components" | ||
x:Class="DemoApp.Views.DisplayAlertSamplePage" | ||
Title="DisplayAlertSamplePage"> | ||
<VerticalStackLayout Spacing="10" Padding="10"> | ||
<modus:TMButton Title="Show Display Alert" | ||
Command="{Binding ShowAlertCommand}" | ||
HorizontalOptions="Center" /> | ||
<modus:TMInput Placeholder="Title" | ||
Text="{Binding Title}" /> | ||
<modus:TMInput Placeholder="Message" | ||
Text="{Binding Message}" /> | ||
<modus:TMInput Placeholder="Primary text" | ||
Text="{Binding PrimaryButtonText}" /> | ||
<modus:TMInput Placeholder="Secondary text" | ||
Text="{Binding SecondaryButtonText}" /> | ||
</VerticalStackLayout> | ||
</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,13 @@ | ||
using DemoApp.ViewModels; | ||
|
||
namespace DemoApp.Views; | ||
|
||
public partial class DisplayAlertSamplePage : ContentPage | ||
{ | ||
DisplayAlertSampleViewModel _viewModel = new DisplayAlertSampleViewModel(); | ||
public DisplayAlertSamplePage() | ||
{ | ||
InitializeComponent(); | ||
BindingContext = _viewModel; | ||
} | ||
} |
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 |
---|---|---|
@@ -1,92 +1,92 @@ | ||
<?xml version="1.0" encoding="utf-8" ?> | ||
<ContentPage xmlns="http://schemas.microsoft.com/dotnet/2021/maui" | ||
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" | ||
x:Class="DemoApp.Views.ListViewSamplePage" | ||
xmlns:local ="clr-namespace:DemoApp.Views" | ||
xmlns:constants="clr-namespace:DemoApp.Constant" | ||
xmlns:modus="http://modus.trimble.com/components" | ||
Title="ListViewSamplePage"> | ||
<ContentPage.Resources> | ||
<DataTemplate x:Name="TextCell" x:Key="textCellKey"> | ||
<modus:TextCell | ||
Title="{Binding Name}" | ||
Description="{Binding Address}" | ||
LeftIconSource="{Binding ProfilePic}" | ||
RightIconSource="{Binding ProfilePic}"> | ||
</modus:TextCell> | ||
</DataTemplate> | ||
<DataTemplate x:Name="ViewCell" x:Key="viewCellKey"> | ||
<modus:TemplateCell> | ||
<modus:TemplateCell.Content> | ||
<Grid RowSpacing="10" Padding="10"> | ||
<Grid.RowDefinitions> | ||
<RowDefinition Height="Auto"/> | ||
<RowDefinition Height="Auto"/> | ||
<RowDefinition Height="Auto"/> | ||
<RowDefinition Height="Auto"/> | ||
</Grid.RowDefinitions> | ||
<Grid.ColumnDefinitions> | ||
<ColumnDefinition Width="Auto"/> | ||
<ColumnDefinition Width="*"/> | ||
<ColumnDefinition Width="*"/> | ||
</Grid.ColumnDefinitions> | ||
|
||
<Border HeightRequest="80" | ||
WidthRequest="80" | ||
VerticalOptions="Center" | ||
Stroke="{Binding Color}" | ||
StrokeShape="RoundRectangle 40" | ||
StrokeThickness="8" | ||
Grid.RowSpan="3" | ||
Margin="0,0,0,0"> | ||
<Image Source="{Binding ProfilePic}" | ||
Margin="10,0,10,0" | ||
VerticalOptions="Center" HorizontalOptions="Center" HeightRequest="80" WidthRequest="80"/> | ||
|
||
</Border> | ||
|
||
<Label Text="{Binding Name}" Grid.Row="0" Grid.Column="1" FontSize="Medium"/> | ||
<Label Text="{Binding DateofBirth, StringFormat='DateofBirth: {0:dd/MM/yyyy}'}" Grid.Row="1" Grid.Column="1" FontSize="Small"/> | ||
<Label Text="{Binding Address}" Grid.Row="2" Grid.Column="1" FontSize="Micro"/> | ||
<StackLayout Grid.Column="2" Grid.Row="1" HorizontalOptions="Center" Orientation="Horizontal" Spacing="5" VerticalOptions="Center" > | ||
<ImageButton Source="{x:Static constants:ImageConstants.Email}" HeightRequest="20" WidthRequest="20" Command="{Binding EmailClickedCommand}"/> | ||
<ImageButton Source="{x:Static constants:ImageConstants.Phone}" HeightRequest="20" WidthRequest="20" Command="{Binding PhoneClickedCommand}"/> | ||
</StackLayout> | ||
|
||
</Grid> | ||
</modus:TemplateCell.Content> | ||
</modus:TemplateCell> | ||
</DataTemplate> | ||
|
||
</ContentPage.Resources> | ||
<StackLayout Orientation="Vertical"> | ||
<Label Text="Select View Type" FontSize="Medium" Padding="10"></Label> | ||
<modus:TMRadioButtonGroup x:Name="CellGroup" | ||
Padding="10" | ||
SelectedIndex="0" | ||
HorizontalOptions="Center" | ||
SelectedRadioButtonChanged="OnCellGroupButtonChanged" | ||
Orientation="Horizontal"> | ||
<modus:TMRadioButton Text="Text Cell" /> | ||
<modus:TMRadioButton Text="Template Cell" /> | ||
</modus:TMRadioButtonGroup> | ||
<Label Text="Selection Mode" FontSize="Medium" Padding="10"></Label> | ||
<modus:TMRadioButtonGroup x:Name="SelectionGroup" | ||
Padding="10" | ||
SelectedIndex="0" | ||
HorizontalOptions="Center" | ||
SelectedRadioButtonChangedCommand="{Binding SelectionGroupCommand}" | ||
Orientation="Horizontal"> | ||
<modus:TMRadioButton Text="Single" /> | ||
<modus:TMRadioButton Text="Multiple" /> | ||
<modus:TMRadioButton Text="None" /> | ||
</modus:TMRadioButtonGroup> | ||
<modus:TMListView x:Name="textCellList" | ||
IsVisible="True" | ||
SelectionMode="{Binding SelectionMode}" | ||
SelectionChangedCommand="{Binding ItemSelectedCommand}" | ||
ItemsSource="{Binding ItemSource}"> | ||
</modus:TMListView> | ||
|
||
</StackLayout> | ||
</ContentPage> | ||
<?xml version="1.0" encoding="utf-8" ?> | ||
<ContentPage xmlns="http://schemas.microsoft.com/dotnet/2021/maui" | ||
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" | ||
x:Class="DemoApp.Views.ListViewSamplePage" | ||
xmlns:local ="clr-namespace:DemoApp.Views" | ||
xmlns:constants="clr-namespace:DemoApp.Constant" | ||
xmlns:modus="http://modus.trimble.com/components" | ||
Title="ListViewSamplePage"> | ||
<ContentPage.Resources> | ||
<DataTemplate x:Name="TextCell" x:Key="textCellKey"> | ||
<modus:TextCell | ||
Title="{Binding Name}" | ||
Description="{Binding Address}" | ||
LeftIconSource="{Binding ProfilePic}" | ||
RightIconSource="{Binding ProfilePic}"> | ||
</modus:TextCell> | ||
</DataTemplate> | ||
<DataTemplate x:Name="ViewCell" x:Key="viewCellKey"> | ||
<modus:TemplateCell> | ||
<modus:TemplateCell.Content> | ||
<Grid RowSpacing="10" Padding="10"> | ||
<Grid.RowDefinitions> | ||
<RowDefinition Height="Auto"/> | ||
<RowDefinition Height="Auto"/> | ||
<RowDefinition Height="Auto"/> | ||
<RowDefinition Height="Auto"/> | ||
</Grid.RowDefinitions> | ||
<Grid.ColumnDefinitions> | ||
<ColumnDefinition Width="Auto"/> | ||
<ColumnDefinition Width="*"/> | ||
<ColumnDefinition Width="*"/> | ||
</Grid.ColumnDefinitions> | ||
|
||
<Border HeightRequest="80" | ||
WidthRequest="80" | ||
VerticalOptions="Center" | ||
Stroke="{Binding Color}" | ||
StrokeShape="RoundRectangle 40" | ||
StrokeThickness="8" | ||
Grid.RowSpan="3" | ||
Margin="0,0,0,0"> | ||
<Image Source="{Binding ProfilePic}" | ||
Margin="10,0,10,0" | ||
VerticalOptions="Center" HorizontalOptions="Center" HeightRequest="80" WidthRequest="80"/> | ||
|
||
</Border> | ||
|
||
<Label Text="{Binding Name}" Grid.Row="0" Grid.Column="1" FontSize="Medium"/> | ||
<Label Text="{Binding DateofBirth, StringFormat='DateofBirth: {0:dd/MM/yyyy}'}" Grid.Row="1" Grid.Column="1" FontSize="Small"/> | ||
<Label Text="{Binding Address}" Grid.Row="2" Grid.Column="1" FontSize="Micro"/> | ||
<StackLayout Grid.Column="2" Grid.Row="1" HorizontalOptions="Center" Orientation="Horizontal" Spacing="5" VerticalOptions="Center" > | ||
<ImageButton Source="{x:Static constants:ImageConstants.Email}" HeightRequest="20" WidthRequest="20" Command="{Binding EmailClickedCommand}"/> | ||
<ImageButton Source="{x:Static constants:ImageConstants.Phone}" HeightRequest="20" WidthRequest="20" Command="{Binding PhoneClickedCommand}"/> | ||
</StackLayout> | ||
|
||
</Grid> | ||
</modus:TemplateCell.Content> | ||
</modus:TemplateCell> | ||
</DataTemplate> | ||
|
||
</ContentPage.Resources> | ||
<StackLayout Orientation="Vertical"> | ||
<Label Text="Select View Type" FontSize="Medium" Padding="10"></Label> | ||
<modus:TMRadioButtonGroup x:Name="CellGroup" | ||
Padding="10" | ||
SelectedIndex="0" | ||
HorizontalOptions="Center" | ||
SelectedRadioButtonChanged="OnCellGroupButtonChanged" | ||
Orientation="Horizontal"> | ||
<modus:TMRadioButton Text="Text Cell" /> | ||
<modus:TMRadioButton Text="Template Cell" /> | ||
</modus:TMRadioButtonGroup> | ||
<Label Text="Selection Mode" FontSize="Medium" Padding="10"></Label> | ||
<modus:TMRadioButtonGroup x:Name="SelectionGroup" | ||
Padding="10" | ||
SelectedIndex="0" | ||
HorizontalOptions="Center" | ||
SelectedRadioButtonChangedCommand="{Binding SelectionGroupCommand}" | ||
Orientation="Horizontal"> | ||
<modus:TMRadioButton Text="Single" /> | ||
<modus:TMRadioButton Text="Multiple" /> | ||
<modus:TMRadioButton Text="None" /> | ||
</modus:TMRadioButtonGroup> | ||
<modus:TMListView x:Name="textCellList" | ||
IsVisible="True" | ||
SelectionMode="{Binding SelectionMode}" | ||
SelectionChangedCommand="{Binding ItemSelectedCommand}" | ||
ItemsSource="{Binding ItemSource}"> | ||
</modus:TMListView> | ||
|
||
</StackLayout> | ||
</ContentPage> |
Oops, something went wrong.