Skip to content

Instantly share code, notes, and snippets.

View almirvuk's full-sized avatar
❤️
Living life to the fullest, thanks for visiting me here.

Almir Vuk almirvuk

❤️
Living life to the fullest, thanks for visiting me here.
View GitHub Profile
<?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="Collections.Views.VerticalListPage"
Title="Gallery of Art">
<ContentPage.Content>
<CollectionView ItemsSource="{Binding Pictures}"
ItemsLayout="VerticalList">
<?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="Collections.Views.HorizontalListPage"
Title="Gallery of Art">
<StackLayout>
<StackLayout Orientation="Horizontal">
<?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="Collections.Views.VerticalGridPage"
Title="Gallery of Art">
<StackLayout>
<StackLayout Orientation="Horizontal" Margin="6,6,6,8">
<?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="Collections.Views.HorizontalGridPage"
Title="HorizontalGridPage">
<ContentPage.Content>
<StackLayout>
<StackLayout Orientation="Horizontal">
void AppActions_OnAppAction(object sender, AppActionEventArgs e)
{
// Don't handle events fired for old application instances
// and cleanup the old instance's event handler
if (Application.Current != this && Application.Current is App app)
{
AppActions.OnAppAction -= app.AppActions_OnAppAction;
return;
}
// Subscribe to an event
AppActions.OnAppAction += AppActions_OnAppAction;
protected override async void OnStart()
{
try
{
await AppActions.SetAsync(
new AppAction(id: Helpers.ActionType.AddNote, title: "Add new note", icon: "icon.png"),
new AppAction(id: Helpers.ActionType.ViewFavourites, title: "View favourites", icon: "icon.png"));
}
catch (FeatureNotSupportedException ex)
{
// Other code
// ...
public override void PerformActionForShortcutItem(UIApplication application, UIApplicationShortcutItem shortcutItem, UIOperationHandler completionHandler)
=> Xamarin.Essentials.Platform.PerformActionForShortcutItem(application, shortcutItem, completionHandler);
// Other code
// ...
protected override void OnResume()
{
base.OnResume();
Xamarin.Essentials.Platform.OnResume(this);
}
<?xml version="1.0" encoding="utf-8" ?>
<ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
x:Class="XF.EmbeddedFonts.MainPage">
<StackLayout>
<Label Text="Welcome to Xamarin.Forms... with custom font setup, easier than ever!"
FontFamily="LibreBaskerville-Regular"
VerticalOptions="CenterAndExpand"
HorizontalTextAlignment="Center"