static CueBannerService()
		{
			onVisibleChanged = ( s, e ) =>
			{
				HandleShowRequest( ( UIElement )s );
			};
		}
    public WellView()
    {
      
      InitializeComponent();
      DataContextChanged += new DependencyPropertyChangedEventHandler(WellView_DataContextChanged);
      Loaded += new RoutedEventHandler(WellView_Loaded);

      SelectedPoint.SetXMapping(var => dateAxis.ConvertToDouble(var.Time));
      SelectedPoint.SetYMapping(var => var.Value);

      ObsGraph.MouseLeftButtonDown += new MouseButtonEventHandler(g_MouseLeftButtonDown);

      ObsGraph.AddLineGraph(SelectedPoint, null, new CircleElementPointMarker {
                      Size = 10,
                      Brush = Brushes.Red,
                      Fill = Brushes.Orange
                    }
                    , null);

      pens = new Pen[6];

      pens[0] = new Pen(Brushes.Black, 3);
      pens[1] = new Pen(Brushes.Red, 3);
      pens[2] = new Pen(Brushes.Blue, 3);
      pens[3] = new Pen(Brushes.Green, 3);
      pens[4] = new Pen(Brushes.Yellow, 3);
      pens[5] = new Pen(Brushes.Brown, 3);
    }
 public PlotterConfigurator()
 {
   InitializeComponent();
   DataContextChanged += new DependencyPropertyChangedEventHandler(PlotterConfigurator_DataContextChanged);
   
   Closing += new System.ComponentModel.CancelEventHandler(PlotterConfigurator_Closing);
 }
示例#4
0
        internal StylusLogic(InputManager inputManager) 
        { 
            _inputManager = new SecurityCriticalData<InputManager>(inputManager);;
            _inputManager.Value.PreProcessInput   += new PreProcessInputEventHandler(PreProcessInput); 
            _inputManager.Value.PreNotifyInput    += new NotifyInputEventHandler(PreNotifyInput);
            _inputManager.Value.PostProcessInput  += new ProcessInputEventHandler(PostProcessInput);

#if !MULTICAPTURE 
            _overIsEnabledChangedEventHandler = new DependencyPropertyChangedEventHandler(OnOverIsEnabledChanged);
            _overIsVisibleChangedEventHandler = new DependencyPropertyChangedEventHandler(OnOverIsVisibleChanged); 
            _overIsHitTestVisibleChangedEventHandler = new DependencyPropertyChangedEventHandler(OnOverIsHitTestVisibleChanged); 
            _reevaluateStylusOverDelegate = new DispatcherOperationCallback(ReevaluateStylusOverAsync);
            _reevaluateStylusOverOperation = null; 

            _captureIsEnabledChangedEventHandler = new DependencyPropertyChangedEventHandler(OnCaptureIsEnabledChanged);
            _captureIsVisibleChangedEventHandler = new DependencyPropertyChangedEventHandler(OnCaptureIsVisibleChanged);
            _captureIsHitTestVisibleChangedEventHandler = new DependencyPropertyChangedEventHandler(OnCaptureIsHitTestVisibleChanged); 
            _reevaluateCaptureDelegate = new DispatcherOperationCallback(ReevaluateCaptureAsync);
            _reevaluateCaptureOperation = null; 
#endif 

 
            _shutdownHandler = new EventHandler(this.OnDispatcherShutdown);
            _processDisplayChanged = new DispatcherOperationCallback(ProcessDisplayChanged);
            _processDeferredMouseMove = new DispatcherOperationCallback(ProcessDeferredMouseMove);
 
            ReadSystemConfig();
 
            _dlgInputManagerProcessInput = new DispatcherOperationCallback(InputManagerProcessInput); 
        }
 public static void RaiseEvent(DependencyPropertyChangedEventHandler handler, object sender, DependencyPropertyChangedEventArgs args)
 {
     if (handler != null)
     {
         handler(sender, args);
     }
 }
