我在一些旧Android设备上运行我的应用程序时遇到一些问题,因此我下载了一段Visual Studio Professionel,就像它一样Diagnostics Tools.
我尝试在我的应用程序中做一些简单的事情,我觉得它很吓人,Xamarin.Forms.BindableProperty+BindablePropertyContext需要一个2.196.088UWP 的大小(当然是字节),你可以在下面的screendump看到.
在这个例子中,我已经justed浏览了5页.在其中的两个页面上ListViews,其中一个已被清除3次,并填充了新数据.
GC.Collect()清除后我必须打电话ListView吗?
我将在 Xamarin 中创建一个新应用程序,并且由于客户的需求,我需要对几乎所有内容创建单元测试。
在我的应用程序中,我使用 HttpClient,并且必须设置超时,因为应用程序必须上传图像。
但我怎样才能进行单元测试呢HttpClient.Timeout?
其他所有内容都是使用 模拟的HttpMessageHandler,但在其中插入Task.Delay不会影响它。
编辑
添加代码以进行澄清
public async Task ExecuteAsync_NotExecutedWithinTimeout_ThrowsExecption()
{
// Arrange
var endpoint = "http://google.dk/";
var method = HttpMethod.Get;
var timeoutClient = TimeSpan.FromMilliseconds(2);
var timeoutServer = TimeSpan.FromMilliseconds(10);
var requestor = new Requestor(new MessageHandler { Method = HttpMethod.Get, Timeout = timeoutServer, URL = url });
bool result = false;
// Act
try
{
await requestor.ExecuteAsync(method, endpoint, timeout: timeoutClient);
}
catch (TimeoutException)
{
result = true;
}
// Assert
Assert.AreEqual(true, …Run Code Online (Sandbox Code Playgroud) 在一个风俗ContentView我创建了BindableProperty这样的
public static readonly BindableProperty StrokeColorProperty =
BindableProperty.Create("StrokeColor",
typeof(Color),
typeof(SignaturePadView),
Color.Black,
BindingMode.TwoWay);
Run Code Online (Sandbox Code Playgroud)
但是我必须通知属性更改,因为必须在自定义渲染器中读取属性,我该怎么做?
如果我在上将其设置PropertyChanged为BindableProperty静态方法,则不能从这种方式获取它:(
我正在尝试将我的项目从SQLite.Net-PCL转换为sqlite-net-pcl(最新的稳定版本; 1.3.1),正如它在Xamarin处理数据库时说的那样,但是当我安装它时,它必须安装40个软件包(左右)如下所列
Microsoft.NETCore.Platforms 1.0.1
Microsoft.NETCore.Targets 1.0.1
runtime.native.System 4.0.0
SQLitePCLRaw.core 1.1.2
SQLitePCLRaw.bundle_green 1.1.2
System.Collections 4.0.11
System.Collections.Concurrent 4.0.12
System.Diagnostics.Debug 4.0.11
System.Diagnostics.Tools 4.0.1
System.Diagnostics.Tracing 4.1.0
System.Globalization 4.0.11
System.IO 4.1.0
System.IO.Compression 4.1.0
System.Linq 4.1.0
System.Linq.Expressions 4.1.0
System.Net.Http 4.1.0
System.Net.Primitives 4.0.11
System.ObjectModel 4.0.12
System.Reflection 4.1.0
System.Reflection.Extensions 4.0.1
System.Reflection.Primitives 4.0.1
System.Resources.ResourceManager 4.0.1
System.Runtime 4.1.0
System.Runtime.Extensions 4.1.0
System.Runtime.InteropServices 4.1.0
System.Runtime.Numerics 4.0.1
System.Text.Encoding 4.0.11
System.Text.Encoding.Extensions 4.0.11
System.Text.RegularExpressions 4.1.0
System.Threading 4.0.11
System.Runtime.InteropServices.RuntimeInformation 4.0.0
System.Threading.Tasks 4.0.11
System.Xml.ReaderWriter 4.0.11
System.Xml.XDocument 4.0.11
NETStandard.Library 1.6.0
sqlite-net-pcl 1.3.1
Run Code Online (Sandbox Code Playgroud)
我知道它需要一些软件包,但对我来说似乎有很多软件包.我正在使用Xamarin.Forms版本2.3.3.180(最新的稳定版)
如果我继续安装,会发生这样的错误
Could not …Run Code Online (Sandbox Code Playgroud)