x:Class="CoffeeShopApp.MainPage"
xmlns="http:
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="using:CoffeeShopApp"
xmlns:d="http:
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d">
<StackPanel Orientation="Vertical" HorizontalAlignment="Center" VerticalAlignment="Center">
<TextBlock Text="Coffee Shop" FontSize="24" Margin="0,0,0,20"/>
<ListView x:Name="CoffeeMenu">
<ListView.ItemTemplate>
<DataTemplate>
<StackPanel Orientation="Horizontal">
<TextBlock Text="{Binding Name}" Margin="10"/>
<TextBlock Text="{Binding Price}" Margin="10"/>
</StackPanel>
</DataTemplate>
</ListView.ItemTemplate>
</ListView>
<Button Content="Place Order" Margin="0,20"/>
</StackPanel>
using System.Collections.Generic;
using Uno.UI.Runtime.Skia;
namespace CoffeeShopApp
{
public sealed partial class MainPage : Page
{
public MainPage()
{
this.InitializeComponent();
var coffeeMenu = new List<CoffeeItem>
{
new CoffeeItem { Name = "Espresso", Price = "₹100" },
new CoffeeItem { Name = "Latte", Price = "₹150" },
new CoffeeItem { Name = "Cappuccino", Price = "₹150" }
};
CoffeeMenu.ItemsSource = coffeeMenu;
}
}
public class CoffeeItem
{
public string Name { get; set; }
public string Price { get; set; }
}
}
Top comments (0)