我想在我的表单上实现一个拨号盘.现在,在我的XAML中,我正在测试一个按钮:XAML
<?xml version="1.0" encoding="UTF-8"?>
<ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
x:Class="MyXFDemo001.Views.NewItemPage"
Title="New Item">
<ContentPage.ToolbarItems>
<ToolbarItem Text="Save" Clicked="Save_Clicked" />
</ContentPage.ToolbarItems>
<ContentPage.Content>
<StackLayout Spacing="20" Padding="15">
<Button
x:Name="buttonSelectContact"
Clicked="buttonSelectContact_Clicked"
Text="CLICK" BackgroundColor="#0080ff" />
</StackLayout>
</ContentPage.Content>
Run Code Online (Sandbox Code Playgroud)
在我的代码后面我有一个方法buttonSelectContact_Clicked:
private async void buttonSelectContact_Clicked(object sender, EventArgs e)
{
Button btn = (Button)sender;
btn.BackgroundColor = Color.FromHex("#22ac38");
await Task.Delay(500);
btn.BackgroundColor = Color.FromHex("#0080ff");
}
Run Code Online (Sandbox Code Playgroud)
它可以工作,但并不像我想要的那样平稳.你能建议我添加动画而不是这个BackgroundColor吗?
我想验证我的第一个字段的形式createViewModal,datepickerCreateModal在dd.mm.yyyy格式.我正在寻找一些正则表达式,我发现它:
/(0[1-9]|[12][0-9]|3[01])\.(0[1-9]|1[012])\.(19|20)\d\d/
Run Code Online (Sandbox Code Playgroud)
但看起来这个regEX并不是很好 - 它从一年开始只拉两位数("20"而不是"2016")
dd.mm.yyyy(11.05.2016)你能给我写一个完整的正则表达式吗?我想我将能够通过bootstrap验证器使用此正则表达式创建回调函数.
如果有人已经有这个正则表达式或类似的解决方案,我会很高兴听到它!
<div class="modal fade" id="createViewModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal">
<span aria-hidden="true">×</span><span class="sr-only">Close</span>
</button>
<h4 class="modal-title" id="myModalLabel">New SAR</h4>
</div>
<div class="modal-body">
<div id="formregister">
<form action="" class="form-horizontal" role="form" id="createViewModal">
<p class="qc-errmsg" style="display: none;"> </p>
<div class="form-group">
<label for="Date" class="col-sm-2 control-label">Date</label>
<div class="col-sm-10">
<input type="text" class="form-control" id="datepickerCreateModal" name="Date" placeholder="Date">
</div>
</div>
<div class="form-group">
<label for="Client" …Run Code Online (Sandbox Code Playgroud) 我想在代码隐藏中通过BoxView组件添加文本AbsoluteLayout。
像这样的东西:
我该怎么做?
这里是我的代码,在那里我把AbsoluteLayout到StackLayout结尾:
public TestPageBoxView()
{
StackLayout sl = new StackLayout();
AbsoluteLayout al = new AbsoluteLayout();
BoxView bv = new BoxView { BackgroundColor = Color.Green };
Label l = new Label { Text = "Some text with \n breaks" };
AbsoluteLayout.SetLayoutBounds(l, new Rectangle(0, 0,1,1));
AbsoluteLayout.SetLayoutFlags(l, AbsoluteLayoutFlags.All);
sl.Children.Add(bv);
sl.Children.Add(al);
Content = sl;
}
Run Code Online (Sandbox Code Playgroud)
所以,我担心的是这个l组件被坚持到 stacklayout 而不是 BoxView。
也许我应该试试RelativeLayout?
你知道 git 上的一些组件吗?喜欢 XLabs?
谢谢。
我有一个错误:
System.InvalidOperationException:公钥不能为 null 或为空。
我的控制器页面员工/创建看起来像:
@using System.Collections
@using System.Collections.Concurrent
@using System.Data.SqlTypes
@using DataAccess
@using Recaptcha.Web.Mvc
@using Recaptcha.Web;
@using Recaptcha.Web.Mvc;
@model DataAccess.Employee
@{
ViewBag.Title = "Create";
}
@{ Layout = "/views/shared/_EmployeeLayout.cshtml";
}
@section Scripts {
@Scripts.Render("~/bundles/jqueryval")
}
@using (Html.BeginForm())
{
@Html.AntiForgeryToken()
<div class="container">
<h2>Please, provide some information.</h2>
<div class="row">
<div class="col-md-8">
<div class="form-group">
@Html.LabelFor(model => model.Name, "Name", htmlAttributes: new { @class = "control-label col-md-2" })
<div class="col-md-10">
@Html.EditorFor(model => model.Name, new { htmlAttributes = new { @class = "form-control" } }) …Run Code Online (Sandbox Code Playgroud) 我创建了一个新文件夹Test。运行命令: git init 然后我设置全局配置 - 邮件和名称然后我添加:
git remote add origin https://bvcdata.visualstudio.com/_git/MyRepo
git push -u origin --all
并立即得到错误:
远程:TF401019:名称或标识符为 sdsdsd 的 Git 存储库不存在,或者您没有尝试操作的权限。致命:未找到存储库“ https://xxxxxx.visualstudio.com/_git/MyRepo/ ”
我是 VSTS 项目的所有者,所以我拥有所有特权。到目前为止,这一切都在起作用。感谢您的反馈。
我获得了 Azure 认知服务的 api 密钥,但找不到任何文档,说明我如何通过邮递员调用此服务。有人有这方面的经验吗?
我发现了类似的问题,但没有涵盖这种情况。
我试图做如下:
string dateTime = "28.11.2020 16:08:43"
var date = DateTime.ParseExact(dateTime, "dd.MM.yyyy hh:mm:ss", CultureInfo.InvariantCulture)
Run Code Online (Sandbox Code Playgroud)
但我得到了例外:
System.FormatException: String '28.11.2020 16:08:43' was not recognized as a valid DateTime.
at System.DateTime.ParseExact(String s, String format, IFormatProvider provider)
Run Code Online (Sandbox Code Playgroud) 我正在阅读microsoft docs ms sql JSON options
我想检查我的列Settings是否为 nvarchar,我在那里放了一些 JSON,以及该 JSON 是否包含 property name。
可行吗?
就像是:
DECLARE @info NVARCHAR(100)='{"name":"John","skills":["C#","SQL"]}'
IF (ISJSON(@info) > 0)
BEGIN
-- if (@info contains `$.name`)
--begin
-- SET @info=JSON_MODIFY(@info,'$.name','Mike')
--end
-- else
--begin
-- SET @info=JSON_MODIFY(@info,'$.name','Mike')
--end
END
Run Code Online (Sandbox Code Playgroud)
我需要检查该 JSON 属性是否存在,如果存在则更新值,如果不存在则插入具有预定义值的属性。
我有一些像这样的txt数据:
0.0.0.1_03_1
0.0.0.1_03
0.0.0.1_02_2_1_3_4
0.0.0.1_02_1
0.0.0.1_02
0.0.0.1_01_1
0.0.0.1_01
Run Code Online (Sandbox Code Playgroud)
我想要实现的是分离到两个变量(0.0.0.1和其余的)我只想通过第一个'_'分开并保持前导零(例如01)我喜欢:
Get-Content $SourceTxtDbFile |
ConvertFrom-String -Delimiter "_" -PropertyNames DbVersion, ScriptNumber
Run Code Online (Sandbox Code Playgroud)
但结果既没有前导零也没有按照我希望的方式分割线条.
c# ×2
.net-core ×1
animation ×1
api ×1
asp.net-mvc ×1
azure ×1
azure-devops ×1
datetime ×1
git ×1
jquery ×1
postman ×1
powershell ×1
recaptcha ×1
regex ×1
sql ×1
sql-server ×1
text-parsing ×1
validation ×1
xamarin ×1
xaml ×1