Skip to content

Instantly share code, notes, and snippets.

View maxkatz6's full-sized avatar

Max Katz maxkatz6

View GitHub Profile
name: Publish
on:
push:
branches:
- master
jobs:
build:
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
@maxkatz6
maxkatz6 / AddClassBehavior.cs
Last active February 15, 2021 21:17
AddClassBehavior
public class AddClassBehavior : AvaloniaObject, IBehavior
{
public IAvaloniaObject AssociatedObject { get; private set; }
public string Class
{
get => GetValue(ClassProperty);
set => SetValue(ClassProperty, value);
}
using System;
using Avalonia;
using Avalonia.Collections;
using Avalonia.Controls;
using Avalonia.Data;
using ReactiveUI;
namespace Utils
using Octokit;
using System.CommandLine.Invocation;
using System.CommandLine;
using System.Globalization;
using System;
using System.Linq;
using System.Collections.Generic;
using System.Text.RegularExpressions;
using System.Threading.Tasks;
@maxkatz6
maxkatz6 / TextBlockWithShadow.cs
Created November 10, 2021 03:57
TextBlockWithShadow
using Avalonia;
using Avalonia.Controls;
using Avalonia.Layout;
using Avalonia.Media;
using Avalonia.Media.Immutable;
using Avalonia.Media.TextFormatting;
namespace MyApp
{
public class TextBlockWithShadow : TextBlock
@maxkatz6
maxkatz6 / MyProject.csproj
Last active January 3, 2022 06:09
obfuscar.xml
<Project Sdk="Microsoft.NET.Sdk">
<!-- ... -->
<Import Project="../Obfuscar.targets" />
<!-- ... -->
</Project>
@maxkatz6
maxkatz6 / SelectionItemsRepeater.cs
Last active November 15, 2024 15:16
SelectionItemsRepeater.cs
using System;
using System.Collections;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Collections.Specialized;
using System.Linq;
using Avalonia;
using Avalonia.Controls;
using Avalonia.Controls.Selection;
@maxkatz6
maxkatz6 / HorizontalScroller.xaml
Created April 17, 2022 03:00
horizontalScroller
<Style Selector="ScrollViewer.horizontalScroller">
<Setter Property="Template">
<ControlTemplate>
<DockPanel>
<RepeatButton x:Name="ScrollLeftButton"
DockPanel.Dock="Left"
Foreground="{DynamicResource SystemControlForegroundBaseHighBrush}"
Command="{Binding PageLeft, RelativeSource={RelativeSource TemplatedParent}}">
<RepeatButton.IsVisible>
<MultiBinding Converter="{x:Static avaConv:MenuScrollingVisibilityConverter.Instance}"
<UserControl
xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:i="clr-namespace:Avalonia.Xaml.Interactivity;assembly=Avalonia.Xaml.Interactivity"
xmlns:ia="clr-namespace:Avalonia.Xaml.Interactions.Core;assembly=Avalonia.Xaml.Interactions"
MaxWidth="600">
<UserControl.Styles>
<Styles>
<Style Selector="Border.animated">
<Style.Animations>
public class AsyncImage : Image
{
private static readonly HttpClient httpClient = new HttpClient();
public static readonly StyledProperty<string?> AsyncSourceProperty =
AvaloniaProperty.Register<AsyncImage, string?>(nameof(AsyncSource));
public static readonly StyledProperty<string?> FallbackSourceProperty =
AvaloniaProperty.Register<AsyncImage, string?>(nameof(FallbackSource));