【问题标题】:add an effect dynamically over all controls in xamarin forms在 xamarin 表单中的所有控件上动态添加效果
【发布时间】:2017-11-14 18:41:22
【问题描述】:

我开发了一种效果,我想在我的所有控件上动态添加它。例如,我为日期选择器编写了一个效果,我想将此效果添加到应用程序中的所有日期选择器上。 我不想为我的所有控件重复此代码。

<Entry.Effects>
    <local:FocusEffect />
</Entry.Effects>

我关注了这篇文章:https://developer.xamarin.com/guides/xamarin-forms/application-fundamentals/effects/creating/

【问题讨论】:

    标签: xaml xamarin xamarin.forms


    【解决方案1】:

    您可以使用附加属性添加效果。然后,您可以使用样式将该附加属性添加到所有日期选择器。

    更多信息请访问:

    https://medium.com/@ysmoradi/how-to-add-xamarin-native-platform-effect-to-all-elements-9214cf6d7b8a

    https://github.com/ysmoradi/XamarinEffectsArticle

    【讨论】:

      猜你喜欢
      • 2021-08-01
      • 1970-01-01
      • 1970-01-01
      • 2016-09-12
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多