コード例 #1
0
        // Static constructor.
        static TropicalAquarium()
        {
            // Create a new metadata instance with a modified default value.
            FrameworkPropertyMetadata newPropertyMetadata = new(
                defaultValue : new Uri("http://www.contoso.com/tropical-aquarium-graphic.jpg"));

            // Call OverrideMetadata on the dependency property identifier.
            // Pass in the type for which the new metadata will be applied
            // and the new metadata instance.
            AquariumGraphicProperty.OverrideMetadata(
                forType: typeof(TropicalAquarium),
                typeMetadata: newPropertyMetadata);
        }
コード例 #2
0
ファイル: Class1.cs プロジェクト: ruo2012/samples-1
 static Fish()
 {
     AquariumGraphicProperty.OverrideMetadata(typeof(Fish), new FrameworkPropertyMetadata(new System.Uri("fish.gif", UriKind.RelativeOrAbsolute), FrameworkPropertyMetadataOptions.AffectsRender));
 }
コード例 #3
0
 set => SetValue(AquariumGraphicProperty, value);