MonoTouch.Dialog:在元素文本的更新 [英] MonoTouch.Dialog: Update of Text in an Element

查看:154
本文介绍了MonoTouch.Dialog:在元素文本的更新的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

使用 MonoTouch.Dialog 我想补充 StyledStringElement 元素。



有一个背景的任务,检索需要更新 element.Value



详细信息是否有办法强迫元素有它的文本 element.Value 更新?



伊恩

解决方案

如果您想更新此元素乘元素,那么你可以使用这样的:

 公共类MyStyledStringElement {

公共无效SetValueAndUpdate(字符串值)
{
值=价值;
如果(GetContainerTableView()!= NULL){
无功根= GetImmediateRootElement();
root.Reload(这一点,UITableViewRowAnimation.Fade);
}
}
}

一个变化将是载入一切都和更新一次(即迭代的 root.Reload 元素)。


Using MonoTouch.Dialog I add StyledStringElement elements.

There is a background task that retrieves details that need to update the element.Value

Is there a way to force the element to have it's text updated after the element.Value is updated?

Ian

解决方案

If you want to update this element-by-element then you can use something like:

public class MyStyledStringElement {

    public void SetValueAndUpdate (string value)
    {
        Value = value;
        if (GetContainerTableView () != null) {
            var root = GetImmediateRootElement ();
            root.Reload (this, UITableViewRowAnimation.Fade);
        }
    }
}

A variation would be to load everything and update once (i.e. iterating on the root.Reload for every Element).

这篇关于MonoTouch.Dialog:在元素文本的更新的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