Beispiel #1
0
        private void FireVisualStateChanged(VisualStateChangedEventArgs e)
        {
            if (_visualStateChanged != null)
            {
                //NOTE: don't use EventsHelper because it will use DynamicInvoke.
                try
                {
                    _visualStateChanged(this, e);
                }
                catch (Exception ex)
                {
                    Platform.Log(LogLevel.Error, ex);
                    throw;
                }
            }

            var parentGraphic = ParentGraphic as Graphic;

            if (parentGraphic != null)
            {
                parentGraphic.ForwardVisualStateChanged(e);
            }
        }
		private void OnTextVisualStateChanged(object sender, VisualStateChangedEventArgs e)
		{
			switch (e.PropertyName)
			{
				case "Text":
					this.OnTextChanged();
					break;
				case "Location":
					this.OnTextLocationChanged();
					break;
			}
		}
		private void OnGraphicVisualStateChanged(object sender, VisualStateChangedEventArgs e)
		{
			base.NotifyVisualStateChanged(e);
		}
Beispiel #4
0
		/// <summary>
		/// Forwards the <see cref="VisualStateChanged"/> event from a child graphic to listeners of a parent graphic.
		/// </summary>
		/// <param name="e">Data for the <see cref="VisualStateChanged"/> event.</param>
		internal void NotifyVisualStateChanged(VisualStateChangedEventArgs e)
		{
			if(e.Graphic == this)
				this.OnVisualStateChanged(e.PropertyName);
			EventsHelper.Fire(_visualStateChanged, this, e);
		}
Beispiel #5
0
 private void OnGraphicVisualStateChanged(object sender, VisualStateChangedEventArgs e)
 {
     base.NotifyVisualStateChanged(e);
 }
		private void OnSubjectVisualStateChanged(object sender, VisualStateChangedEventArgs e)
		{
			this.SuspendControlPointEvents();
			this.CoordinateSystem = CoordinateSystem.Source;
			try
			{
				base.ControlPoints.Clear();
				if (string.IsNullOrEmpty(this.Subject.Text))
				{
					base.ControlPoints.Add(this.Subject.Location);
				}
			}
			finally
			{
				this.ResetCoordinateSystem();
				this.ResumeControlPointEvents();
			}
		}
		private void OnSubjectVisualStateChanged(object sender, VisualStateChangedEventArgs e)
		{
			if (_notifyOnSubjectChanged)
				OnSubjectChanged(e.PropertyKind);
		}
Beispiel #8
0
				private void DecoratedGraphic_VisualStateChanged(object sender, VisualStateChangedEventArgs e)
				{
					base.DecoratedGraphic.CoordinateSystem = CoordinateSystem.Destination;
					_textGraphic.CoordinateSystem = CoordinateSystem.Destination;
					try
					{
						RectangleF rectangle = base.DecoratedGraphic.BoundingBox;
						_textGraphic.Location = new PointF(rectangle.Right, rectangle.Top);
					}
					finally
					{
						_textGraphic.ResetCoordinateSystem();
						base.DecoratedGraphic.ResetCoordinateSystem();
					}
				}
Beispiel #9
0
		private void FireVisualStateChanged(VisualStateChangedEventArgs e)
		{
			if (_visualStateChanged != null)
			{
	            //NOTE: don't use EventsHelper because it will use DynamicInvoke.
	            try
	            {
	                _visualStateChanged(this, e);
	            }
	            catch (Exception ex)
	            {
	                Platform.Log(LogLevel.Error, ex);
	                throw;
	            }
			}

			var parentGraphic = ParentGraphic as Graphic;
			if (parentGraphic != null)
				parentGraphic.ForwardVisualStateChanged(e);
        }
Beispiel #10
0
		/// <summary>
		/// Forwards the <see cref="VisualStateChanged"/> event from a child graphic to listeners of a parent graphic.
		/// </summary>
		/// <param name="e">Data for the <see cref="VisualStateChanged"/> event.</param>
		private void ForwardVisualStateChanged(VisualStateChangedEventArgs e)
		{
			if (ReferenceEquals(e.Graphic, this))
				OnVisualStateChanged(e.PropertyName);
			FireVisualStateChanged(e);
		}
			private void OnSubjectVisualStateChanged(object sender, VisualStateChangedEventArgs e)
			{
				if (!(sender is ICalloutGraphic || e.Graphic is ICalloutGraphic))
				{
					if (e.PropertyKind == VisualStatePropertyKind.Geometry || e.PropertyKind == VisualStatePropertyKind.Unspecified)
						OnSubjectChanged();
				}
			}
Beispiel #12
0
		private void OnSubjectVisualStateChanged(object sender, VisualStateChangedEventArgs e)
		{
			if (_notifyOnSubjectChanged)
			{
			    /// TODO (CR Sep 2011): If the subject is an arbitrary object, why are we doing this?
				if(e.PropertyName != "Color" && e.PropertyName != "LineStyle")
					this.OnSubjectChanged();
			}
		}
Beispiel #13
0
		/// <summary>
		/// Forwards the <see cref="VisualStateChanged"/> event from a child graphic to listeners of a parent graphic.
		/// </summary>
		/// <param name="e">Data for the <see cref="VisualStateChanged"/> event.</param>
		internal void NotifyVisualStateChanged(VisualStateChangedEventArgs e)
		{
			if (ReferenceEquals(e.Graphic, this))
				OnVisualStateChanged(e.PropertyName);
			EventsHelper.Fire(_visualStateChanged, this, e);
		}