我正在尝试List<DataStatusItem>使用DataRow如下属性将 a作为输入参数发送到我的单元测试方法,
[TestClass]
public class UpdateProcessingTestController
{
private List<DataStatusItem> DataStatusItemsTestSetup = new List<DataStatusItem>() {
new DataStatusItem { DataItemID = 1, DataItemCurrentStatusID = 1, DataItemStatusID = 1, DateEffective = DateTime.Now }
};
private readonly Mock<IEmployee> moqEmployee;
public UpdateProcessingTestController()
{
moqEmployee = new Mock<IEmployee>();
}
[TestMethod]
[DataRow(DataStatusItemsTestSetup, 1, 8, 1)] // **This is where it is throwing me compilation error**
public void SetDataItems(List<DataStatusItem> DataStatusItems,int brand, int dataType, int processingStatus)
}
Run Code Online (Sandbox Code Playgroud)
请让我知道如何将列表作为输入参数发送到我的测试方法。
我正在尝试连接到使用 SQL 管理工作室在 Azure 上创建的 sql 服务器,但出现以下错误。
Error message: An error has occurred while establishing a connection to the server. When connecting to SQL Server, this failure may be caused by the fact that under the default settings SQL Server does not allow remote connections. (provider: TCP Provider, error: 0 - A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond.) (Microsoft …Run Code Online (Sandbox Code Playgroud) 我在 Xamarin 表单页面中添加了一个日期选择器。我面临的问题是在初始页面加载时,日期选择器在屏幕中占据的大小不会在更改日期时调整大小,如果我选择文本长度大于之前选择的日期。
例如,如果我最初选择了 2018 年 5 月 21 日的日期,如果我将日期更改为 2018 年 11 月 21 日,现在由于文本长度增加,全文不会显示在屏幕上。
请让我知道我该如何解决这个问题。
XAML:
<StackLayout Style="{StaticResource layoutListItem}">
<Label Style="{StaticResource labelStandard}" Text="From" HorizontalOptions="Start" />
<DatePicker Date="{Binding FromDateFilter}" TextColor="#777777" VerticalOptions="CenterAndExpand"
HorizontalOptions="EndAndExpand" MaximumDate="{Binding ToDateFilter}">
<DatePicker.Format>dd-MMMM-yyyy</DatePicker.Format>
<DatePicker.Effects>
<effects:EntryNoBorderEffect />
</DatePicker.Effects>
</DatePicker>
</StackLayout>
Run Code Online (Sandbox Code Playgroud)
初始加载:(日期范围 -> 从:2017 年 5 月 29 日)
更改时:(日期范围 -> 从:2017 年 11 月 29 日)
如何使用以下控件的xamarin控件从输入框删除边框。
<Entry Text="" />
Run Code Online (Sandbox Code Playgroud)
目前,我在文本框上看到一个细边框,在这里看不到要删除的任何border属性。
请让我知道如何禁用此功能。
我尝试使用以下代码在 xamarin 表单中启动警报框,但调用失败并出现以下异常。
private async void ProfileEmailAddressViewModel_UpdatedPersonalDetailsEvent(object source, UpdateEmployeePersonalDetailsCompletedEventArgs e)
{
try
{
if (e.Result)
{
await DisplayAlert("Alert", "You have been alerted", "OK");
}
}
catch (Exception ex)
{
throw ex;
}
}
Run Code Online (Sandbox Code Playgroud)
异常详细信息:System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> UIKit.UIKitThreadAccessException: UIKit Consistency error: you are calling a UIKit method that can only be invoked from the UI thread.
at UIKit.UIApplication.EnsureUIThread () [0x0001a] in /Library/Frameworks/Xamarin.iOS.framework/Versions/12.0.0.15/src/Xamarin.iOS/UIKit/UIApplication.cs:88
at UIKit.UIView.set_BackgroundColor (UIKit.UIColor value) [0x00000] in /Library/Frameworks/Xamarin.iOS.framework/Versions/12.0.0.15/src/Xamarin.iOS/UIKit/UIView.g.cs:2817
at Xamarin.Forms.Platform.iOS.Platform.PresentAlert …
如何使用 RGBA 的 Style 属性在 Xamarin 表单中设置颜色。尝试使用以下代码,但它不起作用。
<Setter Property="BackgroundColor" Value="RGBA(0,0,0,0.5)"></Setter>
Run Code Online (Sandbox Code Playgroud)
如果我将值更改为十六进制或颜色,它就可以工作。
<Setter Property="BackgroundColor" Value="#000000"></Setter>
Run Code Online (Sandbox Code Playgroud) 我正在尝试根据条件创建一个XAML UI.
<StackLayout Orientation="Horizontal">
<!--IF WorkEmailAddress != NULL && WorkEmailAddrress != ""-->
<!-- BEGIN IF -->
<Label Text="{Binding WorkEmailAddress}" Style="{StaticResource labelListItem}"></Label>
<Image HeightRequest="16" HorizontalOptions="End" VerticalOptions="Center" Source="arrow.png" Margin="0,0,15,0"></Image>
<!-- END IF -->
<!-- ELSE -->
<Label Text="Add new email" Style="{StaticResource labelLinkItem}">
</StackLayout>
Run Code Online (Sandbox Code Playgroud)
请问我可以告诉我如何在XAML中添加IF ELSE条件,以根据后端返回的值动态创建UI.