-
-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
7b65b9f
commit ca5acc6
Showing
33 changed files
with
211 additions
and
166 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,66 +1,49 @@ | ||
@using ControlGallery.Views | ||
@using ControlGallery.Views.Collections | ||
@using ControlGallery.Views.Collections.CollectionView | ||
@using ControlGallery.Views.Controls | ||
@using ControlGallery.Views.EditText | ||
@using ControlGallery.Views.InitiateCommands | ||
@using ControlGallery.Views.Layouts | ||
@using ControlGallery.Views.PresentData | ||
@using ControlGallery.Views.SetValues | ||
@using ControlGallery.Views.Shell | ||
|
||
<Shell> | ||
<FlyoutItem Title="Main"> | ||
<Tab Title="Gallery"> | ||
<ShellContent> | ||
<PlaygroundList /> | ||
</ShellContent> | ||
</Tab> | ||
<Tab Title="Shell Properties"> | ||
<ShellPropertiesPlayground /> | ||
</Tab> | ||
<Tab Title="Add/Remove"> | ||
<ContentPage Title="Adder"> | ||
<StackLayout Spacing="12"> | ||
<Button OnClick="AddTab">Add Tab</Button> | ||
<Button IsEnabled="(tabCount > 1)" OnClick="RemoveTab">Remove tab</Button> | ||
<Button OnClick="AddMenuItem">Add MenuItem</Button> | ||
<Button IsEnabled="(menuItemCount > 0)" OnClick="RemoveMenuItem">Remove MenuItem</Button> | ||
</StackLayout> | ||
</ContentPage> | ||
</Tab> | ||
|
||
@for (int i = 0; i < tabCount; i++) | ||
{ | ||
var currentIndex = i; | ||
<ShellTab Title="@($"Tab #{currentIndex + 1}")" /> | ||
} | ||
</FlyoutItem> | ||
|
||
@for (int i = 0; i < menuItemCount; i++) | ||
{ | ||
<MenuItem Text="@($"MenuItem #{i + 1}")" /> | ||
} | ||
</Shell> | ||
|
||
@code { | ||
int tabCount = 1; | ||
int menuItemCount = 2; | ||
|
||
void AddTab() | ||
{ | ||
tabCount++; | ||
} | ||
|
||
void RemoveTab() | ||
{ | ||
if (tabCount > 1) | ||
{ | ||
tabCount--; | ||
} | ||
} | ||
|
||
void AddMenuItem() | ||
{ | ||
menuItemCount++; | ||
} | ||
|
||
void RemoveMenuItem() | ||
{ | ||
if (menuItemCount > 0) | ||
{ | ||
menuItemCount--; | ||
} | ||
} | ||
} | ||
@*Present data*@ | ||
<BoxViewPage /> | ||
<LabelPage /> | ||
|
||
@*Initiate commands*@ | ||
<ButtonPage /> | ||
<RefreshViewPage /> | ||
|
||
@*Set values*@ | ||
<SliderPage /> | ||
<CheckboxPage /> | ||
<RadioButtonPage /> | ||
|
||
@*Edit text*@ | ||
<EntryPage /> | ||
<EditorPage /> | ||
|
||
@*Display collections*@ | ||
<CarouselViewPage /> | ||
<ShellSection Title="CollectionView"> | ||
<AddRemovePage /> | ||
<GridLayoutPage /> | ||
<SelectionPage /> | ||
<InfiniteScrollPage /> | ||
</ShellSection> | ||
|
||
@*Layouts*@ | ||
<AbsoluteLayoutPage /> | ||
<GridPage /> | ||
<FlexLayoutPage /> | ||
|
||
@*Shell*@ | ||
<ShellNavigationPage /> | ||
<ShellPropertiesPage /> | ||
<ShellItemsPage /> | ||
|
||
</Shell> |
18 changes: 0 additions & 18 deletions
18
samples/ControlGallery/Views/CollectionViewPlayground.razor
This file was deleted.
Oops, something went wrong.
2 changes: 1 addition & 1 deletion
2
...ery/Views/Collections/CarouselViews.razor → .../Views/Collections/CarouselViewPage.razor
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
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
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 was deleted.
Oops, something went wrong.
File renamed without changes.
4 changes: 2 additions & 2 deletions
4
...ntrolGallery/Views/EditorPlayground.razor → ...olGallery/Views/EditText/EditorPage.razor
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,31 @@ | ||
@page "/edit-text/editor" | ||
|
||
@{ | ||
RenderFragment Separator = @<BoxView Color="Colors.LightGray" HeightRequest="1" />; | ||
} | ||
|
||
<ContentPage Title="Entry"> | ||
<StackLayout Margin="20"> | ||
<Entry @bind-Text="_text" OnCompleted="OnCompleted" /> | ||
<Label Text=@($"Edits count: {_editsNumber}. Text entered: {_text}") /> | ||
|
||
@Separator | ||
|
||
<Label>Email entry: @_email</Label> | ||
<Entry @bind-Text="_email" Keyboard="Keyboard.Email" /> | ||
|
||
@Separator | ||
|
||
|
||
|
||
</StackLayout> | ||
</ContentPage> | ||
|
||
@code | ||
{ | ||
string _text; | ||
string _email; | ||
int _editsNumber; | ||
|
||
void OnCompleted() => _editsNumber++; | ||
} |
2 changes: 1 addition & 1 deletion
2
...trolGallery/Views/GesturePlayground.razor → ...s/ControlGallery/Views/GesturesPage.razor
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
23 changes: 23 additions & 0 deletions
23
samples/ControlGallery/Views/InitiateCommands/ButtonPage.razor
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,23 @@ | ||
<ContentPage Title="Buttons"> | ||
<VerticalStackLayout Margin="20"> | ||
|
||
<HorizontalStackLayout> | ||
<Button Text="Favorite?" OnClick="ToggleFavorite" /> | ||
|
||
<Image Source="@(isFavorite ? _favorite : _nonFavorite)" /> | ||
</HorizontalStackLayout> | ||
|
||
</VerticalStackLayout> | ||
</ContentPage> | ||
|
||
@code { | ||
ImageSource _favorite = ImageSource.FromFile("favorite.png"); | ||
ImageSource _nonFavorite = ImageSource.FromFile("not_favorite.png"); | ||
|
||
bool isFavorite; | ||
|
||
void ToggleFavorite() | ||
{ | ||
isFavorite = !isFavorite; | ||
} | ||
} |
File renamed without changes.
File renamed without changes.
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
File renamed without changes.
This file was deleted.
Oops, something went wrong.
21 changes: 21 additions & 0 deletions
21
samples/ControlGallery/Views/PresentData/BoxViewPage.razor
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,21 @@ | ||
<ContentPage Title="BoxViews"> | ||
<VerticalStackLayout Spacing="8"> | ||
<BoxView HeightRequest="30" | ||
WidthRequest="30" | ||
Color="Colors.OrangeRed" | ||
CornerRadius="8" /> | ||
|
||
<BoxView HeightRequest="1" | ||
Color="Colors.LightGray" /> | ||
|
||
<BoxView HeightRequest="30"> | ||
<Background> | ||
<LinearGradientBrush EndPoint="new(1,0)"> | ||
<GradientStop Offset="0" Color="Colors.Red" /> | ||
<GradientStop Offset="1" Color="Colors.Green" /> | ||
</LinearGradientBrush> | ||
</Background> | ||
</BoxView> | ||
|
||
</VerticalStackLayout> | ||
</ContentPage> |
2 changes: 1 addition & 1 deletion
2
...ontrolGallery/Views/Controls/Labels.razor → ...Gallery/Views/PresentData/LabelPage.razor
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,16 @@ | ||
<ContentPage Title="Checkboxes"> | ||
<VerticalStackLayout Margin="20"> | ||
|
||
<HorizontalStackLayout> | ||
<CheckBox @bind-IsChecked="_isChecked" /> | ||
<Label>Checkbox Title</Label> | ||
</HorizontalStackLayout> | ||
|
||
<Label>Checkbox is @(_isChecked ? "checked" : "unchecked")!</Label> | ||
</VerticalStackLayout> | ||
</ContentPage> | ||
|
||
@code | ||
{ | ||
private bool _isChecked; | ||
} |
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 @@ | ||
<ContentPage Title="Sliders"> | ||
<VerticalStackLayout Margin="20"> | ||
<Slider Minimum="0" Maximum="20" @bind-Value="_sliderValue" /> | ||
<Label>Slider is @_sliderValue</Label> | ||
</VerticalStackLayout> | ||
</ContentPage> | ||
|
||
@code | ||
{ | ||
private double _sliderValue; | ||
} |
File renamed without changes.
File renamed without changes.
Oops, something went wrong.