コード例 #1
0
ファイル: MeterControl.cs プロジェクト: neilmckg/WPFSynth
        static MeterControl()
        {
            ResourceDictionary dictionary = new ResourceDictionary {
                Source = new Uri("pack://application:,,,/Synth.WPF;component/Controls/ControlResources.xaml")
            };
            ControlTemplate defaultTemplate = (ControlTemplate)dictionary["MeterControlDefaultTemplate"];

            TemplateProperty.OverrideMetadata(typeof(MeterControl), new FrameworkPropertyMetadata(defaultTemplate));
        }
コード例 #2
0
 static LabelControl()
 {
     //DefaultStyleKeyProperty.OverrideMetadata(typeof(LabelControl), new FrameworkPropertyMetadata(typeof(LabelControl)));
     ResDict = new ResourceDictionary {
         Source = new Uri("WPFControlExt;component/LabelControl.res.xaml", UriKind.RelativeOrAbsolute)
     };
     LabelControlTemplate = (ControlTemplate)ResDict["LabelControlTemplate"];
     TemplateProperty.OverrideMetadata(typeof(LabelControl), new FrameworkPropertyMetadata(LabelControlTemplate));
 }
コード例 #3
0
        static KeyboardShortcutBox()
        {
            var res = new ResourceDictionary()
            {
                Source = new Uri("pack://application:,,,/VolumeSwitch;component/View/Theme/KeyboardShortcutBoxTemplate.xaml", UriKind.Absolute)
            };

            TemplateProperty.OverrideMetadata(typeof(KeyboardShortcutBox), new FrameworkPropertyMetadata(res[typeof(KeyboardShortcutBox)]));
        }
コード例 #4
0
        static ViewElement()
        {
            var self = typeof(ViewElement);

            var template = new ControlTemplate(self);

            var contentPresenter = new FrameworkElementFactory(typeof(ContentPresenter));

            contentPresenter.SetValue(ContentPresenter.ContentSourceProperty, "View");

            template.VisualTree = contentPresenter;

            template.Seal();

            TemplateProperty.OverrideMetadata(self, new FrameworkPropertyMetadata(template));
        }
コード例 #5
0
        static BendModPanel()
        {
            ControlTemplate defaultTemplate = GetResource <ControlTemplate>("BendModDefaultTemplate");

            TemplateProperty.OverrideMetadata(typeof(BendModPanel), new FrameworkPropertyMetadata(defaultTemplate));
        }
コード例 #6
0
        static CustomersTreeFilterView()
        {
            ControlTemplate defaultTemplate = new CustomersTreeFilterViewTemplate();

            TemplateProperty.OverrideMetadata(typeof(CustomersTreeFilterView), new System.Windows.FrameworkPropertyMetadata(defaultTemplate));
        }
コード例 #7
0
ファイル: MeteredSlider.cs プロジェクト: neilmckg/WPFSynth
        static MeteredSlider()
        {
            ControlTemplate defaultTemplate = GetResource <ControlTemplate>("MeteredSliderDefaultTemplate");

            TemplateProperty.OverrideMetadata(typeof(MeteredSlider), new FrameworkPropertyMetadata(defaultTemplate));
        }