Skip to content

Instantly share code, notes, and snippets.

View cwensley's full-sized avatar

Curtis Wensley cwensley

View GitHub Profile
@cwensley
cwensley / LoadingScreenForEto.cs
Created September 26, 2019 18:14
Loading Screen for Eto
using System;
using Eto.Forms;
using Eto.Drawing;
using System.Threading.Tasks;
using System.Threading;
namespace EtoLoadingScreen.Desktop
{
public partial class MainForm : Form
{
<?xml version="1.0" encoding="UTF-8"?>
<Form xmlns="http://schema.picoe.ca/eto.forms" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Title="My Eto Form" ClientSize="400, 350" Padding="10">
<StackLayout>
<StackLayoutItem Expand="True" HorizontalAlignment="Stretch">
<TreeGridView>
<GridColumn HeaderText="Some Column">
<TextBoxCell Binding="{Binding MyProperty}"/>
</GridColumn>
</TreeGridView>
</StackLayoutItem>
@cwensley
cwensley / DropWithDrawable.cs
Created October 23, 2018 20:02
Shows how to accept files with drag/drop in a Drawable
using System;
using Eto.Forms;
using Eto.Drawing;
using System.Linq;
using System.Diagnostics;
namespace TestDropFile
{
public partial class MainForm : Form
{
using System;
using Eto.Forms;
using Eto.Drawing;
namespace Eto.Forms
{
/// <summary>
/// A dialog that sizes to its content automatically
/// </summary>
public class AutoSizingDialog<T> : Dialog<T>
@cwensley
cwensley / MvvmButtonBackgroundTest.cs
Last active October 24, 2017 20:52
Shows how to hook up a button to a view model and update its background color based on logic in the view model.
using System;
using System.ComponentModel;
using System.Windows.Input;
using System.Runtime.CompilerServices;
using Eto.Forms;
using Eto.Drawing;
namespace Test
{
public class MyViewModel : INotifyPropertyChanged
@cwensley
cwensley / DropDownInCustomCell.cs
Last active April 18, 2017 21:09
Shows how to use a DropDown control with per-item list of items.
using System;
using Eto.Forms;
using Eto.Drawing;
namespace Eto.Test
{
class MyItem
{
public int SelectedItem { get; set; }
@cwensley
cwensley / BindingHelperMethod.cs
Created March 2, 2017 21:09
Shows how to create a helper method to set up binding for multiple properties of a check box.
using System;
using Eto.Forms;
using Eto.Drawing;
using System.ComponentModel;
using System.Windows.Input;
using System.Linq.Expressions;
namespace MyApp1
{
public class MyViewModel : INotifyPropertyChanged
@cwensley
cwensley / EtoCollapsibleDialog.cs
Created January 18, 2017 18:40
Example showing how to create a collapsible panel in Eto using C#
using System;
using Eto.Forms;
using Eto.Drawing;
namespace MyCollapserForm
{
public class MainForm : Dialog<bool>
{
class L : Label
{
@cwensley
cwensley / EtoCollapsibleDialog.py
Last active September 13, 2018 17:00
Example showing how to create a collapsible panel in Eto using python
import scriptcontext
import rhinoscriptsyntax as rs
import clr
import sys
clr.AddReference("Eto")
clr.AddReference("Rhino.UI")
from Rhino.UI import *
from Eto.Forms import Form, Dialog, Label, TextBox, StackLayout, Orientation, Button, HorizontalAlignment, VerticalAlignment, TextAlignment, NumericUpDown, MessageBox, DropDown, CheckBox, TableLayout, StackLayoutItem, DynamicLayout, Control, Panel, Form
from Eto.Drawing import *
@cwensley
cwensley / WpfSpellCheckRTF.cs
Last active November 30, 2016 18:30
Shows how to add a Spell Check item to the RichText context menu on WPF using a native style in Eto.Forms.
using System;
using swc = System.Windows.Controls;
using swi = System.Windows.Input;
using Eto;
using Eto.Forms;
using Eto.Drawing;
namespace TestWpfSpellCheckMenuItem
{
class Startup