示例#6
0
       internal MouseDevice(InputManager inputManager)
       {
            _inputManager = new SecurityCriticalData<InputManager>(inputManager);
            _inputManager.Value.PreProcessInput += new PreProcessInputEventHandler(PreProcessInput);
            _inputManager.Value.PreNotifyInput += new NotifyInputEventHandler(PreNotifyInput);
            _inputManager.Value.PostProcessInput += new ProcessInputEventHandler(PostProcessInput);

            // Get information about how far two clicks of a double click can be considered
            // to be in the "same place and time".
            //
            // The call here goes into the safe helper calls, more of a consistency in approach
            //
            _doubleClickDeltaX = SafeSystemMetrics.DoubleClickDeltaX;
            _doubleClickDeltaY = SafeSystemMetrics.DoubleClickDeltaY;
            _doubleClickDeltaTime = SafeNativeMethods.GetDoubleClickTime();

            _overIsEnabledChangedEventHandler = new DependencyPropertyChangedEventHandler(OnOverIsEnabledChanged);
            _overIsVisibleChangedEventHandler = new DependencyPropertyChangedEventHandler(OnOverIsVisibleChanged);
            _overIsHitTestVisibleChangedEventHandler  = new DependencyPropertyChangedEventHandler(OnOverIsHitTestVisibleChanged);
            _reevaluateMouseOverDelegate = new DispatcherOperationCallback(ReevaluateMouseOverAsync);
            _reevaluateMouseOverOperation = null;

            _captureIsEnabledChangedEventHandler = new DependencyPropertyChangedEventHandler(OnCaptureIsEnabledChanged);
            _captureIsVisibleChangedEventHandler = new DependencyPropertyChangedEventHandler(OnCaptureIsVisibleChanged);
            _captureIsHitTestVisibleChangedEventHandler  = new DependencyPropertyChangedEventHandler(OnCaptureIsHitTestVisibleChanged);
            _reevaluateCaptureDelegate = new DispatcherOperationCallback(ReevaluateCaptureAsync);
            _reevaluateCaptureOperation = null;

            _inputManager.Value.HitTestInvalidatedAsync += new EventHandler(OnHitTestInvalidatedAsync);
        }
    public VedstedCalibration()
    {
      InitializeComponent();
      DataContextChanged += new DependencyPropertyChangedEventHandler(VedstedCalibration_DataContextChanged);


    }
示例#8
0
        public Trade()
        {
            InitializeComponent();

            Loaded += new RoutedEventHandler(Trade_Loaded);
            DataContextChanged += new DependencyPropertyChangedEventHandler(Trade_DataContextChanged);
        }
示例#9
0
		public TimeLineItem()
		{
			this.InitializeComponent();
			Init();

			DataContextChanged += new DependencyPropertyChangedEventHandler(TimeLineItem_DataContextChanged);
		}
示例#10
0
        public BuildPallette()
        {
            InitializeComponent();

            Loaded += new RoutedEventHandler(BuildPallette_Loaded);
            DataContextChanged += new DependencyPropertyChangedEventHandler(BuildPallette_DataContextChanged);
            uiDevcards.ExecuteGameAction += new GameMain2.ExecuteGameActionHandler(uiDevcards_ExecuteGameAction);
        }
