Exemple #1
0
        private void BindTemplate(OneNote.IApplication application)
        {
            var template = PageTemplate;

            if (template != null)
            {
                UnbindTemplate(template);
            }

            var model = PageSettings;

            template            = TemplateFactory.CreatePageTemplate(application);
            model.ColorChanged += template.ChangeColor;
            model.RuleLinesHorizontalColorChanged +=
                template.ChangeRuleLinesHorizontalColor;
            model.RuleLinesHorizontalSpacingChanged +=
                template.ChangeRuleLinesHorizontalSpacing;
            model.RuleLinesMarginColorChanged +=
                template.ChangeRuleLinesMarginColor;
            model.RuleLinesVisibleChanged += template.ChangeRuleLinesVisible;
            model.TitleChanged            += template.ChangeTitle;
            PageTemplate = template;
            Tracer.WriteTraceMethodLine();
        }