csharpc-sharpdotnetxamlavaloniauicross-platformcross-platform-xamlavaloniaguimulti-platformuser-interfacedotnetcore
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
66 lines
1.2 KiB
66 lines
1.2 KiB
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
|
|
namespace Perspex
|
|
{
|
|
public enum BindingMode
|
|
{
|
|
Default,
|
|
OneWay,
|
|
TwoWay,
|
|
OneTime,
|
|
OneWayToSource,
|
|
}
|
|
|
|
public struct Binding
|
|
{
|
|
public BindingMode Mode
|
|
{
|
|
get;
|
|
set;
|
|
}
|
|
|
|
public BindingPriority Priority
|
|
{
|
|
get;
|
|
set;
|
|
}
|
|
|
|
public PerspexProperty Property
|
|
{
|
|
get;
|
|
set;
|
|
}
|
|
|
|
public PerspexObject Source
|
|
{
|
|
get;
|
|
set;
|
|
}
|
|
|
|
public static Binding operator !(Binding binding)
|
|
{
|
|
return binding.WithMode(BindingMode.TwoWay);
|
|
}
|
|
|
|
public static Binding operator ~(Binding binding)
|
|
{
|
|
return binding.WithMode(BindingMode.TwoWay);
|
|
}
|
|
|
|
public Binding WithMode(BindingMode mode)
|
|
{
|
|
this.Mode = mode;
|
|
return this;
|
|
}
|
|
|
|
public Binding WithPriority(BindingPriority priority)
|
|
{
|
|
this.Priority = priority;
|
|
return this;
|
|
}
|
|
}
|
|
}
|
|
|