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 ZoomFactorChanged(NoteViewer control, double oldValue, double newValue)
 {
     control.InvalidateMeasure();
 }
        private static void SelectedElementChanged(DependencyObject obj, DependencyPropertyChangedEventArgs args)
        {
            NoteViewer viewer = (NoteViewer)obj;

            viewer.Select(args.NewValue as MusicalSymbol);
        }
 private static void CurrentPageChanged(NoteViewer control, int oldValue, int newValue)
 {
     control.RenderOnCanvas(control.InnerScore);
 }