【问题标题】:Getting Change Event to Fire in SyncFusion's SFAutoComplete Control在 SyncFusion 的 SFAutoComplete 控件中触发更改事件
【发布时间】:2016-08-04 20:32:21
【问题描述】:

我正在尝试在 Xamarin iPad 应用程序中使用来自 SyncFusion 的 SFAutoComplete 控件。 (仅限 iPad)。

我无法触发任何类型的更改事件。

我尝试过的:

如果您下载并安装 SyncFusion,它会附带一个“SampleBrowser”应用程序,其中包含套件中所有控件的示例。

如果您在 Visual Studio 中打开 SampleBrowser 并在第 97 行之后打开 AutoComplete_Tablet.cs 文件,我添加了以下代码:

 countryAutoComplete.ValueChanged += (sender, args) =>
 {
     suggestionModeLabel.Text = "IT WORKED!";
 };

但它永远不会触发。

我尝试使用此控件所具有的事件列表中的几个不同事件(屏幕截图中的部分列表):

他们似乎都没有开火(我还没有尝试过所有这些)。

我需要做什么才能触发这些事件之一?我错过了什么?

【问题讨论】:

    标签: xamarin.ios syncfusion


    【解决方案1】:

    感谢您使用 Syncfusion Controls。

    Delegate 属性可用于按照以下代码示例挂钩 SFAutoComplete 的事件,

    Delegate 属性的声明代码

    SFAutoComplete autocomplete = new SFAutoComplete();
    
    autocomplete.Delegate = new SFAutoCompleteDelegate();
    

    SFAutoComplete中hook事件的方法

    public class SFAutoCompleteDelegate : AutoCompleteDelegate
        {
            public override void DidTextChange(SFAutoComplete SFAutoComplete, string value)
            {
                //It fired while changing the text in AutoComplete
            }
            public override void DidSelectionChange(SFAutoComplete SFAutoComplete, string value)
            {
                //It fired while changing the suggestion from suggestion box.
            }
        }
    

    我们已经创建了一个样本来满足您的要求。请从以下链接下载相同的内容

    链接:http://www.syncfusion.com/downloads/support/forum/125261/ze/testingAutoComplete_21799375630

    感谢和问候,

    Hemalatha M.R

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2020-11-07
      • 2016-10-10
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多