コード例 #1
0
ファイル: TagFactory.cs プロジェクト: zhuowp/SMS.Client
        private AreaTag CreateAreaTag(ITagModel tagModel)
        {
            AreaTag tag = new AreaTag();

            SetTagBasePropertyBinding(tag);
            SetLineTextTagBasePropertyBindings(tag);
            SetAreaTagPropertyBindings(tag);

            return(tag);
        }
コード例 #2
0
        private static void OnAreaPointsChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
        {
            AreaTag areaTag = d as AreaTag;

            areaTag.UpdateTagLocationInScreen();
            if (e.OldValue is ObservableCollection <Point> oldCollection)
            {
                oldCollection.CollectionChanged -= areaTag.AreaPointCollection_CollectionChanged;
            }

            if (e.NewValue is ObservableCollection <Point> newCollection)
            {
                newCollection.CollectionChanged += areaTag.AreaPointCollection_CollectionChanged;
            }
        }