Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. WCF and WF
  4. Is this bug in animation? [modified]

Is this bug in animation? [modified]

Scheduled Pinned Locked Moved WCF and WF
helpcsharplinqcomdata-structures
1 Posts 1 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A Offline
    A Offline
    AghaKhan
    wrote on last edited by
    #1

    I have 3 lights and I want they should be placed at some fix positions. So I created a array for location of the lights. readonly Point[] LightLocation = { new Point(50, 50), new Point(300, 50), new Point(550, 50) }; Now if user drags it drop one light to any other light then the previous light animate go to capturing light position. For some reason it does not work. I thought every time when I drop any light I reset all the light, but this also does not work. It looks code is bit long for code block. If someone send me email I will be able to send the code. agha.khan@hotmail.com Agha Khan ;) //// TrafficLight.cs using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Windows; using System.Windows.Controls; using System.Windows.Data; using System.Windows.Documents; using System.Windows.Input; using System.Windows.Media; using System.Windows.Media.Imaging; using System.Windows.Navigation; using System.Windows.Shapes; using System.Windows.Media.Effects; namespace CanvasTest { public class TrafficLight : Canvas { public static readonly DependencyProperty ColorProperty = DependencyProperty.Register("LightColor", typeof(Color), typeof(TrafficLight), new FrameworkPropertyMetadata( Colors.Red, FrameworkPropertyMetadataOptions.AffectsMeasure | FrameworkPropertyMetadataOptions.AffectsRender)); public static readonly DependencyProperty IDProperty = DependencyProperty.Register("LightID", typeof(string), typeof(TrafficLight), new FrameworkPropertyMetadata( "", FrameworkPropertyMetadataOptions.AffectsMeasure | FrameworkPropertyMetadataOptions.AffectsRender)); static readonly Size sizeLight = new Size(130, 130); DrawingVisual Arround = null; DrawingVisual Middle = null; public Color LightColor { set { SetValue(ColorProperty, value); } get { return (Color)GetValue(ColorProperty); } } public string LightID { set { SetValue(IDProperty, value); } get { return (string)GetValue(IDProperty); } } static TrafficLight() { DefaultStyleKeyProperty.OverrideMetadata(typeof(TrafficLight), new FrameworkPropertyMetadata(typeof(TrafficLight))); } public TrafficLight() { Arround = new DrawingVisual(); Middle = new DrawingVisual(); BuildLight(); AddVis

    1 Reply Last reply
    0
    Reply
    • Reply as topic
    Log in to reply
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes


    • Login

    • Don't have an account? Register

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • World
    • Users
    • Groups