我有两个Labels StackPanel并Foreground为它们两个设置颜色......第二个显示为黑色,不应该.
<StackPanel HorizontalAlignment="Right" Orientation="Horizontal" Grid.Column="4" Grid.Row="0" Width="Auto" Margin="0,0,20,0">
<Label Content="{lex:LocText CGI, Suffix=:}" Foreground="#FFE0E0E0" FontSize="24" VerticalAlignment="Bottom" Margin="0,0,0,10" HorizontalAlignment="Right" />
<Label Content="{Binding Cgi}" ContentStringFormat="{}{0}%" Foreground="#FFE0E0E0" FontSize="24" VerticalAlignment="Bottom" Margin="0,0,0,10" HorizontalAlignment="Right" />
</StackPanel>
Run Code Online (Sandbox Code Playgroud)
有什么我做错了吗?
我对以下查询存在严重问题.
context.CharacteristicMeasures
.FirstOrDefault(cm => cm.Charge == null &&
cm.Characteristic != null &&
cm.Characteristic.Id == c.Id &&
cm.Line != null &&
cm.Line.Id == newLine.Id &&
cm.ShiftIndex != null &&
cm.ShiftIndex.Id == actShiftIndex.Id &&
(newAreaItem == null ||
(cm.AreaItem != null &&
cm.AreaItem.Id == newAreaItem.Id)));
Run Code Online (Sandbox Code Playgroud)
TargetException: Non-static method requires a target 当newAreaItem为null时,我得到一个.如果newAreaItem不为null,我得到一个NotSupportedException: Unable to create a constant value of type 'PQS.Model.AreaItem'. Only primitive types or enumeration types are supported in this context.
我已经检查过它们是否为null:c,newLine,actShiftIndex所有3个变量都不为空且可以访问Id.
我不明白......请帮忙.
如果你需要更多信息..不要犹豫,问...
UPDATE
我可以消除NotSupportedException,但是当newAreaItemIsNull为true时我仍然得到了TargetException ..:/
bool …Run Code Online (Sandbox Code Playgroud) 我尝试ApiController在我的后端Web API中读取一个语言cookie(我在客户端上设置),如下所示:
var cookieHeaderValue = Request.Headers.GetCookies("lang").FirstOrDefault();
Run Code Online (Sandbox Code Playgroud)
我的请求标题如下所示:

也行
Request.Headers.GetCookies();
Run Code Online (Sandbox Code Playgroud)
返回一个空集合......任何人都可以告诉我为什么以及我能对它做些什么?请帮忙
我想渲染我的页面并在evaluate函数中退出PhantomJS,因为我想在触发特定事件时触发它.
我尝试过这样的事情:
page.evaluate(page, function (page, phantom) {
//do some stuff on my page
//i want to execute this in an eventhandler of my page though thats not the problem
page.render('imgName.png');
page.render('pdfName.pdf');
phantom.exit();
}, page, phantom);
Run Code Online (Sandbox Code Playgroud)
这在我的示例中不起作用,因为page.render似乎未定义.也许有一个参数的序列化器不是序列化obj的函数?
这甚至可能吗?有谁知道我的问题的解决方案?
我知道我可以在我的evaluate函数中设置一个while循环并阻止它终止并在之后执行此页面渲染内容.我不喜欢这样.
我必须在C#中创建一个MetroApp前端.
我有一个OverviewPage,我得到了GridView一个详细页面的预览.我在下面的主题中更详细地描述了它和截图:
WinRT XamlControl预览图像
我从外部库中获取我在DetailPage中显示的Content-Panel.
因为我想在我的OverviewItems中预览DetailPage,我必须Panel在我的内容中显示相同内容GridView Items.
当我点击Item它导航我到DetailPage时,当我尝试将Panel添加到我的DetailPage时,我得到以下错误:值不在预期范围内.
我想这是因为我的VisualTree中已经有一个名字相同的Panel?!这个假设是对的吗?Panel包含一个带有一些xaml元素的Canvas和ontlick-Event-triggers就可以了.
我该怎么做才能解决这个问题?我不知道如何继续......:/
如果您需要更多信息 - 请咨询.
在我的方法中,RecalcChartAsync我做了一些时间密集的东西..所以我想我会做一些事情异步.
我想开始这两个方法CreateHistogramAsync CalculatePropValuesAsync,同时在我做一些东西RecalcChartsAsync,最后等待它完成.
private async void RecalcChartsAsync()
{
var histogram = CreateHistogramAsync();
var propValues = CalculatePropValuesAsync();
//do some other stuff
await histogram;
await propValues;
}
private async Task CreateHistogramAsync()
{
//do some stuff
}
private async Task CalculatePropValuesAsync()
{
//do some stuff
}
Run Code Online (Sandbox Code Playgroud)
我不确定我是否采用正确的方式,因为ReSharper在CreateHistogramAsync和CalculatePropValueAsync的异步关键字上给出了以下警告:
这种异步方法缺少"等待"运算符并将同步运行.考虑使用await运算符等待非阻塞API调用,...
现在我不确定我是否以正确的方式使用这个异步的东西.
c# ×3
.net ×1
.net-4.5 ×1
asp.net ×1
async-await ×1
colors ×1
foreground ×1
javascript ×1
linq ×1
phantomjs ×1
web-services ×1
winrt-xaml ×1
wpf ×1