-
Notifications
You must be signed in to change notification settings - Fork 50
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 #50 from syncfusion/SampleBrowserUnitTest
Sample Browser And Unit Test cases added for Calendar, Numeric Entry, Numeric Up Down, Button, Bottom Sheet new controls
- Loading branch information
Showing
133 changed files
with
15,147 additions
and
9 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
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.
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.
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.
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.
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.
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.
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.
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.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
14 changes: 14 additions & 0 deletions
14
maui/samples/Gallery/SampleList/BottomSheetSamplesList.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 |
---|---|---|
@@ -0,0 +1,14 @@ | ||
<?xml version="1.0" encoding="utf-8" ?> | ||
<SyncfusionControls> | ||
<ControlCategory Name="Navigation"> | ||
<Control ControlName="BottomSheet" | ||
Title="Bottom Sheet" | ||
Image="bottomsheet.png" | ||
Description="The BottomSheet is a panel that slides up from the bottom of the screen to display content."> | ||
<Sample SampleName="GettingStarted" | ||
Title="Getting Started" | ||
SearchTags="bottomsheet,bottomslide,nav,menubar,slidingpanel,overlay,drawer,actionsheet,slideup,expandable,maiu,bottommenu,dropdown"/> | ||
</Control> | ||
</ControlCategory> | ||
|
||
</SyncfusionControls> |
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,24 @@ | ||
<?xml version="1.0" encoding="utf-8" ?> | ||
<SyncfusionControls> | ||
<ControlCategory Name="Calendar"> | ||
<Control Title="Calendar" | ||
Image="calendar.png" | ||
ControlName="Calendar" | ||
Description="It is a lightweight control used to select a single, multiple, and a range of dates."> | ||
<Sample Title="Getting Started" SampleName="GettingStarted" SearchTags="calendar"/> | ||
<Category Title="Views"> | ||
<CardLayout> | ||
<Sample SampleName="Month" ShowExpandIcon="False" Title="Month"/> | ||
<Sample SampleName="Year" ShowExpandIcon="False" Title="Year"/> | ||
<Sample SampleName="Decade" ShowExpandIcon="False" Title="Decade"/> | ||
<Sample SampleName="Century" ShowExpandIcon="False" Title="Century"/> | ||
</CardLayout> | ||
</Category> | ||
<Sample Title="Selection" SampleName="DateSelection"/> | ||
<Sample Title="Calendar Identifier" SampleName="CalendarIdentifier"/> | ||
<Sample Title="Appointment Booking" SampleName="AppointmentBooking"/> | ||
<Sample Title="Color Scheme" SampleName="HighlightDates" /> | ||
<Sample Title="Customization" SampleName="AppearanceCustomization" /> | ||
</Control> | ||
</ControlCategory> | ||
</SyncfusionControls> |
10 changes: 10 additions & 0 deletions
10
maui/samples/Gallery/SampleList/NumericEntrySamplesList.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 |
---|---|---|
@@ -0,0 +1,10 @@ | ||
<?xml version="1.0" encoding="utf-8" ?> | ||
<SyncfusionControls> | ||
<ControlCategory Name="Editors"> | ||
<Control Title="Numeric Entry" ControlName="SfNumericEntry" Image="numericentry.png" Description="Allows users to restrict input to numeric values using specified format."> | ||
<Sample Title="Getting Started" SampleName="NumericEntryGettingStarted" SearchTags="numeric,entry,textbox"/> | ||
<Sample Title="Culture and Formatting" SampleName="NumericEntryCultureAndFormatting" SearchTags="numeric,entry,textbox,formatting, culture"/> | ||
</Control> | ||
</ControlCategory> | ||
|
||
</SyncfusionControls> |
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 @@ | ||
<?xml version="1.0" encoding="utf-8" ?> | ||
<SyncfusionControls> | ||
<ControlCategory Name="Editors"> | ||
<Control Title="Numeric UpDown" ControlName="SfNumericUpDown" Image="numericupdown.png" Description="Allows users to restrict input to numeric values with value-changing buttons."> | ||
<Sample Title="Getting Started" SampleName="NumericUpDownGettingStarted" SearchTags="numeric,entry,textbox,updownbutton, numericupdown" /> | ||
</Control> | ||
</ControlCategory> | ||
|
||
</SyncfusionControls> |
154 changes: 154 additions & 0 deletions
154
maui/samples/Gallery/Samples/BottomSheet/GettingStarted/Helper/BottomSheetBehavior.cs
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,154 @@ | ||
using Syncfusion.Maui.ControlsGallery.CustomView; | ||
using Syncfusion.Maui.Toolkit.BottomSheet; | ||
|
||
namespace Syncfusion.Maui.ControlsGallery.BottomSheet.BottomSheet | ||
{ | ||
public class BottomSheetBehavior : Behavior<SampleView> | ||
{ | ||
ListView? _listView; | ||
ItemViewModel? _itemViewModel; | ||
SfBottomSheet? _bottomSheet; | ||
SfEffectsViewAdv? _decreaseQuantity; | ||
SfEffectsViewAdv? _increaseQuantity; | ||
SfEffectsViewAdv? _closeIcon; | ||
CheckBox? _extraOne; | ||
CheckBox? _extraTwo; | ||
Grid? grid; | ||
|
||
/// <summary> | ||
/// You can override this method to subscribe to AssociatedObject events and initialize properties. | ||
/// </summary> | ||
/// <param name="bindable">SampleView type parameter named as bindable.</param> | ||
protected override void OnAttachedTo(SampleView bindable) | ||
{ | ||
_listView = bindable.FindByName<ListView>("ListView"); | ||
_listView.ItemTapped += ListView_ItemTapped; | ||
_itemViewModel = new ItemViewModel(); | ||
bindable.BindingContext = _itemViewModel; | ||
_bottomSheet = bindable.FindByName<SfBottomSheet>("BottomSheet"); | ||
_bottomSheet.StateChanged += OnStateChanged; | ||
_decreaseQuantity = bindable.FindByName<SfEffectsViewAdv>("DecreaseQuantity"); | ||
_increaseQuantity = bindable.FindByName<SfEffectsViewAdv>("IncreaseQuantity"); | ||
_closeIcon = bindable.FindByName<SfEffectsViewAdv>("CloseIcon"); | ||
_extraOne = bindable.FindByName<CheckBox>("ExtraCheese"); | ||
_extraTwo = bindable.FindByName<CheckBox>("ExtraDoubleCheese"); | ||
grid = bindable.FindByName<Grid>("Grid"); | ||
|
||
TapGestureRecognizer decreaseTapped = new TapGestureRecognizer(); | ||
decreaseTapped.Tapped += OnDecreaseTapped; | ||
_decreaseQuantity.GestureRecognizers.Add(decreaseTapped); | ||
|
||
TapGestureRecognizer increaseTapped = new TapGestureRecognizer(); | ||
increaseTapped.Tapped += OnIncreaseTapped; | ||
_increaseQuantity.GestureRecognizers.Add(increaseTapped); | ||
|
||
TapGestureRecognizer closeIconTapped = new TapGestureRecognizer(); | ||
closeIconTapped.Tapped += OnCloseIconTapped; | ||
_closeIcon.GestureRecognizers.Add(closeIconTapped); | ||
|
||
_extraOne.CheckedChanged += ExtraOne_CheckedChanged; | ||
_extraTwo.CheckedChanged += ExtraTwo_CheckedChanged; | ||
|
||
base.OnAttachedTo(bindable); | ||
} | ||
|
||
private void ExtraTwo_CheckedChanged(object? sender, CheckedChangedEventArgs e) | ||
{ | ||
if (_extraTwo is not null && _bottomSheet is not null && grid is not null) | ||
{ | ||
if (_extraTwo.IsChecked && _extraOne is not null) | ||
{ | ||
_extraOne.IsChecked = false; | ||
var item = (Item)grid.BindingContext; | ||
item.TotalPrice = (item.Price + 4) * item.Quantity; | ||
} | ||
else | ||
{ | ||
var item = (Item)grid.BindingContext; | ||
item.TotalPrice = item.Price * item.Quantity; | ||
} | ||
} | ||
} | ||
|
||
private void ExtraOne_CheckedChanged(object? sender, CheckedChangedEventArgs e) | ||
{ | ||
if (_extraOne is not null && _bottomSheet is not null && grid is not null) | ||
{ | ||
if (_extraOne.IsChecked && _extraTwo is not null) | ||
{ | ||
_extraTwo.IsChecked = false; | ||
var item = (Item)grid.BindingContext; | ||
item.TotalPrice = (item.Price + 2) * item.Quantity; | ||
} | ||
else | ||
{ | ||
var item = (Item)grid.BindingContext; | ||
item.TotalPrice = item.Price * item.Quantity; | ||
} | ||
} | ||
} | ||
|
||
private void OnStateChanged(object? sender, StateChangedEventArgs e) | ||
{ | ||
if (_bottomSheet is not null && _bottomSheet.State is BottomSheetState.Hidden && grid is not null) | ||
{ | ||
grid.BindingContext = null; | ||
} | ||
} | ||
|
||
private void ListView_ItemTapped(object? sender, ItemTappedEventArgs e) | ||
{ | ||
var selectedItem = (Item)e.Item; | ||
if (_bottomSheet is not null && grid is not null) | ||
{ | ||
grid.BindingContext = selectedItem; | ||
if (_bottomSheet.IsOpen) | ||
{ | ||
_bottomSheet.State = BottomSheetState.HalfExpanded; | ||
} | ||
|
||
_bottomSheet.Show(); | ||
} | ||
} | ||
|
||
private void OnDecreaseTapped(object? sender, TappedEventArgs e) | ||
{ | ||
if (_bottomSheet is not null && grid is not null) | ||
{ | ||
var temp = (Item)grid.BindingContext; | ||
if (temp.Quantity > 1) | ||
{ | ||
temp.Quantity--; | ||
} | ||
} | ||
} | ||
|
||
private void OnIncreaseTapped(object? sender, TappedEventArgs e) | ||
{ | ||
if (_bottomSheet is not null && grid is not null) | ||
{ | ||
var temp = (Item)grid.BindingContext; | ||
temp.Quantity++; | ||
} | ||
} | ||
|
||
private void OnCloseIconTapped(object? sender, TappedEventArgs e) | ||
{ | ||
if (_bottomSheet is not null) | ||
{ | ||
_bottomSheet.Close(); | ||
} | ||
} | ||
|
||
/// <summary> | ||
/// You can override this method while View was detached from window | ||
/// </summary> | ||
/// <param name="bindable">SampleView type parameter named as bindable</param> | ||
protected override void OnDetachingFrom(SampleView bindable) | ||
{ | ||
_listView = null; | ||
_itemViewModel = null; | ||
base.OnDetachingFrom(bindable); | ||
} | ||
} | ||
} |
63 changes: 63 additions & 0 deletions
63
maui/samples/Gallery/Samples/BottomSheet/GettingStarted/Model/Item.cs
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,63 @@ | ||
using System.ComponentModel; | ||
|
||
namespace Syncfusion.Maui.ControlsGallery.BottomSheet.BottomSheet | ||
{ | ||
public class Item : INotifyPropertyChanged | ||
{ | ||
int _quantity = 1; | ||
double _price; | ||
double _totalPrice; | ||
|
||
public string FoodName { get; set; } = string.Empty; | ||
|
||
public string SubName { get; set; } = string.Empty; | ||
|
||
public string Description { get; set; } = string.Empty; | ||
|
||
public string ImageName { get; set; } = string.Empty; | ||
|
||
public double Price | ||
{ | ||
get => _price; | ||
set | ||
{ | ||
_price = value; | ||
OnPropertyChanged(nameof(Price)); | ||
UpdateTotalPrice(); | ||
} | ||
} | ||
|
||
public int Quantity | ||
{ | ||
get => _quantity; | ||
set | ||
{ | ||
_quantity = value; | ||
OnPropertyChanged(nameof(Quantity)); | ||
UpdateTotalPrice(); | ||
} | ||
} | ||
|
||
public double TotalPrice | ||
{ | ||
get => _totalPrice; | ||
set | ||
{ | ||
_totalPrice = value; | ||
OnPropertyChanged(nameof(TotalPrice)); | ||
} | ||
} | ||
|
||
private void UpdateTotalPrice() | ||
{ | ||
TotalPrice = Price * Quantity; | ||
} | ||
|
||
public event PropertyChangedEventHandler? PropertyChanged; | ||
|
||
protected void OnPropertyChanged(string propertyName) | ||
{ | ||
PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName)); | ||
} | ||
} | ||
} |
11 changes: 11 additions & 0 deletions
11
maui/samples/Gallery/Samples/BottomSheet/GettingStarted/View/GettingStarted.xaml
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,11 @@ | ||
<?xml version="1.0" encoding="utf-8" ?> | ||
<localcore:SampleView xmlns="http://schemas.microsoft.com/dotnet/2021/maui" | ||
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" | ||
x:Class="Syncfusion.Maui.ControlsGallery.BottomSheet.BottomSheet.GettingStarted" | ||
xmlns:localcore="clr-namespace:Syncfusion.Maui.ControlsGallery;assembly=Syncfusion.Maui.ControlsGallery" | ||
> | ||
<localcore:SampleView.Content> | ||
|
||
<Grid HeightRequest="400" WidthRequest="400" BackgroundColor="Red"/> | ||
</localcore:SampleView.Content> | ||
</localcore:SampleView> |
Oops, something went wrong.