Inheritance: System.Windows.DependencyObject
コード例 #1
0
ファイル: ActionView.xaml.cs プロジェクト: noant/Pyrite
        public ActionView(ActionBag actionBag)
        {
            if (actionBag == null)
                return;

            var context = new ActionViewContext(actionBag);
            this.DataContext = context;
            InitializeComponent();

            context.Changed += (o, e) => RaiseChanged();

            this.tbParams.MouseLeftButtonDown += (o, e) =>
            {
                context.BeginActionUserSettings();
            };

            this.btCheck.Click += (o, e) =>
            {
                context.ExecuteCurrentAction();
            };

            this.btDelete.Click += (o, e) =>
            {
                RaiseRemove();
            };

            this.KeyDown += (o, e) =>
            {
                if (e.Key == Key.Delete)
                    RaiseRemove();
            };
        }
コード例 #2
0
        public ActionViewExtended(ActionBag actionBag)
        {
            if (actionBag == null)
                return;
            var context = new ActionViewContext(actionBag);
            this.DataContext = context;
            InitializeComponent();

            context.ActionStringSplitter = "\r\n";

            context.Changed += (o, e) => RaiseChanged();

            this.tbParams.MouseLeftButtonDown += (o, e) =>
            {
                context.BeginActionUserSettings();
            };

            this.btCheck.Click += (o, e) =>
            {
                context.ExecuteCurrentAction();
            };
        }