Ejemplo n.º 1
0
        static LinearDimension()
        {
            FlowDirectionProperty.AddOwner(
                typeof(LinearDimension),
                new FrameworkPropertyMetadata(
                    default(FlowDirection),
                    FrameworkPropertyMetadataOptions.AffectsMeasure,
                    OnFlowDirectionChanged));

            P1Property.AddOwner(
                typeof(LinearDimension),
                new FrameworkPropertyMetadata(
                    new Point(double.NaN, double.NaN),
                    FrameworkPropertyMetadataOptions.AffectsMeasure,
                    OnP1Changed));
            P2Property.AddOwner(
                typeof(LinearDimension),
                new FrameworkPropertyMetadata(
                    new Point(double.NaN, double.NaN),
                    FrameworkPropertyMetadataOptions.AffectsMeasure,
                    OnP2Changed));

            OffsetPointProperty.AddOwner(
                typeof(LinearDimension),
                new FrameworkPropertyMetadata(
                    new Point(double.NaN, double.NaN),
                    FrameworkPropertyMetadataOptions.AffectsMeasure,
                    OnOffsetPointChanged));

            OffsetProperty.AddOwner(
                typeof(LinearDimension),
                new FrameworkPropertyMetadata(
                    12.0,
                    FrameworkPropertyMetadataOptions.AffectsMeasure,
                    OnOffsetChanged));

            OffsetDirectionProperty.AddOwner(
                typeof(LinearDimension),
                new FrameworkPropertyMetadata(
                    new Vector(double.NaN, double.NaN),
                    FrameworkPropertyMetadataOptions.AffectsMeasure,
                    OnOffsetDirectionChanged));

            ScaleProperty.AddOwner(
                typeof(LinearDimension),
                new FrameworkPropertyMetadata(
                    1.0,
                    FrameworkPropertyMetadataOptions.AffectsMeasure | FrameworkPropertyMetadataOptions.AffectsRender,
                    OnScaleChanged));

            DefaultStyleKeyProperty.OverrideMetadata(
                typeof(LinearDimension),
                new FrameworkPropertyMetadata(typeof(LinearDimension)));
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Static constructor
        /// </summary>
        static RibbonWindow()
        {
            StyleProperty.OverrideMetadata(typeof(RibbonWindow), new FrameworkPropertyMetadata(null, OnCoerceStyle));
            DefaultStyleKeyProperty.OverrideMetadata(typeof(RibbonWindow), new FrameworkPropertyMetadata(typeof(RibbonWindow)));

            if (FrameworkHelper.PresentationFrameworkVersion < new Version("4.0"))
            {
                // On older versions of the framework the client size of the window is incorrectly calculated.
                TemplateProperty.AddOwner(typeof(RibbonWindow), new FrameworkPropertyMetadata(OnWindowPropertyChangedThatRequiresTemplateFixup));
                FlowDirectionProperty.AddOwner(typeof(RibbonWindow), new FrameworkPropertyMetadata(OnWindowPropertyChangedThatRequiresTemplateFixup));
            }

            // Register commands
            CommandManager.RegisterClassCommandBinding(typeof(RibbonWindow), new CommandBinding(CloseCommand, OnCloseCommandExecuted));
            CommandManager.RegisterClassCommandBinding(typeof(RibbonWindow), new CommandBinding(MinimizeCommand, OnMinimizeCommandExecuted));
            CommandManager.RegisterClassCommandBinding(typeof(RibbonWindow), new CommandBinding(MaximizeCommand, OnMaximizeCommandExecuted));
            CommandManager.RegisterClassCommandBinding(typeof(RibbonWindow), new CommandBinding(NormalizeCommand, OnNormalizeCommandExecuted));
        }
Ejemplo n.º 3
0
 set => SetValue(FlowDirectionProperty, value);
Ejemplo n.º 4
0
 static PivotHeaderScrollViewer()
 {
     FlowDirectionProperty.OverrideMetadata(typeof(PivotHeaderScrollViewer), new FrameworkPropertyMetadata(OnFlowDirectionChanged));
     HorizontalScrollBarVisibilityProperty.OverrideMetadata(typeof(PivotHeaderScrollViewer), new FrameworkPropertyMetadata(OnHorizontalScrollBarVisibilityChanged));
 }