разрабатываю приложение на xamarin,под windows phone 8.1 после компиляции вылетает с ошибкой
ругается на
private void OnClickStart(object sender, EventArgs e)
{
devices.Clear();
seeker.StartSearch();
}
целиком весь код
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using System.Text;
using Xamarin.Forms;
namespace bluettoh_ver1
{
public class App : Application
{
StackLayout layout;
bool toStart;
Button buttonStart;
Button buttonStop;
ObservableCollection<Info> devices = new ObservableCollection<Info>();
ISearch seeker;
public App()
{
seeker = DependencyService.Get<ISearch>();
buttonStart = new Button()
{
Text = "Search"
};
buttonStop = new Button()
{
Text = "Stop",
};
buttonStart.Clicked += OnClickStart;
buttonStop.Clicked += OnClickStop;
ListView listView = new ListView
{
ItemsSource = devices,
ItemTemplate = new DataTemplate(() =>
{
Label nameLabel = new Label();
nameLabel.SetBinding(Label.TextProperty, "Name");
Label macLabel = new Label();
macLabel.SetBinding(Label.TextProperty, "Mac");
return new ViewCell
{
View = new StackLayout
{
Orientation = StackOrientation.Horizontal,
VerticalOptions = LayoutOptions.CenterAndExpand,
Children = { nameLabel, macLabel }
}
};
})
};
layout = new StackLayout
{
Children = { buttonStart, buttonStop, listView }
};
ContentPage content = new ContentPage
{
Title = "Bluetooth Scanner",
Content = layout
};
MainPage = new NavigationPage(content);
}
private void OnClickStop(object sender, EventArgs e)
{
seeker.StopSearch();
}
private void OnClickStart(object sender, EventArgs e)
{
devices.Clear();
seeker.StartSearch();
}
public void AddDevice(Info device)
{
devices.Add(device);
}
}
}
Как развивать веб-проекты в 2026 году: технологии, контент E-E-A-T и факторы доверия
Современные инструменты для криптотрейдинга: как технологии помогают принимать решения
Апостиль в Лос-Анджелесе без лишних нервов и бумажной волокиты
Основные этапы разработки сайта для стоматологической клиники