﻿<?xml version="1.0" encoding="utf-8"?><rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:sy="http://purl.org/rss/1.0/modules/syndication/" xmlns:media="http://search.yahoo.com/mrss/" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0"><channel><title>Intersoft Community - Crosslight - Crosslight ViewModelBase and List Tables</title><link>http://www.intersoftsolutions.com/Community/Crosslight/Crosslight-ViewModelBase-and-List-Tables/</link><description /><generator>http://www.intersoftsolutions.com</generator><language>en</language><copyright>Copyright 2002 - 2015 Intersoft Solutions Corp. All rights reserved.</copyright><ttl>60</ttl><item><title>Crosslight ViewModelBase and List Tables</title><link>http://www.intersoftsolutions.com/Community/Crosslight/Crosslight-ViewModelBase-and-List-Tables/</link><pubDate>Tue, 16 Sep 2014 04:09:20 GMT</pubDate><dc:creator>yudi</dc:creator><description>&lt;blockquote&gt;I'm having a problem with AddViewModelBinding, its not finding the refrence.  I changed it to AddBinding but it doesn't do anything.&lt;/blockquote&gt;&lt;p&gt;&lt;span style="color: #1f497d;"&gt;I suggest you to download and apply Crosslight 2 Update 4. For your information, I'm using Crosslight 2 Update 4 in my end and the &lt;em&gt;unable to find reference&lt;/em&gt; problem is not persist.&lt;/span&gt;&lt;/p&gt;&lt;br&gt;&lt;blockquote&gt;So I have to hardcode the entire top part?  Is there anyway I can make each portion in XIB &amp;amp; XAML and have it load as the header?&lt;/blockquote&gt;&lt;p&gt;&lt;span style="color: #1f497d;"&gt;I managed to create a sample where the content of TableHeaderView is loaded from XIB file. However, I have layout problem where the TableHeaderView overlaps the TableView.&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="color: #1f497d;"&gt;I will get back to you as soon as I have a solution for this.&lt;/span&gt;&lt;/p&gt;
&lt;br&gt;&lt;br&gt;
&lt;p&gt;&lt;span style="color: #1f497d;"&gt;&lt;strong&gt;Edited on September 16, 2014 06:15 AM&lt;br&gt;Reason: update solution to load table header from XIB&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="color: #1f497d;"&gt;Please follow the step-by-step below in order to create view (XIB file) and use it as HeaderViewTemplate.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="color: #1f497d;text-decoration:underline;"&gt;Section 1: Create MyHeader.xib&lt;/span&gt;&lt;/p&gt;
&lt;ol style="color: #1f497d;"&gt;&lt;li&gt;Add an &lt;em&gt;iPhone Table View Cell&lt;/em&gt; and named it as MyHeader in the &lt;em&gt;Views&lt;/em&gt; folder of the iOS project.&lt;/li&gt;&lt;li&gt;In Xcode Interface Builder, add a Round Style Text Field; a Label; and a Button control so that the layout will look like below.&lt;br&gt;&lt;img src="http://www.intersoftpt.com/Community/Attachments/4158/MyHeader.png"&gt;&lt;/li&gt;&lt;li&gt;Set the outlet of the button and text.&lt;/li&gt;&lt;li&gt;Set Row Height to 50.&lt;br&gt;&lt;img src="http://www.intersoftpt.com/Community/Attachments/4158/MyHeader_RowHeight.png"&gt;&lt;/li&gt;&lt;li&gt;Open MyHeader.cs file and set MyHeader class to inherits from UIView.&lt;/li&gt;&lt;/ol&gt;
&lt;p&gt;&lt;span style="color: #1f497d;text-decoration:underline;"&gt;Section 2: To use MyHeader as HeaderViewTemplate&lt;/span&gt;&lt;/p&gt;
&lt;ol style="color: #1f497d;"&gt;&lt;li&gt;Open ItemListViewController.cs file.&lt;/li&gt;&lt;li&gt;Override HeaderViewTemplate and add following code.&lt;br&gt;&lt;pre&gt;public override UIViewTemplate HeaderViewTemplate
{
	get { return new UIViewTemplate(MyHeader.Nib); }
}&lt;/pre&gt;&lt;/li&gt;&lt;li&gt;Save all changes.&lt;/li&gt;&lt;li&gt;The final layout should look like:&lt;br&gt;&lt;img src="http://www.intersoftpt.com/Community/Attachments/4158/Result.png" style="height:514px; width:356px;"&gt;&lt;/li&gt;&lt;/ol&gt;</description></item><item><title>Crosslight ViewModelBase and List Tables</title><link>http://www.intersoftsolutions.com/Community/Crosslight/Crosslight-ViewModelBase-and-List-Tables/</link><pubDate>Mon, 15 Sep 2014 23:15:29 GMT</pubDate><dc:creator>devincroud</dc:creator><description>&lt;p&gt;I'm having a problem with&amp;nbsp;&lt;span style="color: rgb(196, 76, 87); font-family: Menlo; font-size: 10pt;"&gt;AddViewModelBinding, its not finding the refrence. &amp;nbsp;I changed it to AddBinding but it doesn't do anything.&lt;/span&gt;&lt;/p&gt;&lt;p&gt;So I have to hardcode the entire top part? &amp;nbsp;Is there anyway I can make each portion in XIB &amp;amp; XAML and have it load as the header?&lt;/p&gt;