示例#11
0
 public searchControl()
 {
     // Required to initialize variables
     InitializeComponent();
     Loaded += new RoutedEventHandler(searchControl_Loaded);
     IsEnabledChanged += new DependencyPropertyChangedEventHandler(searchControl_IsEnabledChanged);
    
 }
 /// <summary>
 /// Initializes a new instance of the
 /// <see cref="T:System.Windows.Controls.TabControl" /> class.
 /// </summary>
 public TabControl()
 {
     SelectedIndex = -1;
     KeyDown += delegate(object sender, KeyEventArgs e) { OnKeyDown(e); };
     SelectionChanged += delegate(object sender, SelectionChangedEventArgs e) { OnSelectionChanged(e); };
     IsEnabledChanged += new DependencyPropertyChangedEventHandler(OnIsEnabledChanged);
     DefaultStyleKey = typeof(TabControl);
 }
        public CardPairEdit()
        {
            this.InitializeComponent();

            DataContextChanged += new DependencyPropertyChangedEventHandler(CardPairEdit_DataContextChanged);

            Loaded += new RoutedEventHandler(CardPairEdit_Loaded);
        }
 /// <summary>
 /// Initializes a new instance of the <see cref="ObservableDependencyProperty"/> class.
 /// </summary>
 /// <param name="targetType">Type of the target</param>
 /// <param name="dependencyProperty">Dependency property.</param>
 /// <param name="OnDependencyPropertyChanged">Dependency property changed callback</param>
 public ObservableDependencyProperty(Type targetType,
     DependencyProperty dependencyProperty,
     DependencyPropertyChangedEventHandler OnDependencyPropertyChanged)
 {
     _descriptor = DependencyPropertyDescriptor.FromProperty(dependencyProperty, targetType);
     _dependencyProperty = dependencyProperty;
     _onDependencyPropertyChanged = OnDependencyPropertyChanged;
 }
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="source">The DependencyObject instance on which we want to monitor the property</param>
 /// <param name="name">The PropertyPath to the property we want to monitor</param>
 /// <param name="handler">The handler to invoke when the property changed</param>
 public BindingSubscription(DependencyObject source, string name, DependencyPropertyChangedEventHandler handler)
 {
     this.Handler = handler;
     this.source = source;
     binding = new Binding(name) { Source = source };
     this.PropertyPath = name;
     BindingOperations.SetBinding(this, ValueProperty, binding);
 }
示例#16
0
        public PortsList()
        {
            InitializeComponent();

            DataContextChanged += new DependencyPropertyChangedEventHandler(PortsList_DataContextChanged);

            SetupPorts();
        }
        public NewAssignmentTypeDialog()
        {
            DataContextChanged += new DependencyPropertyChangedEventHandler(CreateAssignmentTypeView_DataContextChanged);
            Unloaded += new RoutedEventHandler(CreateAssignmentTypeView_Unloaded);
            InitializeComponent();


        }
 public static void RemovePropertyChanged(DependencyProperty dp, DependencyObjectType type,
                                          DependencyPropertyChangedEventHandler handler)
 {
     var hcpm = dp.GetMetadata(type) as HandleChangesPropertyMetadata;
     if (hcpm == null)
         throw new ArgumentException();
     hcpm.RemovePropertyChanged(type, handler);
 }
 protected virtual void Dispose(bool disposing)
 {
     if (disposing)
     {
         this._eventHandler = null;
         BindingOperations.SetBinding(this, ValueProperty, new Binding());
     }
 }
示例#20
0
		public EditorPresenter()
		{
			IsKeyboardFocusWithinChanged += new DependencyPropertyChangedEventHandler(OnEditorIsKeyboardFocusWithinChanged);
			LostKeyboardFocus += new KeyboardFocusChangedEventHandler(OnEditorLostKeyboardFocus);
			LayoutUpdated += new EventHandler(OnEditorLayoutUpdated);
			KeyDown += new KeyEventHandler(OnEditorKeyDown);
			FocusVisualStyle = null;
			IsTabStop = false;
		}
示例#21
0
 /// <summary>Attaches the end handler.</summary>
 /// <param name="endHandler">The end handler.</param>
 public static void AttachEndHandler(DependencyPropertyChangedEventHandler endHandler)
 {
     endEventHandler += endHandler;
     if (view != null && !view.IsVisible)
     {
         endEventHandler(null, new DependencyPropertyChangedEventArgs());
         endEventHandler = null;
     }
 }
示例#22
0
文件: TabItem.cs 项目: dfr0/moon
 /// <summary>
 /// Default TabItem Constructor
 /// </summary>
 public TabItem() : base()
 {
     MouseLeftButtonDown += new MouseButtonEventHandler(OnMouseLeftButtonDown);
     MouseEnter += new MouseEventHandler(OnMouseEnter);
     MouseLeave += new MouseEventHandler(OnMouseLeave);
     GotFocus += delegate { IsFocused = true; };
     LostFocus += delegate { IsFocused = false; };
     IsEnabledChanged += new DependencyPropertyChangedEventHandler(OnIsEnabledChanged);
     DefaultStyleKey = typeof(TabItem);
 }
