Skip to content

Instantly share code, notes, and snippets.

@ibebbs
ibebbs / Controller.cs
Created May 9, 2019 14:25
Showing tight-coupling
using Microsoft.AspNetCore.Mvc;
namespace FluentlyNamespaced.Group
{
[Route("api/group")]
[ApiController]
public class Controller : ControllerBase
{
public Controller(Person.Data.Source personDataSource, Person.Mapping.Provider personMappingProvider)
{
@ibebbs
ibebbs / Controller.cs
Last active May 9, 2019 15:36
Fluent namespacing of dependencies
using Microsoft.AspNetCore.Mvc;
namespace FluentlyNamespaced.Role
{
[Route("api/role")]
[ApiController]
public class Controller : ControllerBase
{
private readonly Repository _roleRepository;
private readonly Person.Repository _personRespository;
<TextBlock>
<Run>Some leading text with a</Run>
<Hyperlink xaml:HyperlinkExtensions.Command="{Binding HyperlinkClicked}">hyperlink</Hyperlink>
<Run>in the middle.</Run>
</TextBlock>
@ibebbs
ibebbs / EmbeddedHyperlink.xaml
Last active August 18, 2016 08:10
Textblock with embedded hyperlink
@ibebbs
ibebbs / HyperlinkExtensions.cs
Last active August 23, 2016 10:13
Attached Property allowing Hyperlink to bind to and execute ICommands
public static class HyperlinkExtensions
{
private static void OnCommandPropertyChanged(DependencyObject sender, DependencyPropertyChangedEventArgs args)
{
Hyperlink hyperlink = sender as Hyperlink;
if (hyperlink != null)
{
hyperlink.Click -= OnHyperlinkClicked;