Exemplo n.º 1
0
 private void _nodeControl_Unselected(object sender, RoutedEventArgs e)
 {
     if (Unselected != null)
     {
         Unselected.Invoke(sender, e);
     }
 }
Exemplo n.º 2
0
 private void ProcessMessage(NotificationMessage message)
 {
     switch (message.Notification)
     {
     case Messages.DoUnselectAll:
         Unselected?.Invoke();
         break;
     }
 }
Exemplo n.º 3
0
        public void SetSelected(bool isSelected, bool FireEvents)
        {
            if (!m_Selectable)
            {
                return;
            }
            if (m_Selected == isSelected)
            {
                return;
            }

            m_Selected = isSelected;

            if (m_Title != null)
            {
                m_Title.ToggleState = m_Selected;
            }

            if (FireEvents)
            {
                if (SelectionChanged != null)
                {
                    SelectionChanged.Invoke(this);
                }

                if (m_TreeControl != null && m_TreeControl.SelectionChanged != null)
                {
                    m_TreeControl.SelectionChanged.Invoke(this);
                }

                if (m_Selected)
                {
                    if (Selected != null)
                    {
                        Selected.Invoke(this);
                    }

                    if (m_TreeControl != null && m_TreeControl.Selected != null)
                    {
                        m_TreeControl.Selected.Invoke(this);
                    }
                }
                else
                {
                    if (Unselected != null)
                    {
                        Unselected.Invoke(this);
                    }

                    if (m_TreeControl != null && m_TreeControl.Unselected != null)
                    {
                        m_TreeControl.Unselected.Invoke(this);
                    }
                }
            }
        }
        private void OnPointerPressed(object sender, PointerRoutedEventArgs e)
        {
            VisualStateManager.GoToState(this, this.IsSelected ? "CheckedPressed" : "Pressed", true);

            this.IsSelected = !this.IsSelected;

            if (this.IsSelected)
            {
                Selected?.Invoke(this, null);
            }
            else
            {
                Unselected?.Invoke(this, null);
            }
        }
        private void OnRollerSelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            if (e.AddedItems.Count == 0)
            {
                Unselected?.Invoke(this, new EventArgs());
                e.Handled = true;
                return;
            }

            var timeSelectorItemModel = e.AddedItems[0] as TimeSelectorItemModel;

            if (timeSelectorItemModel == null)
            {
                return;
            }

            Selected?.Invoke(this, new SelectedDateChangedEventArgs(timeSelectorItemModel.Time));
        }
        private void OnCalendarXItemClicked(object sender, RoutedEventArgs e)
        {
            var calendarXItem      = e.OriginalSource as CalendarXItem;
            var calendarXItemModel = calendarXItem?.DataContext as CalendarXItemModel;

            if (calendarXItemModel == null)
            {
                return;
            }

            if (calendarXItemModel.IsChecked)
            {
                Selected?.Invoke(this, new SelectedDateChangedEventArgs(calendarXItemModel.Date));
            }
            else
            {
                Unselected?.Invoke(this, new SelectedDateChangedEventArgs(calendarXItemModel.Date));
            }
        }
Exemplo n.º 7
0
        public RTDCalendarViewToggleButton()
        {
            DefaultStyleKey = typeof(RTDCalendarViewToggleButton);

            PointerPressed += (s, e) =>
            {
                IsSelected = !IsSelected;

                if (IsSelected)
                {
                    Selected?.Invoke(this, new RoutedEventArgs());
                }
                else
                {
                    Unselected?.Invoke(this, new RoutedEventArgs());
                }
            };

            SizeChanged += (s, e) => UpdateCornerRadius();
        }
Exemplo n.º 8
0
        private void imgMap_MouseUp(object sender, MouseButtonEventArgs e)
        {
            if (e.ChangedButton == MouseButton.Left)
            {
                var p = e.GetPosition(this);

                double horizontalZoom = imgMap.Source.Width / imgMap.ActualWidth;
                double verticalZoom   = imgMap.Source.Height / imgMap.ActualHeight;

                var difH = ActualHeight - imgMap.ActualHeight;
                var difW = ActualWidth - imgMap.ActualWidth;

                double zoom = Math.Min(horizontalZoom, verticalZoom);
                var    x    = (int)Math.Floor((p.X - (difW / 2.0)) * zoom) + Repository.Left;
                var    y    = Repository.Top - (int)Math.Floor((p.Y - (difH / 2.0)) * zoom);
                TileClicked?.Invoke(new TileId(x, y));
            }
            else
            {
                Unselected?.Invoke(this, null);
            }
        }
Exemplo n.º 9
0
 internal void RaiseUnselected()
 {
     Unselected?.Invoke(this, new RoutedEventArgs());
 }
 private void OnUnselected(SelectionChangedEventArgs args)
 {
     Unselected?.Invoke(this, args);
 }
Exemplo n.º 11
0
 protected virtual void OnUnselected(object sender, EventArgs e)
 {
     Unselected?.Invoke(sender, e);
 }