</description></item><item><title>Crosslight ViewModelBase and List Tables</title><link>http://www.intersoftsolutions.com/Community/Crosslight/Crosslight-ViewModelBase-and-List-Tables/</link><pubDate>Mon, 15 Sep 2014 09:36:03 GMT</pubDate><dc:creator>yudi</dc:creator><description>&lt;p&gt;&lt;span style="color: #1f497d;"&gt;Thank you very much for the attached picture. It really helps to figure out the layout to be achieved.&lt;/span&gt;&lt;/p&gt;&lt;blockquote&gt;...Do you have a sample of how I can display my form and a tableview inside the form at the bottom?&lt;/blockquote&gt;&lt;p&gt;&lt;span style="color: #1f497d;"&gt;UITableView has TableHeaderView property. We can set that to whatever view for your required scenario.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="color: #1f497d;"&gt;I created a project using &lt;strong&gt;Master Detail&lt;/strong&gt; project template; named it to ViewModelBaseAndListTables; and do the following:&lt;/span&gt;&lt;/p&gt;
&lt;ol style="color: #1f497d;"&gt;&lt;li&gt;Override ViewDidLoad;&lt;/li&gt;&lt;li&gt;Programmatically create UIView;&lt;/li&gt;&lt;li&gt;Set the created UIView as TableHeaderView property.&lt;/li&gt;&lt;/ol&gt;
&lt;p&gt;&lt;span style="color: #1f497d;"&gt;Following snippet code shows how to add a text in TableHeaderView.&lt;/span&gt;&lt;/p&gt;
&lt;pre&gt;public override void ViewDidLoad()
{
    base.ViewDidLoad();

    UIView view = new UIView(new RectangleF(0, 0, 100, 60));
            
    UILabel label=new UILabel(new RectangleF(10, 10, 80, 40));
    label.Text = "Add your custom form here";
    label.AdjustsFontSizeToFitWidth = true;
            
    view.Add(label);

    this.TableView.TableHeaderView = view;
}&lt;/pre&gt;&lt;br&gt;&lt;br&gt;
&lt;blockquote&gt;...how I can add buttons to a TableView cell?&lt;/blockquote&gt;
&lt;p&gt;&lt;span style="color: #1f497d;"&gt;ItemCell.xib is added into iOS project of ViewModelBaseAndListTables. Please ensure that &lt;em&gt;Use Autolayout&lt;/em&gt; is disabeled; and &lt;em&gt;Row Height&lt;/em&gt; is set to 50 in Interface Builder.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="color: #1f497d;"&gt;In the ViewModel, a DelegateCommand called TestCommand, is added. This command will be bind to the button so that when user click, it will show a ToastPresenter with item.Name information.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="color: #1f497d;"&gt;Changes in ViewModel.cs&lt;/span&gt;&lt;/p&gt;
&lt;pre&gt;public DelegateCommand TestCommand {get;set;}

public ItemListViewModel()
{
    // source items, should be plain items, not sorted or filtered
    this.SourceItems = this.Repository.GetAll().ToObservable();

    // set group items
    this.RefreshGroupItems();

    // commands
    this.NavigateGroupCommand = new DelegateCommand(ExecuteNavigateGroup);
    this.MarkSoldCommand = new DelegateCommand(ExecuteMarkSold, CanExecuteMarkSold);
    this.TestCommand = new DelegateCommand(ExecuteTest);
}

