コード例 #1
0
ファイル: ListAuto.cs プロジェクト: zhiyuanjia/MvvmCross
        public virtual ListLayoutDescription ToListLayoutDescription()
        {
            var list = new ListLayoutDescription();

            base.Fill(list);
            if (this.ItemsSource != null)
            {
                var itemsSource = this.ItemsSource.GetPropertyText();
                list.Properties["ItemsSource"] = $"@MvxBind:{itemsSource}";
            }
            if (this.SelectedCommand != null)
            {
                var selectedCommand = this.SelectedCommand.GetPropertyText();
                list.Properties["ItemClick"] = $"@MvxBind:{selectedCommand}";
            }
            if (this.DefaultLayout != null)
            {
                list.DefaultLayout = this.DefaultLayout.ToListItemDescription();
            }
            foreach (var kvp in this.ItemLayouts)
            {
                list.ItemLayouts[kvp.Key] = kvp.Value.ToListItemDescription();
            }
            return(list);
        }
コード例 #2
0
ファイル: ListAuto.cs プロジェクト: Everbridge/sm-MvvmCross
        public virtual ListLayoutDescription ToListLayoutDescription()
        {
            var list = new ListLayoutDescription();

            base.Fill(list);
            if (ItemsSource != null)
            {
                var itemsSource = ItemsSource.GetPropertyText();
                list.Properties["ItemsSource"] = string.Format("@MvxBind:{0}", itemsSource);
            }
            if (SelectedCommand != null)
            {
                var selectedCommand = SelectedCommand.GetPropertyText();
                list.Properties["ItemClick"] = string.Format("@MvxBind:{0}", selectedCommand);
            }
            if (DefaultLayout != null)
            {
                list.DefaultLayout = DefaultLayout.ToListItemDescription();
            }
            foreach (var kvp in ItemLayouts)
            {
                list.ItemLayouts[kvp.Key] = kvp.Value.ToListItemDescription();
            }
            return(list);
        }