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
            });
        }
Exemple #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
                });
            }
        }
 public StrategyOwner(UIRegion owner)
     : base(owner, owner.AssociatedObject)
 {
 }