Skip to content

Instantly share code, notes, and snippets.

View vhugogarcia's full-sized avatar
🏠
Working from home

Víctor Hugo García Hernández vhugogarcia

🏠
Working from home
View GitHub Profile
@vhugogarcia
vhugogarcia / Colors.xaml
Created August 30, 2024 19:43
Material Design 3 - .NET MAUI XAML Color Resources
<?xml version="1.0" encoding="UTF-8"?>
<?xaml-comp compile="true" ?>
<ResourceDictionary
xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:toolkit="http://schemas.microsoft.com/dotnet/2022/maui/toolkit">
<!-- Primary -->
<Color x:Key="Primary0">#000000</Color>
<Color x:Key="Primary5">#00102B</Color>
<Color x:Key="Primary10">#001B3E</Color>
@vhugogarcia
vhugogarcia / material-design-3-colors-sample.json
Created August 30, 2024 19:38
Material Design 3 - Colors JSON Sample
{
"description": "TYPE: CUSTOM\nMaterial Theme Builder export 2024-08-30 01:36:01",
"seed": "#769CDF",
"coreColors": {
"primary": "#769CDF"
},
"extendedColors": [],
"schemes": {
"light": {
"primary": "#415F91",
@vhugogarcia
vhugogarcia / sample-firebase-binding.csproj
Created April 26, 2024 18:31
Firebase Binding Sample CSPROJ
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>net8.0-android;net8.0-ios</TargetFrameworks>
<OutputType>Exe</OutputType>
<RootNamespace>Sample</RootNamespace>
<UseMaui>true</UseMaui>
<SingleProject>true</SingleProject>
<ImplicitUsings>enable</ImplicitUsings>
<NoWarn>1998,8632</NoWarn>
@vhugogarcia
vhugogarcia / ObservableRangeCollection.cs
Created April 16, 2024 13:10
Represents a dynamic data collection that provides notifications when items get added, removed, or when the whole list is refreshed.
namespace Demo.Extensions;
/// <summary>
/// Represents a dynamic data collection that provides notifications when items get added, removed, or when the whole list is refreshed.
/// </summary>
/// <typeparam name="T"></typeparam>
public class ObservableRangeCollection<T> : ObservableCollection<T>
{
/// <summary>
@vhugogarcia
vhugogarcia / azure-pipelines-ios.yml
Last active December 19, 2022 17:32
Azure Pipelines for .NET MAUI iOS
# Documentation
#
# Set the vX.X.X-X tag (vMAJOR.MINOR.PATCH-BUILD_NUMBER)
# Install the Mobile Versioning in your Azure workspace https://marketplace.visualstudio.com/items?itemName=DamienAicheh.mobile-versioning-task
#
parameters:
- name: environment
displayName: Select an Environment
type: string
@vhugogarcia
vhugogarcia / azure-pipelines-android.yml
Last active March 14, 2024 20:19
Azure DevOps Pipeline for .NET MAUI Android
# Documentation
#
# Set the vX.X.X-X tag (vMAJOR.MINOR.PATCH-BUILD_NUMBER) to trigger the pipeline
# Install the Mobile Versioning in your Azure workspace https://marketplace.visualstudio.com/items?itemName=DamienAicheh.mobile-versioning-task
#
parameters:
- name: environment
displayName: Select an Environment
type: string
@vhugogarcia
vhugogarcia / BackgroundContentPageMAUI.xaml
Created November 28, 2022 17:35
Set gradient background to content page in .NET MAUI
<?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:ios="clr-namespace:Microsoft.Maui.Controls.PlatformConfiguration.iOSSpecific;assembly=Microsoft.Maui.Controls"
ios:Page.UseSafeArea="False">
<FlexLayout Direction="Column"
HorizontalOptions="FillAndExpand"
VerticalOptions="FillAndExpand">
<FlexLayout.Background>
<LinearGradientBrush EndPoint="0,1">
using Firebase.Crashlytics;
#if IOS
using Foundation;
#else
using Firebase;
#endif
namespace DemoApp.Services.Firebase;
@vhugogarcia
vhugogarcia / FirebaseAnalyticsService.cs
Created October 30, 2022 23:20
.NET MAUI Firebase Analytics Service
using Microsoft.Maui.Controls.Compatibility;
using Firebase.Analytics;
#if IOS
using Foundation;
#else
using Android.Content;
using Android.OS;
#endif
@vhugogarcia
vhugogarcia / PopupService.cs
Last active September 26, 2022 21:59
This Popup service helps to create and update the layout of a popup, so it allows running multiple Lottie animations during a process
using CommunityToolkit.Maui.Views;
namespace MauiApp.Services.ToolkitPopup;
public class PopupService : IPopupService
{
readonly Page page = Application.Current?.MainPage ?? throw new NullReferenceException();
private Popup popup { get; set; }
/// <summary>