示例#23
0
        public dynWorkspaceView()
        {
            InitializeComponent();

            selectionCanvas.Loaded += new RoutedEventHandler(selectionCanvas_Loaded);
            DataContextChanged += new DependencyPropertyChangedEventHandler(dynWorkspaceView_DataContextChanged);

            this.Loaded += new RoutedEventHandler(dynWorkspaceView_Loaded);
            this.LayoutUpdated += new EventHandler(dynWorkspaceView_LayoutUpdated);
        }
 public PuzzleControl()
 {
     InitializeComponent();
     IsMain = false;
     rctTarget.Visibility = Visibility.Hidden;
     DataContextChanged += new DependencyPropertyChangedEventHandler(PuzzleControl_DataContextChanged);
     PreviewDragOver += new DragEventHandler(PuzzleControl_PreviewDragOver);
     PreviewDragLeave += new DragEventHandler(PuzzleControl_PreviewDragLeave);
     PreviewDrop += new DragEventHandler(PuzzleControl_PreviewDrop);
 }
    public WaterBodyView()
    {
      InitializeComponent();
      GWBoundaries.SelectionChanged += new SelectionChangedEventHandler(Boundaries_SelectionChanged);
      SinksBoundary.SelectionChanged += new SelectionChangedEventHandler(Boundaries_SelectionChanged);
      SourcesBoundary.SelectionChanged += new SelectionChangedEventHandler(Boundaries_SelectionChanged);
      LakeImage.MouseUp += new MouseButtonEventHandler(LakeImage_MouseUp);

      DataContextChanged += new DependencyPropertyChangedEventHandler(WaterBodyView_DataContextChanged);

    }
示例#26
0
        public ProductionControl()
        {
            InitializeComponent();

            IsVisibleChanged += new DependencyPropertyChangedEventHandler(ProductionControl_IsVisibleChanged);

            btnUpdate.Click += new RoutedEventHandler(btnUpdate_Click);

            pnlProductionLineRecords.DataContext = lineRecords;
            pnlProductionRecords.DataContext = lineRecords;
        }
示例#27
0
        /// <summary>
        /// Initializes a new instance of the <see cref="TagBack"/> class.
        /// </summary>
        public TagBack()
        {
            InitializeComponent();

            FeedItem feedItem = DataContext as FeedItem;

            Resources["TagBackThemeColor"] = Settings.Default.NewsThemeColor;
            Resources["TagBackForegroundColor"] = Settings.Default.NewsForegroundColor;

            DataContextChanged += new DependencyPropertyChangedEventHandler(TagBack_DataContextChanged);
        }
示例#28
0
        public dynWorkspaceView()
        {
            InitializeComponent();

            selectionCanvas.Loaded += new RoutedEventHandler(selectionCanvas_Loaded);
            DataContextChanged += new DependencyPropertyChangedEventHandler(dynWorkspaceView_DataContextChanged);

            // Make new Watch3DFullscreenViewModel
            // Make new Watch3DFullscreenView(input: viewmodel)
            // attach to bench through mainGrid

            // dynSettings.Bench.sidebarGrid.Children.Add(search);
        }
示例#29
0
        /// <summary>
        /// Adds the data context changed handler.
        /// </summary>
        /// <param name="element">Element to which the handler is added.</param>
        /// <param name="handler">The handler to add.</param>
        /// <exception cref="ArgumentNullException">The <paramref name="element"/> is <c>null</c>.</exception>
        /// <exception cref="ArgumentNullException">The <paramref name="handler"/> is <c>null</c>.</exception>
        public static void AddDataContextChangedHandler(this FrameworkElement element, DependencyPropertyChangedEventHandler handler)
        {
            Argument.IsNotNull("element", element);
            Argument.IsNotNull("handler", handler);

            if (element.GetValue(InheritedDataContextProperty) == null)
            {
                element.SetBinding(InheritedDataContextProperty, new Binding());
            }

            var currentHandler = (DependencyPropertyChangedEventHandler)element.GetValue(DataContextChangedHandlerProperty);
            currentHandler += handler;
            element.SetValue(DataContextChangedHandlerProperty, currentHandler);
        }
