client/src/Iri.Modernisation.Controls/View/ContextualLinkBinder.xaml.cs
author Matthieu Totet
Tue, 22 Dec 2009 16:22:22 +0100
changeset 26 44a2dc869e28
parent 13 b5ee436add3d
child 28 2d4ec5ab2a40
permissions -rw-r--r--
Save before big changes on HeaderProduction

using System;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Ink;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using Iri.Modernisation.Data.Models;
using System.Windows.Data;
using Iri.Modernisation.BaseMVVM.Commands;
using Iri.Modernisation.Controls.Converter;



namespace Iri.Modernisation.Controls.View
{
    public partial class ContextualLinkBinder : UserControl
    {

        public PolemicElementType PolemicType
        {
            get { return (PolemicElementType)GetValue(_polemicType); }
            set
            {
                
                SetValue(_polemicType, value);
                PolemicTypeColorConverter converter = new PolemicTypeColorConverter();
                path9020.Stroke = PolemicTypeColorConverter.Convert(value);

            }
        }

        public static readonly DependencyProperty _polemicType =
            DependencyProperty.Register("PolemicType", typeof(PolemicElementType), typeof(ContextualLinkBinder), new PropertyMetadata(PolemicElementType.Basic));

        /* public Brush ArrowColor
         {
             get { return path9020.Stroke; }
             set { path9020.Stroke = value; }
         }*/
        public ContextualLinkBinder()
        {
            // Required to initialize variables
              InitializeComponent();
              MouseLeftButtonDown += Commands.ContextualBinderLayer.BeginBind.Execute;
              MouseLeftButtonUp += new MouseButtonEventHandler(ContextualLinkBinder_MouseLeftButtonUp);
              


        }

        void ContextualLinkBinder_MouseLeftButtonUp(object sender, MouseButtonEventArgs e)
        {
            Commands.ContextualBinderLayer.BeginBind.Execute(sender, null);
        }
        public ContextualLinkBinder(ContextualLinkBinder copy)
        {
            InitializeComponent();
            PolemicType = copy.PolemicType;
        }
    }
    
}