aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/Notes/Tango.Notes/PPC/Touch.txt
blob: ba8eb01edc3ae77efc5012f3d51d551e18b487d8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
There are several useful registry settings for the Touch Wisp component.

CURRENT_USER\SOFTWARE\MICROSOFT\Wisp\Touch

If we are working on .NET 4.7 & Windows 10
We can take advantage of the new touch engine (Not Wisp).

To enable the new touch engine on a WPF application, add the following to the app.config.

<configuration>
    <runtime>
        <AppContextSwitchOverrides value="Switch.System.Windows.Input.Stylus.EnablePointerSupport=true"/>
    </runtime>
</configuration>
ighlight .si { color: #3333bb; background-color: #fff0f0 } /* Literal.String.Interpol */ .highlight .sx { color: #22bb22; background-color: #f0fff0 } /* Literal.String.Other */ .highlight .sr { color: #008800; background-color: #fff0ff } /* Literal.String.Regex */ .highlight .s1 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Single */ .highlight .ss { color: #aa6600; background-color: #fff0f0 } /* Literal.String.Symbol */ .highlight .bp { color: #003388 } /* Name.Builtin.Pseudo */ .highlight .fm { color: #0066bb; font-weight: bold } /* Name.Function.Magic */ .highlight .vc { color: #336699 } /* Name.Variable.Class */ .highlight .vg { color: #dd7700 } /* Name.Variable.Global */ .highlight .vi { color: #3333bb } /* Name.Variable.Instance */ .highlight .vm { color: #336699 } /* Name.Variable.Magic */ .highlight .il { color: #0000DD; font-weight: bold } /* Literal.Number.Integer.Long */
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Tango.Core;
using Tango.Core.Commands;
using Tango.Core.DI;
using Tango.FSE.Common.Core;

namespace Tango.FSE.Common.Notifications
{
    public class TaskItem : ExtendedObject, IDisposable
    {
        private Action _cancelAction;

        private FSEProgress<double> _progress;
        public FSEProgress<double> Progress
        {
            get { return _progress; }
            set { _progress = value; RaisePropertyChangedAuto(); }
        }

        private bool _hasCancel;
        public bool HasCancel
        {
            get { return _hasCancel; }
            set { _hasCancel = value; RaisePropertyChangedAuto(); }
        }

        public RelayCommand CancelCommand { get; set; }

        public TaskItem()
        {
            Progress = new FSEProgress<double>() { Maximum = 100 };
        }

        public TaskItem(String message) : this()
        {
            Progress.Message = message;
        }

        public TaskItem(String message, Action cancelAction) : this(message)
        {
            _cancelAction = cancelAction;
            HasCancel = true;
        }

        public void UpdateProgress(String message, double value = 0, double maximum = 100, bool isIndeterminate = true)
        {
            Progress = new FSEProgress<double>()
            {
                Value = value,
                Maximum = maximum,
                IsIndeterminate = isIndeterminate,
                Message = message,
            };
        }

        public void Dispose()
        {
            TangoIOC.Default.GetInstance<INotificationProvider>().PopTaskItem(this);
        }
    }
}