示例#30
0
        void IObservableDependencyObject.AttachPropertyChangedHandler(
            string propertyName,
            DependencyPropertyChangedEventHandler handler)
        {
            List<DependencyPropertyChangedEventHandler> handlers;

            if (!this.propertyChangedHandlers.TryGetValue(propertyName, out handlers))
            {
                handlers = new List<DependencyPropertyChangedEventHandler>();
                this.propertyChangedHandlers.Add(propertyName, handlers);
            }

            handlers.Add(handler);
        }
示例#31
0
        public SMSMessage()
        {
            InitializeComponent();
            DataContextChanged += new DependencyPropertyChangedEventHandler(SMSMessage_DataContextChanged);
            text = textMessage.Child <TextBox>();
            text.TextWrapping = TextWrapping.WrapWithOverflow;
            text.TextChanged += new TextChangedEventHandler(SMSMessage_TextChanged);
            BrushConverter bc = new BrushConverter();

            greenBrush     = (Brush)bc.ConvertFromString("Green");
            redBrush       = (Brush)bc.ConvertFromString("Red");
            pinkBackground = new LinearGradientBrush(new GradientStopCollection
            {
                new GradientStop(Color.FromRgb(255, 237, 237), 0),
                new GradientStop(Color.FromRgb(255, 231, 231), 0.527),
                new GradientStop(Color.FromRgb(255, 204, 204), 1)
            }, new Point(0.5, 1), new Point(0.5, 0));
            normalBackGround = text.Background;
            SetReadOnly();
            VisualCharactersToEnd();
        }
示例#32
0
 private void TryFocusElement()
 {
     if (this.AllowFocusElement && !System.ComponentModel.DesignerProperties.GetIsInDesignMode(this))
     {
         var elementToFocus = FocusedElement ?? this.FindChildren <UIElement>().FirstOrDefault(c => c.Focusable);
         if (this.ShowCloseButton && this.closeButton != null && elementToFocus == null)
         {
             this.closeButton.Focusable = true;
             elementToFocus             = this.closeButton;
         }
         if (elementToFocus != null)
         {
             DependencyPropertyChangedEventHandler eh = null;
             eh = (sender, args) => {
                 elementToFocus.IsVisibleChanged -= eh;
                 var focused = elementToFocus.Focus();
             };
             elementToFocus.IsVisibleChanged += eh;
         }
     }
 }
示例#33
0
        public ProjectsView()
        {
            InitializeComponent();

            if (DataContext is ProjectsViewModel)
            {
                _viewModel = DataContext as ProjectsViewModel;

                Control createProjectControl = CreateCpControl();
                currentUserProjectsContainer.Children.Add(createProjectControl);

                SubscribeToViewModelEvents();

                RefreshShowErrorMessageDialogVisibility();
                RefreshCreateNewProjectDialogVisibility();
            }
            else
            {
                DataContextChanged += new DependencyPropertyChangedEventHandler(DataContextChangedEventHandler);
            }
        }
        /// <summary>
        /// Register for all text changed events
        /// </summary>
        public FilteringDataGrid()
        {
            // Initialize lists
            columnFilters     = new Dictionary <string, string>();
            columnFilterModes = new Dictionary <string, Filterer>();
            propertyCache     = new Dictionary <string, PropertyInfo>();

            // Enable Filtering
            AddHandler(TextBox.TextChangedEvent, new TextChangedEventHandler(OnTextChanged), true);
            AddHandler(ComboBox.SelectionChangedEvent, new SelectionChangedEventHandler(OnSelectionChanged2), true);
            // Enable Multisort
            Sorting += FilteringDataGrid_Sorting;

            // Clear the cache if we bind a new collection
            DataContextChanged += new DependencyPropertyChangedEventHandler(FilteringDataGrid_DataContextChanged);

            //Set up context menus
            ContextMenuOpening += FilteringDataGrid_ContextMenuOpening;

            AutoGeneratingColumn += FilteringDataGrid_AutoGeneratingColumn;
        }
