Skip to content

Instantly share code, notes, and snippets.

View cwensley's full-sized avatar

Curtis Wensley cwensley

View GitHub Profile
@cwensley
cwensley / GenerateImageInBackground.eto.cs
Created October 31, 2016 18:01
Shows how to generate an image in your view model based on user input in a background thread using async/await.
using System;
using Eto.Forms;
using Eto.Drawing;
using System.ComponentModel;
using System.Windows.Input;
using System.Threading.Tasks;
using System.Threading;
namespace TestAsyncAwait
{
@cwensley
cwensley / curtis-demo.cs
Created July 19, 2016 16:54
Demo code binding to a view model, styles, and layout written during live session
using System;
using Eto.Forms;
using Eto.Drawing;
using System.Windows.Input;
using System.Runtime.CompilerServices;
using System.ComponentModel;
using System.Collections.Generic;
using System.Collections.ObjectModel;
namespace EtoApp2
@cwensley
cwensley / DropDownWithItemUpdate.cs
Created May 26, 2016 17:19
Eto.Forms example of a DropDown that updates one of its item text using logic in the view model.
using System;
using Eto.Forms;
using Eto.Drawing;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Windows.Input;
using System.Linq;
using System.ComponentModel;
using System.Runtime.CompilerServices;
@cwensley
cwensley / IconGridLayout.cs
Created May 6, 2016 18:18
Shows how to create an icon grid layout control in Eto.Forms
using System;
using System.Collections.ObjectModel;
using Eto.Forms;
using Eto.Drawing;
namespace Examples
{
public class IconGridLayout : Panel
{
int? lastWidth;
@cwensley
cwensley / MyValidationDialog.cs
Created February 2, 2016 21:23
Example of how to validate the input of controls on an Eto.Forms dialog.
using System;
using System.Collections.Generic;
using System.Linq;
using Eto.Forms;
using Eto.Drawing;
namespace MyValidationApp
{
// base validator that can be extended to do custom validation
public class ControlValidator
//
// Copyright (C) 2010 Novell Inc. http://novell.com
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to
// permit persons to whom the Software is furnished to do so, subject to
// the following conditions:
@cwensley
cwensley / RunEtoWithBackgroundTasks.cs
Last active July 24, 2023 11:40
Shows how to use Eto.Forms with async/await and background tasks to perform long running work while keeping the UI responsive.
using System;
using Eto.Forms;
using System.Threading;
using System.Threading.Tasks;
using System.Collections.Generic;
using Eto.Drawing;
namespace RunEtoWithBackgroundTasks
{
@cwensley
cwensley / BindToDictionary.cs
Last active December 8, 2015 09:32
Bind Eto ComboBox to a Dictionary
using Eto.Forms;
using System.Linq;
using System.Collections.Generic;
class MyModel
{
public Guid MyGuidProperty {get; set; }
}
@cwensley
cwensley / EtoCommandBinding.cs
Last active August 29, 2015 14:26
Command binding in Eto.Forms
using Eto.Forms;
using Eto.Drawing;
namespace MyEtoApp
{
public class MyModel
{
public MyModel()
{
MyCommand = new Command();
@cwensley
cwensley / MyDrawable.cs
Last active March 21, 2022 08:47
Custom drawable template for Eto
using Eto.Forms;
using Eto.Drawing;
namespace CustomDrawable
{
public class MyDrawable : Drawable
{
bool mouseDragging;