private void ExecuteTest(object obj)
{
    Item item = obj as Item;
    if (item != null)
        this.ToastPresenter.Show(item.Name);
}&lt;/pre&gt;
&lt;p&gt;&lt;span style="color: #1f497d;"&gt;Last, modify ItemListBindingProvider.cs and add following codes in the contructor:&lt;/span&gt;&lt;/p&gt;
&lt;pre&gt;itemBinding.AddBinding("Text1", BindableProperties.TextProperty, "Name");
itemBinding.AddViewModelBinding("TestButton", BindableProperties.CommandProperty, "TestCommand");
itemBinding.AddBinding("TestButton", BindableProperties.CommandParameterProperty, ".");&lt;/pre&gt;
&lt;p&gt;&lt;span style="color: #1f497d;"&gt;A simple sample is uploaded in &lt;a href="http://git.intersoftpt.com/projects/CROS-SUPP/repos/viewmodelbase-and-list-tables-sample/browse" target="_blank"&gt;here&lt;/a&gt;. Please have the sample evaluated on your and let us know whether it helps or not.&lt;/span&gt;&lt;/p&gt;</description></item><item><title>Crosslight ViewModelBase and List Tables</title><link>http://www.intersoftsolutions.com/Community/Crosslight/Crosslight-ViewModelBase-and-List-Tables/</link><pubDate>Wed, 10 Sep 2014 05:13:31 GMT</pubDate><dc:creator>devincroud</dc:creator><description>&lt;p&gt;Maybe I didn't explain what I'm trying to do correctly... &amp;nbsp;Look at the picture I have attached&lt;/p&gt;&lt;p&gt;The top part of the view has a banner image with a button, and the bottom has the listview/tableview. &amp;nbsp;I've done this in iOS many times.&lt;/p&gt;&lt;p&gt;&lt;br&gt;&lt;/p&gt;&lt;p&gt;&lt;br&gt;&lt;/p&gt;</description></item><item><title>Crosslight ViewModelBase and List Tables</title><link>http://www.intersoftsolutions.com/Community/Crosslight/Crosslight-ViewModelBase-and-List-Tables/</link><pubDate>Tue, 09 Sep 2014 23:50:36 GMT</pubDate><dc:creator>yudi</dc:creator><description>&lt;blockquote&gt;... I don't want to have just a full screen TableView, I need it to be mixed. Do you have a sample of how I can display my form and a tableview inside the form at the bottom?&lt;/blockquote&gt;&lt;p&gt;&lt;span style="color: #1f497d;"&gt;Basically, you shouldn’t mix TableView and a Form. That pattern is not accordant with iOS &amp;amp; Android design pattern. For more detail information, please check the &lt;strong&gt;Understanding Crosslight Navigation Patterns&lt;/strong&gt; in &lt;a href="http://developer.intersoftpt.com/display/crosslight/Understanding+Crosslight+Navigation+Patterns" target="_blank"&gt;here&lt;/a&gt;.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="color: #1f497d;"&gt;A standard navigation typically consists of four types of navigation patterns, namely Push Navigation, List Navigation, Modal Navigation and Nested Modal Navigation. For further information, you could follow this &lt;a href="http://developer.intersoftpt.com/display/crosslight/Standard+Navigation" target="_blank"&gt;link&lt;/a&gt;.&lt;/span&gt;&lt;/p&gt;
&lt;br&gt;
&lt;blockquote&gt;...how I can add buttons to a TableView cell. I need 2 texts, and three buttons. I found ItemBindingDescription but this only allows the ability to display text and an image.&lt;/blockquote&gt;
&lt;p&gt;&lt;span style="color: #1f497d;"&gt;I forward this to Crosslight development team to be discussed further. I'll get back to you as soon as I heard any news from the team regarding this.&lt;/span&gt;&lt;/p&gt;</description></item><item><title>Crosslight ViewModelBase and List Tables</title><link>http://www.intersoftsolutions.com/Community/Crosslight/Crosslight-ViewModelBase-and-List-Tables/</link><pubDate>Thu, 04 Sep 2014 23:01:52 GMT</pubDate><dc:creator>devincroud</dc:creator><description>&lt;p&gt;I have created a ViewModel that needs to has top portion with buttons and pictures. I then need to display the TableView below. From the samples and reading the docs I can't figure out how to have both. I don't want to have just a full screen TableView, I need it to be mixed. Do you have a sample of how I can display my form and a tableview inside the form at the bottom?&lt;/p&gt;&lt;p&gt;I also don't see how I can add buttons to a TableView cell. I need 2 texts, and three buttons. I found ItemBindingDescription but this only allows the ability to display text and an image.&lt;br&gt;&lt;/p&gt;</description></item></channel></rss>