示例#35
0
        private static void OpenPopup(object sender, RoutedEventArgs e)
        {
            FrameworkElement Sender = (FrameworkElement)sender;
            DependencyPropertyChangedEventHandler VisibleChanged = null;

            Popup Popup = AtrEditorHelper.GetAttachPopupToImage(Sender);

            VisibleChanged = (placementTarget, _) =>
            {
                // ReSharper disable once AccessToModifiedClosure
                ((FrameworkElement)placementTarget).IsVisibleChanged -= VisibleChanged;
                Popup.IsOpen = false;
            };
            Sender.IsVisibleChanged += VisibleChanged;

            Popup.DataContext     = Sender.DataContext;
            Popup.PlacementTarget = Sender;
            Popup.Placement       = PlacementMode.Relative;
            Popup.StaysOpen       = false;
            Popup.IsOpen          = true;
            FocusManager.SetFocusedElement(Popup, Popup.GetVisualDescendantsDepthFirst <IInputElement>().FirstOrDefault());
            e.Handled = true;
        }
        private static void AddDataContextChangedHandler(FrameworkElement element, DependencyPropertyChangedEventHandler handler)
        {
            Contract.Requires(element != null);
            Contract.Requires(handler != null);

            DataContextChanged += handler;

            if (!boundElements.ContainsKey(element))
            {
                element.SetBinding(
                    DataContextInternalProperty,
                    new Binding()
                {
                    Mode = BindingMode.OneWay
                });

                boundElements.Add(element, 1);
            }
            else
            {
                boundElements[element]++;
            }
        }
示例#37
0
        public TimeNumberInquirerResultPresenter()
        {
            InitializeComponent();

            DataContextChanged += new DependencyPropertyChangedEventHandler((csender, ce) =>
            {
                vm = (TimeNumberInquirerResultPresenterViewModel)DataContext;

                vm.PropertyChanged += new PropertyChangedEventHandler((sender, e) =>
                {
                    switch (e.PropertyName)
                    {
                    case nameof(this.vm.CurrentTextBox):
                        TextBox textBox = FindName(this.vm.CurrentTextBox.ToString()) as TextBox;
                        if (textBox != null)
                        {
                            textBox.Focus();
                        }
                        break;
                    }
                });
            });
        }
 private void myNavigationPaneButton_Click(object sender, RoutedEventArgs e)
 {
     if (myNavigationPaneControl.Parent == null)
     {
         Grid grid = (Grid)this.Parent;
         grid.Children.Add(myNavigationPaneControl);
         myNavigationPaneControl.SetValue(Grid.ColumnSpanProperty, 3);
         myNavigationPaneControl.SetValue(Grid.RowSpanProperty, 2);
         myNavigationPaneControl.HorizontalAlignment = HorizontalAlignment.Left;
         myNavigationPaneControl.VerticalAlignment   = VerticalAlignment.Top;
         myNavigationPaneControl.Visibility          = Visibility.Hidden;
         if (dockPanel == null)
         {
             dockPanel = (DockPanel)(((Border)grid.Parent).Parent);
         }
         if (mbEventHandler == null)
         {
             mbEventHandler = new MouseButtonEventHandler(dockPanel_PreviewMouseLeftButtonUp);
         }
         if (visibilityEventHandler == null)
         {
             visibilityEventHandler = new DependencyPropertyChangedEventHandler(myNavigationPaneControl_IsVisibleChanged);
         }
     }
     if (myNavigationPaneControl.Visibility == Visibility.Hidden)
     {
         myNavigationPaneButton.SetValue(Button.BackgroundProperty, (Brush)MyApp.Current.Resources["MyOrangeSolidBrush"]);
         myNavigationPaneControl.Margin            = new Thickness(27, 32, 0, 0);
         myNavigationPaneControl.Visibility        = Visibility.Visible;
         dockPanel.PreviewMouseLeftButtonUp       += mbEventHandler;
         myNavigationPaneControl.IsVisibleChanged += visibilityEventHandler;
     }
     else
     {
         hideNavigationPane();
     }
 }
