コード例 #1
0
            bool TryToHandleDProperty(Assignment context)
            {
                var attributeName  = context.Name;
                var attributeValue = context.Value;

                // BOA.UI.EditorBase.LabelWidthProperty
                if (attributeName.Contains('.')) // dependency property
                {
                    var dp = BuilderUtility.SearchDependencyProperty(attributeName, TypeFinder);
                    if (dp == null)
                    {
                        throw Errors.DependencyPropertyNotFound(attributeName);
                    }

                    attributeValue = BuilderUtility.NormalizeValueForType(attributeValue, dp.PropertyType);

                    View.SetValue(dp, attributeValue);

                    return(true);
                }

                return(false);
            }
コード例 #2
0
ファイル: BuilderTest.cs プロジェクト: WildGenie/WhiteStone
 public void SearchDependencyProperty()
 {
     Assert.IsNotNull(BuilderUtility.SearchDependencyProperty("System.Windows.FrameworkElement.WidthProperty", new TypeFinder()));
     Assert.IsNotNull(BuilderUtility.SearchDependencyProperty(this.GetType().FullName + ".TestPropertyNullableInt32Property", new TypeFinder()));
 }