Пример #1
0
        static void OnRegionChanged(DependencyObject obj, string oldValue, string newValue)
        {
            BehaviorCollection bCol = Interaction.GetBehaviors(obj);
            UIRegion           serv = bCol.OfType <UIRegion>().FirstOrDefault();

            if (serv != null)
            {
                serv.RegionName = newValue;
                return;
            }
            bCol.Add(new UIRegion()
            {
                RegionName = newValue
            });
        }
Пример #2
0
        static void OnRegionChanged(DependencyObject obj, string oldValue, string newValue)
        {
            BehaviorCollection bCol        = Interaction.GetBehaviors(obj);
            UIRegion           oldUIRegion = bCol.OfType <UIRegion>().FirstOrDefault();

            if (oldUIRegion != null)
            {
                bCol.Remove(oldUIRegion);
            }
            if (!string.IsNullOrEmpty(newValue))
            {
                bCol.Add(new UIRegion()
                {
                    RegionName = newValue
                });
            }
        }
Пример #3
0
 public StrategyOwner(UIRegion owner)
     : base(owner, owner.AssociatedObject)
 {
 }