Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
using System;
using Maui.Controls.Sample.Pages.Base;
using Maui.Controls.Sample.Pages.Base;
using Microsoft.Maui.Controls;
using Microsoft.Maui.Graphics;

namespace Maui.Controls.Sample.Pages.Gestures
namespace Maui.Controls.Sample.Pages
{
public class ClickGestureGalleryPage : BasePage
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
<views:BasePage
xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
x:Class="Maui.Controls.Sample.Pages.Gestures.DragAndDropBetweenLayouts"
xmlns:views="clr-namespace:Maui.Controls.Sample.Pages.Base">
x:Class="Maui.Controls.Sample.Pages.DragAndDropBetweenLayouts"
xmlns:views="clr-namespace:Maui.Controls.Sample.Pages.Base">
<views:BasePage.Resources>
<DataTemplate x:Key="colorTemplate">
<BoxView HeightRequest="100" Background="{Binding .}">
Expand Down
Original file line number Diff line number Diff line change
@@ -1,21 +1,18 @@
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Maui.Controls.Sample.Pages.Base;
using Microsoft.Maui.Controls;

namespace Maui.Controls.Sample.Pages.Gestures
namespace Maui.Controls.Sample.Pages
{
public partial class DragAndDropBetweenLayouts
{
public ObservableCollection<Brush> AllColors { get; }
public ObservableCollection<Brush> RainbowColors { get; }

public DragAndDropBetweenLayouts()
{
InitializeComponent();

Console.WriteLine("Some really long text Some really long textSome really long textSome really long textSome really long textSome really long textSome really long textSome really long textSome really long textSome really long textSome really long textSome really long textSome really long textSome really long textSome really long textSome really long textSome really long textSome really long textSome really long textSome really long textSome really long textSome really long textSome really long textSome really long textSome really long textSome really long textSome really long textSome really long textSome really long textSome really long textSome really long textSome really long textSome really long textSome really long textSome really long textSome really long textSome really long textSome really long textSome really long textSome really long textSome really long textSome really long textSome really long textSome really long textSome really long textSome really long textSome really long textSome really long textSome really long text");
AllColors = new ObservableCollection<Brush>();
RainbowColors = new ObservableCollection<Brush>();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,21 +1,20 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Maui.Controls.Sample.Pages.Base;
using Microsoft.Maui;
using Microsoft.Maui.Controls;
using Microsoft.Maui.Controls.Internals;

using Microsoft.Maui.Graphics;

namespace Maui.Controls.Sample.Pages.Gestures
namespace Maui.Controls.Sample.Pages
{
public class PanGestureGalleryPage : BasePage
{
public class PanCompleteArgs : EventArgs
{
public PanCompleteArgs(string message) { Message = message; }

public string Message
{
get; private set;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
using System;
using System.Diagnostics;
using System.Linq;
using Maui.Controls.Sample.Pages.Base;
using Microsoft.Maui;
using Microsoft.Maui.Controls;
using Microsoft.Maui.Controls.Internals;
using Microsoft.Maui.Graphics;

namespace Maui.Controls.Sample.Pages.Gestures
namespace Maui.Controls.Sample.Pages
{
public class PinchToZoomContainer : VerticalStackLayout
{
Expand All @@ -16,7 +14,6 @@ public PinchToZoomContainer()

}


public View Content
{
get => Children.OfType<View>().LastOrDefault();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
using Microsoft.Maui.Controls;
using Microsoft.Maui.Graphics;

namespace Maui.Controls.Sample.Pages.Gestures
namespace Maui.Controls.Sample.Pages
{
public class SwipeGestureGalleryPage : BasePage
{
Expand Down
4 changes: 2 additions & 2 deletions src/Controls/samples/Controls.Sample/Pages/GesturesPage.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -44,13 +44,13 @@
</Frame>
<!-- CONTENT -->
<CollectionView
x:Name="CoreSections"
x:Name="GesturesSections"
Grid.Row="2"
BackgroundColor="Transparent"
ItemsSource="{Binding FilteredItems}"
SelectionMode="Single"
SelectedItem="{Binding SelectedItem, Source={x:RelativeSource AncestorType={x:Type ContentPage}}, Mode=TwoWay}"
SelectionChangedCommand="{Binding NavigateCommand, Source={x:RelativeSource AncestorType={x:Type ContentPage}}}"
SelectionChangedCommandParameter="{Binding SelectedItem, Source={x:Reference CoreSections}}"
Margin="6, 12, 6, 0">
<CollectionView.ItemsLayout>
<LinearItemsLayout
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,4 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Maui.Controls.Sample.Pages
namespace Maui.Controls.Sample.Pages
{
public partial class GesturesPage
{
Expand Down
33 changes: 15 additions & 18 deletions src/Controls/samples/Controls.Sample/Pages/MainPage.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,22 @@
x:Class="Maui.Controls.Sample.Pages.MainPage"
xmlns:views="clr-namespace:Maui.Controls.Sample.Pages.Base"
x:Name="HomePage"
BackgroundColor="{DynamicResource BackgroundColor}"
Title="Gallery">
<views:BasePage.Resources>
<ResourceDictionary>

<Style x:Key="TitleStyle" TargetType="Label">
<Setter Property="FontSize" Value="Title" />
<Setter Property="FontFamily" Value="Segoe UI Bold" />
<Setter Property="TextColor" Value="{StaticResource WhiteColor}" />
<Setter Property="HorizontalOptions" Value="Center" />
<Setter Property="Margin" Value="0, 24, 0, 0" />
</Style>

<Style x:Key="SubTitleStyle" TargetType="Label">
<Setter Property="FontSize" Value="Small" />
<Setter Property="FontFamily" Value="Segoe UI" />
<Setter Property="TextColor" Value="{StaticResource WhiteColor}" />
<Setter Property="HorizontalTextAlignment" Value="Center" />
<Setter Property="HorizontalOptions" Value="Center" />
Expand All @@ -35,24 +38,21 @@
<Setter Property="FlexLayout.Basis" Value="50%"/>
<Setter Property="FlexLayout.Grow" Value="0"/>
</Style>

<Style x:Key="SectionItemTitleStyle" TargetType="Label">
<Setter Property="FontSize" Value="Medium" />
<Setter Property="TextColor" Value="{StaticResource AccentColor}" />
</Style>

<Style x:Key="SectionItemDescriptionStyle" TargetType="Label">
<Setter Property="FontSize" Value="Micro" />
<Setter Property="TextColor" Value="{StaticResource BlackColor}" />
<Setter Property="LineBreakMode" Value="WordWrap" />

<Style x:Key="FooterStyle" TargetType="Label">
<Setter Property="FontSize" Value="Small" />
<Setter Property="FontFamily" Value="Segoe UI" />
<Setter Property="HorizontalOptions" Value="Center" />
<Setter Property="VerticalOptions" Value="End" />
<Setter Property="Margin" Value="0, 24" />
</Style>

</ResourceDictionary>
</views:BasePage.Resources>
<views:BasePage.ToolbarItems>
<ToolbarItem
IconImageSource="settings.png"
Text="Settings"/>
Text="Settings" />
</views:BasePage.ToolbarItems>
<ScrollView>
<Grid
Expand All @@ -78,7 +78,7 @@
Text="An open-source framework for building iOS, Android, macOS and Windows apps"
Style="{StaticResource SubTitleStyle}"/>
</Grid>
<!-- CONTENT -->
<!-- SECTIONS -->
<Grid
Grid.Row="1"
Margin="12">
Expand Down Expand Up @@ -106,11 +106,11 @@
RowDefinitions="Auto, *">
<Label
Text="{Binding Title}"
Style="{StaticResource SectionItemTitleStyle}"/>
Style="{StaticResource GalleryItemTitleStyle}"/>
<Label
Grid.Row="1"
Text="{Binding Description}"
Style="{StaticResource SectionItemDescriptionStyle}"/>
Style="{StaticResource GalleryItemDescriptionStyle}"/>
</Grid>
</Frame>
</DataTemplate>
Expand All @@ -120,11 +120,8 @@
<!-- FOOTER -->
<Label
Grid.Row="2"
Margin="0, 0, 0, 24"
FontSize="Small"
HorizontalOptions="Center"
Text="Microsoft Corporation © 2021"
VerticalOptions="End" />
Style="{StaticResource FooterStyle}" />
</Grid>
</ScrollView>
</views:BasePage>
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
4 changes: 4 additions & 0 deletions src/Controls/samples/Controls.Sample/Startup.cs
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,10 @@ public void Configure(IAppHostBuilder appBuilder)
fonts.AddFont("LobsterTwo-Italic.ttf", "Lobster Two Italic");
fonts.AddFont("LobsterTwo-BoldItalic.ttf", "Lobster Two BoldItalic");
fonts.AddFont("ionicons.ttf", "Ionicons");
fonts.AddFont("SegoeUI.ttf", "Segoe UI");
fonts.AddFont("SegoeUI-Bold.ttf", "Segoe UI Bold");
fonts.AddFont("SegoeUI-Italic.ttf", "Segoe UI Italic");
fonts.AddFont("SegoeUI-Bold-Italic.ttf", "Segoe UI Bold Italic");
})
.ConfigureEssentials(essentials =>
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ protected override IEnumerable<SectionModel> CreateItems() => new[]
new SectionModel(typeof(ClipPage), "Clip",
"Defines the outline of the contents of an element."),

new SectionModel(typeof(GesturesPage), "Gestures",
"Use tap, pinch, pan, swipe, and drag and drop gestures on View instances."),

new SectionModel(typeof(SemanticsPage), "Semantics",
".NET MAUI allows accessibility values to be set on user interface elements by using Semantics values."),

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
using System.Collections.Generic;
using Maui.Controls.Sample.Models;
using Maui.Controls.Sample.Pages;
using Maui.Controls.Sample.Pages.Gestures;
using Maui.Controls.Sample.ViewModels.Base;

namespace Maui.Controls.Sample.ViewModels
Expand All @@ -23,7 +22,6 @@ protected override IEnumerable<SectionModel> CreateItems() => new[]
new SectionModel(typeof(ClickGestureGalleryPage), "Click Gesture",
"Click Gesture."),
#endif

};
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,7 @@ protected override IEnumerable<SectionModel> CreateItems() => new[]
"User interface concepts like Animations, Colors, Fonts and more."),

new SectionModel(typeof(OthersPage), "Others Concepts",
"Other options like Graphics."),

new SectionModel(typeof(GesturesPage), "Gestures",
"Gestures")
"Other options like Graphics.")
};
}
}
13 changes: 10 additions & 3 deletions src/Controls/samples/Controls.Sample/XamlApp.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -37,28 +37,35 @@
</Style>

<Style x:Key="GalleryItemTitleStyle" TargetType="Label">
<Setter Property="FontSize" Value="12" />
<Setter Property="FontSize" Value="Small" />
<Setter Property="FontFamily" Value="Segoe UI" />
<Setter Property="FontAttributes" Value="Bold" />
<Setter Property="TextColor" Value="{StaticResource AccentColor}" />
<Setter Property="Margin" Value="0, 0, 0, 6" />
</Style>

<Style x:Key="GalleryItemDescriptionStyle" TargetType="Label">
<Setter Property="FontSize" Value="9" />
<Setter Property="FontSize" Value="Caption" />
<Setter Property="FontFamily" Value="Segoe UI" />
<Setter Property="TextColor" Value="{StaticResource BlackColor}" />
<Setter Property="LineBreakMode" Value="WordWrap" />
</Style>

<Style x:Key="NoItemsStyle" TargetType="Label">
<Setter Property="FontSize" Value="16" />
<Setter Property="FontSize" Value="Medium" />
<Setter Property="FontFamily" Value="Segoe UI" />
<Setter Property="HorizontalTextAlignment" Value="Center" />
<Setter Property="HorizontalOptions" Value="Center" />
<Setter Property="VerticalOptions" Value="Center" />
</Style>

<Style x:Key="Headline" TargetType="Label">
<Setter Property="FontFamily" Value="Segoe UI" />
<Setter Property="FontSize" Value="10" />
</Style>

<Style x:Key="Subhead" TargetType="Label">
<Setter Property="FontFamily" Value="Segoe UI" />
<Setter Property="FontSize" Value="9" />
</Style>

Expand Down