update tabulations to visualize code snippets
This commit is contained in:
Родитель
76caeca80f
Коммит
40f8c411d5
|
@ -21,19 +21,17 @@ This example demonstrates how to create a list view with text cells, like this:
|
|||
|
||||
1. Create a view model that will be the source of the list view:
|
||||
|
||||
<snippet id='listview-celltypes-textcell-viewmodel'/>
|
||||
<snippet id='listview-celltypes-textcell-viewmodel'/>
|
||||
|
||||
2. Add the definition of the listview control:
|
||||
|
||||
<snippet id='listview-celltypes-textcell-listview-xaml'/>
|
||||
|
||||
<snippet id='listview-celltypes-textcell-listview-csharp'/>
|
||||
<snippet id='listview-celltypes-textcell-listview-xaml'/>
|
||||
<snippet id='listview-celltypes-textcell-listview-csharp'/>
|
||||
|
||||
3. Add the following namespaces:
|
||||
|
||||
<snippet id='xmlns-teleriklistview'/>
|
||||
|
||||
<snippet id='ns-teleriklistview'/>
|
||||
<snippet id='xmlns-teleriklistview'/>
|
||||
<snippet id='ns-teleriklistview'/>
|
||||
|
||||
4. Finally, set the list view as the content of your page.
|
||||
|
||||
|
@ -45,27 +43,27 @@ This example demonstrates how to create a list view with templated cells, like t
|
|||
|
||||
1. Create a view model that will be the source of the list view:
|
||||
|
||||
<snippet id='listview-celltypes-templatecell-viewmodel'/>
|
||||
<snippet id='listview-celltypes-templatecell-viewmodel'/>
|
||||
|
||||
2. Define the listview control either in Xaml or in code behind.
|
||||
|
||||
You can define the list view in Xaml like this:
|
||||
|
||||
<snippet id='listview-celltypes-templatecell-listview-xaml'/>
|
||||
<snippet id='listview-celltypes-templatecell-listview-xaml'/>
|
||||
|
||||
* Define the namespace
|
||||
|
||||
<snippet id='xmlns-teleriklistview'/>
|
||||
<snippet id='xmlns-teleriklistview'/>
|
||||
|
||||
* You can define the list view in code behind:
|
||||
|
||||
* For clarity, let's build the template of the list view cell in a separate method:
|
||||
|
||||
<snippet id='listview-celltypes-templatecell-cellcontent'/>
|
||||
<snippet id='listview-celltypes-templatecell-cellcontent'/>
|
||||
|
||||
* Define the list view:
|
||||
|
||||
<snippet id='listview-celltypes-templatecell-listview-code'/>
|
||||
<snippet id='listview-celltypes-templatecell-listview-code'/>
|
||||
|
||||
3. Finally, set the list view as the content of your page.
|
||||
|
||||
|
|
|
@ -69,19 +69,19 @@ The following example demonstrates how to use the **ItemSwipeCompleted** event.
|
|||
|
||||
![CellSwipe](images/listview-gestures-swipe-swipe-event.png)
|
||||
|
||||
1. Add the view model for the ListView:
|
||||
1. Add the view model for the ListView:
|
||||
|
||||
<snippet id='listview-gestures-cellswipe-swipeevents-viewmodel'/>
|
||||
|
||||
2. Set up ListView. Swiping left or right will reveal content with a hint for what will happen if the user completes the swipe action.
|
||||
2. Set up ListView. Swiping left or right will reveal content with a hint for what will happen if the user completes the swipe action.
|
||||
|
||||
<snippet id='listview-gestures-cellswipe-swipeevents-listview'/>
|
||||
|
||||
3. Define the ListView namespace:
|
||||
3. Define the ListView namespace:
|
||||
|
||||
<snippet id='xmlns-teleriklistview'/>
|
||||
|
||||
4. Configure what happens when the user completes the swipe gesture:
|
||||
4. Configure what happens when the user completes the swipe gesture:
|
||||
|
||||
<snippet id='listview-gestures-cellswipe-swipeevents-swipecompleted'/>
|
||||
|
||||
|
@ -93,19 +93,19 @@ The following example demonstrates how to add a delete button to the swipe conte
|
|||
|
||||
![CellSwipe](images/listview-gestures-swipe-interactive-content.png)
|
||||
|
||||
1. Add the view model for the ListView:
|
||||
1. Add the view model for the ListView:
|
||||
|
||||
<snippet id='listview-gestures-cellswipe-interactivecontent-viewmodel'/>
|
||||
|
||||
2. Set up ListView. Note that the SwipeOffset is equal to the width of the button in the swipe content. Thus, when the swipe is complete, the revealed content will be the whole button.
|
||||
2. Set up ListView. Note that the SwipeOffset is equal to the width of the button in the swipe content. Thus, when the swipe is complete, the revealed content will be the whole button.
|
||||
|
||||
<snippet id='listview-gestures-cellswipe-interactivecontent-listview'/>
|
||||
|
||||
3. Define the ListView namespace:
|
||||
3. Define the ListView namespace:
|
||||
|
||||
<snippet id='xmlns-teleriklistview'/>
|
||||
|
||||
4. Configure what happens when the user completes the swipe gesture. The BindingContext of the swipe content is the data item. This could be used to perform operations on the data. In this case, we will delete the item from the source.
|
||||
4. Configure what happens when the user completes the swipe gesture. The BindingContext of the swipe content is the data item. This could be used to perform operations on the data. In this case, we will delete the item from the source.
|
||||
|
||||
<snippet id='listview-gestures-cellswipe-interactivecontent-deleteitem'/>
|
||||
|
||||
|
|
|
@ -96,10 +96,10 @@ The example below demonstrates how to use the LoadOnDemand command:
|
|||
|
||||
3. Define the following namespaces:
|
||||
|
||||
```XAML
|
||||
xmlns:telerikDataControls="clr-namespace:Telerik.XamarinForms.DataControls;assembly=Telerik.XamarinForms.DataControls"
|
||||
xmlns:telerikListViewCommands="clr-namespace:Telerik.XamarinForms.DataControls.ListView.Commands;assembly=Telerik.XamarinForms.DataControls"
|
||||
```
|
||||
```XAML
|
||||
xmlns:telerikDataControls="clr-namespace:Telerik.XamarinForms.DataControls;assembly=Telerik.XamarinForms.DataControls"
|
||||
xmlns:telerikListViewCommands="clr-namespace:Telerik.XamarinForms.DataControls.ListView.Commands;assembly=Telerik.XamarinForms.DataControls"
|
||||
```
|
||||
|
||||
4. Set the ViewModel as BindingContext in the page constructor:
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче