Skip to content

Instantly share code, notes, and snippets.

View somapatrik's full-sized avatar

Patrik Šoma somapatrik

View GitHub Profile
@somapatrik
somapatrik / RelayCommand.cs
Created November 20, 2023 10:20
WPF Relay Command
public class RelayCommand : ICommand
{
private Action<object> _execute;
private Func<object, bool> _canExecute;
public RelayCommand(Action<object> execute)
{
_execute = execute;
_canExecute = null;
@somapatrik
somapatrik / qryhnd.snippet
Last active January 3, 2024 07:11
Query + Handler
<?xml version="1.0" encoding="utf-8"?>
<CodeSnippets xmlns="http://schemas.microsoft.com/VisualStudio/2005/CodeSnippet">
<CodeSnippet Format="1.0.0">
<Header>
<Title>Query with handler</Title>
<Author>Patrik Šoma</Author>
<Description>SLM only!</Description>
<Shortcut>qryhnd</Shortcut>
</Header>
<Snippet>
@somapatrik
somapatrik / cmdhnd.snippet
Last active January 3, 2024 07:11
Command + Handler snippet
<?xml version="1.0" encoding="utf-8"?>
<CodeSnippets xmlns="http://schemas.microsoft.com/VisualStudio/2005/CodeSnippet">
<CodeSnippet Format="1.0.0">
<Header>
<Title>Command with handler</Title>
<Author>Patrik Šoma</Author>
<Description>SLM Only!</Description>
<Shortcut>cmdhnd</Shortcut>
</Header>
<Snippet>