我想将现有的解决方案添加到Github,我看过很多YouTube视频.但他们都只向我展示了创建新项目的方法.如何在Github上添加现有项目?Visual Studio 2017社区版中没有文件 - >添加到源代码管理选项!
单击事件后,我想从Entry输入中检索一个值。我该如何找回它。以下是我的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"
xmlns:local="clr-namespace:HelloWorld"
x:Class="HelloWorld.MainPage">
<StackLayout Spacing="10" x:Name="layout">
<Label Text="Name" VerticalOptions="Start" FontSize="Large"/>
<Entry x:Name="name" Placeholder="Enter your name"/>
<Label Text="Password" VerticalOptions="Start" FontSize="Large"/>
<Entry x:Name="password" IsPassword="True" Placeholder="****"/>
<Label Text="Date of Birth" VerticalOptions="Start" FontSize="Large"/>
<DatePicker x:Name="dob"/>
<Label Text="Gender" VerticalOptions="Start" FontSize="Large"/>
<Picker x:Name="GenderPicker" HorizontalOptions="FillAndExpand">
<Picker.Items>
<x:String>Male</x:String>
<x:String>Female</x:String>
</Picker.Items>
</Picker>
<Button x:Name="submit" Text="Save" BorderWidth="20" Clicked="submit_Clicked"/>
</StackLayout>
</ContentPage>
Run Code Online (Sandbox Code Playgroud)
我想在submit_Clicked()方法中检索数据。
private void submit_Clicked(object sender, EventArgs e)
{
how?
}
Run Code Online (Sandbox Code Playgroud) 假设我有字符串"20171013",现在我想将其转换为13-10-2017,它也应该在字符串中.此外,我已将这些字符串存储在列表的属性中.是否可以使用foreach循环转换所有这些字符串数量的属性?
这是我正在研究的代码
calendarResponse.AgendaOptions
.ForEach(a => a.AppointmentDate =
DateTime.ParseExact(a.AppointmentDate, "ddMMyyyy",
CultureInfo.InvariantCulture).ToString());
Run Code Online (Sandbox Code Playgroud)
这里,AppointmentDate的日期为字符串格式,如"20171013"
我收到了错误:
日历System.Globalization.GregorianCalendar中不支持由字符串表示的DateTime