我想Remove()或Clear() ToolbarItems.这是我ToolbarItem在MainPage.cs中创建的代码
public partial class MainPage : MasterDetailPage
{
public ToolbarItem cCounter = new ToolbarItem() { Icon = "picture.png" };
public ToolbarItem pPo = new ToolbarItem() { Text = "-" };
public MainPage()
{
InitializeComponent();
if (Device.OS == TargetPlatform.iOS)
{
provider.Clicked += iOS_Ppo_Clicked;
ToolbarItems.Add(cCounter);
ToolbarItems.Add(pPo);
}
}
private void iOS_Ppo_Clicked(object sender, EventArgs e)
{
OpenWindow();
}
public async void OpenWindow()
{
if (await Common.WindowComands.CanOpenWindow<PPoPage>(Detail))
{
page = new PPoPage(Page3.Allproviders);
this.ToolbarItems.Clear(); // here I am …Run Code Online (Sandbox Code Playgroud) 我正在尝试mailto为Outlook(网络版)创建一个网址.
在Outlook上,一切都运行得很好,但现在我必须在网络版OWA上实现它,所以我正在努力使用这个网址:
<a href='https://company.domain.com/owa/?ae=Item&a=New&t=IPM.Note&to=someone@expample.com&subject=Hello%20again&body=Body%20Text' target=_blank>testy</a>
Run Code Online (Sandbox Code Playgroud)
因为身体部位是空的.关于发生了什么的任何想法?
我正在努力解决这个问题.我在这里创建了一个简单的跨平台页面是XAML代码:
<?xml version="1.0" encoding="utf-8" ?>
<CarouselPage xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
x:Class="ForTesting.TestPage">
<Label Text="{Binding MainText}" VerticalOptions="Center" HorizontalOptions="Center" />
<ContentPage>
<ContentPage.Padding>
<OnPlatform x:TypeArguments="Thickness" iOS="0,40,0,0" Android="0,40,0,0" />
</ContentPage.Padding>
</ContentPage>
</CarouselPage>
Run Code Online (Sandbox Code Playgroud)
这里是相同的跨平台页面类:
public partial class TestPage: CarouselPage
{
public TestPage()
{
InitializeComponent();
new Label
{
Text = "heelow",
FontSize = Device.GetNamedSize(NamedSize.Medium, typeof(Label)),
HorizontalOptions = LayoutOptions.Center
};
}
}
Run Code Online (Sandbox Code Playgroud)
为了测试我创建了简单的标签,但即使没有标签它也不起作用.
我在我的MainPage.xaml中调用此页面:
<?xml version="1.0" encoding="UTF-8"?>
<MasterDetailPage xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:local="clr-namespace:ForTesting;assembly=ForTesting"
x:Class="ForTesting.MainPage"
MasterBehavior="Popover">
<ContentPage.ToolbarItems>
<ToolbarItem x:Name="CClick"
Text="C :"
Order="Primary">
</ToolbarItem>
</ContentPage.ToolbarItems>
<MasterDetailPage.Master>
<local:MasterPage x:Name="masterPage" />
</MasterDetailPage.Master>
<MasterDetailPage.Detail>
<NavigationPage>
<x:Arguments>
<local:TestPage/> …Run Code Online (Sandbox Code Playgroud) 是否可以测试许多情况,例如:
[TestCase(""), TestCase(null), TestCase("String"), TestCase("2010-07-14T00:00:00.000Z"), TestCase("201-07-14T00:00:00.000Z")]
Run Code Online (Sandbox Code Playgroud)
当我从带有反序列化json的API获得响应到我的Error对象时,我认为响应主体消息和HttpStatusCode在API的不同VALIDATIONS之后是正确的,并且从我的断言中它是正确的.
我从Json反序列化为泛型类型的方法:
public TType GetResponseJsonAsObject<TType>(HttpResponseMessage content)
{
var contentResult = content.Content.ReadAsStringAsync().Result;
var specialCase = JsonConvert.DeserializeObject<TType>(contentResult);
return specialCase;
}
Run Code Online (Sandbox Code Playgroud)
这是我的测试方法:
[TestCase(""), TestCase(null), TestCase("String"), TestCase("2010-07-14T00:00:00.000Z"), TestCase("201-07-14T00:00:00.000Z")]
public void PostAPI_SpecialCaseRequestDate_WithError_ProceedsSuccessfully(string date)
{
// arrange
SpecialCaseRequest data = new SpecialCaseRequest()
{
Name = "Test",
ExpirationDateTime = date,
};
// act + assert
string json = JsonConvert.SerializeObject(data, Formatting.Indented);
PostMethods sendJsonDemo = new PostMethods();
var response = sendJsonDemo.SendJsonDemo(json);
var responseBody = sendJsonDemo.GetResponseJsonAsObject<Error>(response);
Assert.IsNotNull(responseBody);
Assert.AreEqual("Date parameter cannot be empty string", responseBody.Message); …Run Code Online (Sandbox Code Playgroud) 大约3个小时,我正在尝试解决此问题。我的组合框向我显示对象名称而不是一个值,例如:A

这是我的课:
namespace Supermarket
{
public class WhareHouseTable
{
public string name { get; set; }
public double cost { get; set; }
public string offer { get; set; }
}
}
Run Code Online (Sandbox Code Playgroud)
这是我的代码:
private void Form1_Load(object sender, EventArgs e)
{
List<WhareHouseTable> product = new List<WhareHouseTable>();
product.Add(new WhareHouseTable { name = "A", cost = 0.63, offer = "Buy 2 for the price of 1" });
product.Add(new WhareHouseTable { name = "B", cost = 0.20 });
product.Add(new WhareHouseTable { name = "C", …Run Code Online (Sandbox Code Playgroud) 我正在开发一个程序,我需要过滤非拉丁字符的单词和句子。问题是,我只找到了拉丁字符单词和句子,但没有找到混合有拉丁字符和非拉丁字符的单词和句子。例如,“Hello”是拉丁字母单词,我可以使用以下代码来匹配它:
\n\nMatch match = Regex.Match(line.Line, @"[^\\u0000-\\u007F]+", RegexOptions.IgnoreCase);\n\nif (match.Success)\n{\n line.Line = match.Groups[1].Value;\n}\nRun Code Online (Sandbox Code Playgroud)\n\n但我没有发现例如与非拉丁字母单词或句子混合的情况:“Hell\xc3\xb8 I am s\xc3\xb8mthing”。
\n\n另外,有人可以解释什么是 RegexOptions.None 或 RegexOptions.IgnoreCase 以及它们代表什么?
\n