public StringKeyframeView(TLStringKeyframe kf, StringTrackView trackview) : base(kf, trackview) { //configure svg Background.ReferencedElement = new Uri("#" + Parent.Model.GetID() + "_KF", UriKind.Relative); Background.ID = "bg"; Background.CustomAttributes["class"] = "kf"; Background.MouseDown += Background_MouseDown; Background.MouseUp += Background_MouseUp; Background.MouseMove += Background_MouseMove; Label.FontSize = 12; Label.ID = "label"; Label.CustomAttributes["class"] = "skffont"; Label.Text = "text"; Label.Transforms = new SvgTransformCollection(); Label.Transforms.Add(new SvgScale(1, 1)); Label.Change += Label_Change; CollapsedView.ReferencedElement = new Uri("#" + Parent.Model.GetID() + "_CKF", UriKind.Relative); CollapsedView.ID = "fg"; CollapsedView.CustomAttributes["class"] = "ckf"; CollapsedView.MouseDown += Background_MouseDown; CollapsedView.MouseUp += Background_MouseUp; CollapsedView.MouseMove += Background_MouseMove; }
void Background_MouseClick(object sender, MouseArg e) { if (e.ClickCount >= 2) { var x = FRuler.XPosToTime(e.x); var y = YPosToValue(e.y); var kf = new TLStringKeyframe(x, "text " + Keyframes.Count); var cmd = Command.Add(this.Model.Keyframes, kf); History.Insert(cmd); } }
void Keyframes_Added(IViewableCollection <TLStringKeyframe> collection, TLStringKeyframe item) { //sort the keyframes and assign neighbours SortAndAssignNeighbours(); }
void Background_MouseClick(object sender, MouseArg e) { if(e.ClickCount >= 2) { var x = FRuler.XPosToTime(e.x); var y = YPosToValue(e.y); var kf = new TLStringKeyframe(x, "text " + Keyframes.Count); var cmd = Command.Add(this.Model.Keyframes, kf); History.Insert(cmd); } }
void Keyframes_Added(IViewableCollection<TLStringKeyframe> collection, TLStringKeyframe item) { //sort the keyframes and assign neighbours SortAndAssignNeighbours(); }