private void AddFadeBehavior(View view) { var behavior = new FadeBehavior(); view.Behaviors.Add(behavior); behavior.SetBinding(FadeBehavior.IsSelectedProperty, "IsSelected"); }
/// <summary> /// 设置淡入淡出 /// </summary> /// <param name="view"></param> /// <param name="data"></param> private void SetFade(View view, object data) { var behavior = new FadeBehavior(); behavior.SetBinding(FadeBehavior.IsSelectedProperty, "IsSelected", BindingMode.TwoWay); view.Behaviors.Add(behavior); }