示例#39
0
        /// <summary>
        /// Adds the data context changed handler.
        /// </summary>
        /// <param name="element">Element to which the handler is added.</param>
        /// <param name="handler">The handler to add.</param>
        /// <exception cref="ArgumentNullException">The <paramref name="element"/> is <c>null</c>.</exception>
        /// <exception cref="ArgumentNullException">The <paramref name="handler"/> is <c>null</c>.</exception>
        public static void AddDataContextChangedHandler(this FrameworkElement element, DependencyPropertyChangedEventHandler handler)
        {
            Argument.IsNotNull("element", element);
            Argument.IsNotNull("handler", handler);

            if (element.GetValue(InheritedDataContextProperty) == null)
            {
                element.SetBinding(InheritedDataContextProperty, new Binding());
            }

            var currentHandler = (DependencyPropertyChangedEventHandler)element.GetValue(DataContextChangedHandlerProperty);

            currentHandler += handler;
            element.SetValue(DataContextChangedHandlerProperty, currentHandler);
        }
 public TuottajatView()
 {
     InitializeComponent();
     DataContextChanged += new DependencyPropertyChangedEventHandler(View_DataContextChanged);
 }
示例#41
0
 public BaseMenuControl()
 {
     IsEnabledChanged += new DependencyPropertyChangedEventHandler(OnEnabledChanged);
     IsEnabled         = true;
     DefaultStyleKey   = this.GetType();
 }
示例#42
0
 public PropertyChangeNotifier(DependencyObject propertySource, DependencyProperty property, DependencyPropertyChangedEventHandler handler)
     : this(propertySource, property)
 {
     this.ValueChanged += handler;
 }
示例#43
0
 public static IEnumerable <PropertyChangeNotifier> GetNotifiers(DependencyObject propertySource, IEnumerable <DependencyProperty> properties, DependencyPropertyChangedEventHandler handler)
 {
     foreach (var property in properties)
     {
         var notifier = new PropertyChangeNotifier(propertySource, property, handler);
         yield return(notifier);
     }
 }
示例#44
0
 public static bool IsRegistered(this DependencyPropertyChangedEventHandler handler, Delegate prospectiveHandler)
 {
     return(handler.IsEventHandlerRegistered(prospectiveHandler));
 }
示例#45
0
 public ChangeMetaData()
 {
     InitializeComponent();
     DataContextChanged += new DependencyPropertyChangedEventHandler(ChangeMetaData_DataContextChanged);
 }
示例#46
0
 public SignUp()
 {
     InitializeComponent();
     DataContextChanged += new DependencyPropertyChangedEventHandler(DataContextChangedEventHandler);
 }
示例#47
0
 public TabElaboraciones()
 {
     InitializeComponent();
     IsVisibleChanged += new DependencyPropertyChangedEventHandler(MyControl_IsVisibleChanged);
 }
示例#48
0
 public static IDisposable WatchProperty(this DependencyObject target,
                                         string propertyPath,
                                         DependencyPropertyChangedEventHandler handler)
 {
     return(new DependencyPropertyWatcher(target, propertyPath, handler));
 }
示例#49
0
        protected override void OnAttached()
        {
            var control = Control as Panel;

            if (control != null)
            {
                System.Windows.Controls.Image image = null;

                var effect = new BlurEffect
                {
                    Radius        = 5,
                    KernelType    = KernelType.Box,
                    RenderingBias = RenderingBias.Performance
                };

                window = System.Windows.Application.Current.MainWindow;

                var dpiX = 96; //(int)typeof(SystemParameters).GetProperty("DpiX", BindingFlags.NonPublic | BindingFlags.Static).GetValue(null, null);
                var dpiY = 96; //(int)typeof(SystemParameters).GetProperty("Dpi", BindingFlags.NonPublic | BindingFlags.Static).GetValue(null, null);

                var renderer = new RenderTargetBitmap((int)window.Width, (int)window.Height, dpiX, dpiY, PixelFormats.Pbgra32);

                visibleChanged = (s, e) =>
                {
                    if (control.IsVisible)
                    {
                        control.Children.Remove(image);
                        var children = control.Children.Cast <UIElement>().ToArray();
                        control.Children.Clear();

                        image         = new System.Windows.Controls.Image();
                        image.Effect  = effect;
                        image.Stretch = Stretch.Fill;
                        image.Source  = renderer;
                        renderer.Render(window);

                        control.Children.Add(image);
                        foreach (var c in children)
                        {
                            control.Children.Add(c);
                        }

                        image.Width  = window.Width;
                        image.Height = window.Height;
                        image.Measure(new System.Windows.Size(double.PositiveInfinity, double.PositiveInfinity));
                        image.Arrange(new Rect(image.DesiredSize));
                    }
                };

                control.IsVisibleChanged += visibleChanged;

                sizeChanged = (s, e) =>
                {
                    if (control.IsVisible && image != null)
                    {
                        image.Width  = window.Width;
                        image.Height = window.Height;
                        image.Measure(new System.Windows.Size(double.PositiveInfinity, double.PositiveInfinity));
                        image.Arrange(new Rect(image.DesiredSize));
                    }
                    else
                    {
                        renderer = new RenderTargetBitmap((int)window.Width, (int)window.Height, dpiX, dpiY, PixelFormats.Pbgra32);
                    }
                };

                window.SizeChanged += sizeChanged;
            }
        }
