投稿

11月, 2017の投稿を表示しています

ListView (2)

Having studied the basic function of the ListView control in the previous post,  ListView (1) , a variable "books" was declared as a list of book titles. But book information includes some attributes, author, date of issue etc., as well as title. So it seems to be good that book information is declared as a Class as below. Book Class public class Book {      public string Title { get; set; }      public string Author { get; set; } } The following sample code displays the ListView of book information declared as class type above. MainPage.xaml <? xml  version = " 1.0 "  encoding = " utf-8 "   ?> < ContentPage   xmlns = " http://xamarin.com/schemas/2014/forms "               xmlns : x = " http://schemas.microsoft.com/winfx/2009/xaml "               xmlns : local = " clr-namespace:ListView "               x : Class = " ListView.MainPage " >      < ContentPage.Content >      

How to display XAML source code on WordPress without any plugins

I have displayed some source code in the previous post, ListView(1), but it was a little bit difficult to display XAML source code especially in WordPress.  I tried to copy and paste them from Visual Studio to WordPress visual editor, and also to try the script, <pre><code> source code </code></pre> in WordPress html editor.  But the behavior of the source code display is unstable pretty much when switching visual/html editor.  The reason seems to be the characters, "<" and ">" etc., in XAML source code, which should be escaped in html.  The character string for comment-out, "<!-- -->", also seems to be causing the unstableness.  It may be a problem specific to WordPress (not so unstable in Blogger).  Besides, someone says that the posted article is correctly displayed, even though the display of source code is collapsed in the visual editor. So, trying out various methods without any plugins and any other complicated

ListView (1)

イメージ
I have studied the overview of Xamarin.Forms through the Quick Start in Xamarin official site, so I have started to study C# and XAML more deeply with ListView control as an example. I wrote a small program referring to  ListView guides  in Xamarin official site etc. MainPage.xaml <? xml  version = " 1.0 "  encoding = " UTF-8 " ?> < ContentPage   xmlns = " http://xamarin.com/schemas/2014/forms "                xmlns : x = " http://schemas.microsoft.com/winfx/2009/xaml "                x : Class = " ListView.MainPage " >          < ContentPage.Content >          < StackLayout >              <!--  Add a new book to the book list "BookListView"  -->              < Button   Text = " Add New Book "   Clicked = " OnNewBook "   />              < Entry   x : Name = " Entry1 "   Placeholder = " Input New Book "                  Keyboard