[過去ログ] Microsoft .NET MAUI part9 [Xamarin] (1002レス)
上下前次1-新
このスレッドは過去ログ倉庫に格納されています。
次スレ検索 歴削→次スレ 栞削→次スレ 過去ログメニュー
56: 2022/09/20(火)23:29 ID:tcmFdYIT(2/4) AAS
プロジェクト作って、
MainPage.xaml
<?xml version="1.0" encoding="utf-8" ?> <ContentPage xmlns="<外部リンク:schemas.microsoft.com xmlns:x="<外部リンク:schemas.microsoft.com xmlns:local="clr-namespace:CollectionViewMemoryLeak" x:Class="[プロジェクト名].MainPage" x:DataType="local:MainPage"> <Grid RowDefinitions="Auto,*"> <Button Text="Replace" Clicked="Button_Clicked"/> <CollectionView Grid.Row="1" ItemsSource="{Binding Items}"> <CollectionView.ItemTemplate> <DataTemplate> <Label Text="{Binding}"/> </DataTemplate> </CollectionView.ItemTemplate> </CollectionView> </Grid> </ContentPage>
MainPage.xaml.cs
using System.Collections.ObjectModel; namespace [プロジェクト名]; public partial class MainPage : ContentPage { public ObservableCollection<string> Items { get; } = new() { "a" }; public MainPage() { InitializeComponent(); BindingContext = this; } private void Button_Clicked(object sender, EventArgs e) { Items[0] += "b"; } }
って置き換えて、デバッグ開始
ボタン1万回ぐらい押すとわかると思うよ
上下前次1-新書関写板覧索設栞歴
あと 946 レスあります
スレ情報 赤レス抽出 画像レス抽出 歴の未読スレ
ぬこの手 ぬこTOP 0.012s