示例#50
0
 public void Dispose()
 {
     _handler = null;
     // There is no ClearBinding method, so set a dummy binding instead
     BindingOperations.SetBinding(this, ValueProperty, new Binding());
 }
 public MasterPasswordEntryView()
 {
     DataContextChanged += new DependencyPropertyChangedEventHandler(OnDataContextChanged);
     InitializeComponent();
 }
示例#52
0
 public BusyIndicator()
 {
     Focusable           = false;
     DataContextChanged += new DependencyPropertyChangedEventHandler(BusyIndicatorDataContextChanged);
 }
示例#53
0
        /// <summary>
        /// Removes the data context changed handler.
        /// </summary>
        /// <param name="element">The element from which the handler has to be removed.</param>
        /// <param name="handler">The handler to remove.</param>
        /// <exception cref="ArgumentNullException">The <paramref name="element"/> is <c>null</c>.</exception>
        /// <exception cref="ArgumentNullException">The <paramref name="handler"/> is <c>null</c>.</exception>
        public static void RemoveDataContextChangedHandler(this FrameworkElement element, DependencyPropertyChangedEventHandler handler)
        {
            Argument.IsNotNull("element", element);
            Argument.IsNotNull("handler", handler);

            var currentHandler = (DependencyPropertyChangedEventHandler)element.GetValue(DataContextChangedHandlerProperty);

            currentHandler -= handler;
            if (currentHandler == null)
            {
                element.ClearValue(DataContextChangedHandlerProperty);
                element.ClearValue(InheritedDataContextProperty);
            }
            else
            {
                element.SetValue(DataContextChangedHandlerProperty, currentHandler);
            }
        }
 public NumberEditor()
 {
     SpecialInitializeComponent();
     DataContextChanged += new DependencyPropertyChangedEventHandler(NumberEditor_DataContextChanged);
 }
示例#55
0
 public DEMSourceDialog()
 {
     InitializeComponent();
     DataContextChanged += new DependencyPropertyChangedEventHandler(DEMSourceDialog_DataContextChanged);
 }
示例#56
0
 public PlantView()
 {
     InitializeComponent();
     DataContextChanged += new DependencyPropertyChangedEventHandler(PlantView_DataContextChanged);
     Loaded             += new RoutedEventHandler(PlantView_Loaded);
 }
示例#57
0
 private void SetupEventHandlers()
 {
     Loaded             += ElementFlow_Loaded;
     DataContextChanged += new DependencyPropertyChangedEventHandler(ElementFlow_DataContextChanged);
 }
示例#58
0
 public AutoGrayImage()
 {
     IsEnabledChanged += new DependencyPropertyChangedEventHandler(AutoGrayImage_IsEnabledChanged);
 }
示例#59
0
        public PlayNextEpisodeControlV2()
        {
            InitializeComponent();

            DataContextChanged += new DependencyPropertyChangedEventHandler(PlayNextEpisodeControlV2_DataContextChanged);
        }
示例#60
0
 /// <summary>
 /// Конструктор с параметрами
 /// </summary>
 /// <param name="senderTextboxText"></param>
 /// <param name="recipientTextboxText"></param>
 /// <param name="titleTextboxText"></param>
 public MessageCreator()
 {
     InitializeComponent();
     DataContextChanged += new DependencyPropertyChangedEventHandler(OnMessageCreatorDataContextChanged);
 }