Skip to content

Instantly share code, notes, and snippets.

@odugen
odugen / FolderDialogBehavior.cs
Created January 13, 2015 08:01
WPF MVVM Folder dialog
using System.Linq;
using System.Reflection;
using System.Windows;
using System.Windows.Forms;
using System.Windows.Interactivity;
using Button = System.Windows.Controls.Button;
namespace FolderDialog
{
public class FolderDialogBehavior : Behavior<Button>
@bryanbarnard
bryanbarnard / SimpleHttpClient.cs
Created December 23, 2013 19:15
Simple C# .NET 4.5 HTTPClient Request Using Basic Auth and Proxy
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Net.Http;
using System.Net;
namespace HTTP_Test
@lkaczanowski
lkaczanowski / jquery.validate.unobtrusive.js
Created September 20, 2012 20:20
Styling asp.net MVC validation summary as Twitter bootstrap "flash"
function onErrors(form, validator) { // 'this' is the form element
var container = $(this).find("[data-valmsg-summary=true]"),
list = container.find("ul");
if (list && list.length && validator.errorList.length) {
list.empty();
container.addClass("validation-summary-errors").removeClass("validation-summary-valid");
$.each(validator.errorList, function () {
$("<li />").html(this.message).appendTo(list);