private static void RenderingModeChanged(NoteViewer control, ScoreRenderingModes oldValue, ScoreRenderingModes newValue)
 {
     if (control.InnerScore == null)
     {
         return;
     }
     control.RenderOnCanvas(control.InnerScore);
 }
        private static void ScoreSourceChanged(NoteViewer control, Score oldValue, Score newValue)
        {
            if (oldValue != null)
            {
                oldValue.Safety.BoundControl = null;
            }
            Score.SanityCheck(newValue, control);

            control.RenderOnCanvas(newValue);
        }
        private static void XmlSourceChanged(NoteViewer contol, string oldValue, string newValue)
        {
            XDocument xmlDocument = XDocument.Parse(newValue);

            //Apply transformations:
            if (contol.XmlTransformations != null)
            {
                foreach (var transformation in contol.XmlTransformations)
                {
                    xmlDocument = transformation.Parse(xmlDocument);
                }
            }

            MusicXmlParser parser = new MusicXmlParser();
            var            score  = parser.Parse(xmlDocument);

            contol.RenderOnCanvas(score);
        }
        private static void PlaybackCursorPositionChanged(NoteViewer control, PlaybackCursorPosition oldValue, PlaybackCursorPosition newValue)
        {
            if (control.InnerScore == null)
            {
                return;
            }
            if (control.Renderer == null)
            {
                return;
            }

            if (!newValue.IsValid)
            {
                return;
            }

            control.Dispatcher.RunAsync(CoreDispatcherPriority.Low, () => control.Renderer.DrawPlaybackCursor(newValue));
        }
 public UWPDispatcherCanvasScoreRenderer(Canvas canvas, UWPScoreRendererSettings rendererSettings, NoteViewer control) : base(canvas, rendererSettings)
 {
     this.control = control;
 }
 private static void ZoomFactorChanged(NoteViewer control, double oldValue, double newValue)
 {
     control.InvalidateMeasure();
 }
 private static void CurrentPageChanged(NoteViewer control, int oldValue, int newValue)
 {
     control.RenderOnCanvas(control.InnerScore);
 }
 public DispatcherCanvasScoreRenderer(Canvas canvas, NoteViewer control) : base(canvas)
 {
     this.control = control;
 }