我有一个ListBox
显示WPF控件列表.我的问题是垂直滚动条显示,但即使有足够的项目ListBox
应该可滚动,也会被禁用.另一个可能相关的事实是,它包含在一个Integration.ElementHost
.
吉姆,WPF noobie
以下是XAML ListBox
:
// for brevity I removed the Margin and Tooltip attributes
<Grid x:Class="Xyzzy.NoteListDisplay"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<StackPanel Name="stackPanel" Orientation="Vertical"
ScrollViewer.VerticalScrollBarVisibility="Visible">
<StackPanel Orientation="Horizontal">
<CheckBox Name="AllRecent" IsChecked="False" >View All Recent</CheckBox>
<CheckBox Name="AscendingOrder" IsChecked="False">Descending Order</CheckBox>
<Button Name="btnTextCopy" Click="btnCopyText_Click">Copy All</Button>
</StackPanel>
<ListBox Name="NoteList"
ScrollViewer.CanContentScroll="True"
ScrollViewer.VerticalScrollBarVisibility="Visible">
</ListBox>
</StackPanel>
</Grid>
Run Code Online (Sandbox Code Playgroud)
并在每个ListBox
项目中显示控件的XAML :
<UserControl x:Class="Xyzzy.NoteDisplay"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<Grid>
<StackPanel Orientation="Vertical">
<StackPanel Orientation="Horizontal">
<TextBlock Name="Heading" FontSize="10">Note Heading</TextBlock>
<Button Name="btnCopyText" Height="20" FontSize="12"
Click="btnCopyText_Click">Copy
</Button>
</StackPanel>
<TextBlock Name="Body" …
Run Code Online (Sandbox Code Playgroud) 我创建了一个小型Silverlight 4.0/RIA Services应用程序并对其进行了测试.我在家里的机器上开发了应用程序,需要将它移动到工作中的生产域.我通过将其推送到源存储库然后将其克隆到工作中的开发机器来完成此操作.它在两个位置都没有错误地构建.
当我尝试在新位置进行调试时,会出现此问题.在域上下文的第一个'Load()'方法我得到以下错误:
The provided URI scheme 'file' is invalid expected 'http'
Run Code Online (Sandbox Code Playgroud)
我得到调试器试图使用基于文件的URI而不是HTTP URI运行.但为什么?我该如何解决?
搜索SO返回了一些关于无效URI方案的类似错误,但是没有它们帮助我解决了这个特定的问题.
谢谢,吉姆
我为数据库中的存储过程生成了一整套脚本.当我创建Mercurial存储库并添加这些文件时,它们都被添加为二进制文件.显然,我仍然可以获得版本控制的好处,但是会失去很多效率,"差异化"等文本文件.我确认这些文件确实只是文本.
它为什么这样做?
我该怎么做才能避免它?
有没有办法让Hg改变它对这些文件的看法?
以下是变更集日志的片段:
496.1 Binary file SQL/SfiData/Stored Procedures/dbo.pFindCustomerByMatchCode.StoredProcedure.sql has changed
497.1 Binary file SQL/SfiData/Stored Procedures/dbo.pFindUnreconcilableChecks.StoredProcedure.sql has changed
498.1 Binary file SQL/SfiData/Stored Procedures/dbo.pFixBadLabelSelected.StoredProcedure.sql has changed
499.1 Binary file SQL/SfiData/Stored Procedures/dbo.pFixCCOPL.StoredProcedure.sql has changed
500.1 Binary file SQL/SfiData/Stored Procedures/dbo.pFixCCOrderMoneyError.StoredProcedure.sql has changed
Run Code Online (Sandbox Code Playgroud)
在此先感谢您的帮助吉姆
我正在尝试使用 reqwest 库并遵循我在网上各个地方找到的模式来发帖:
let res = http_client.post(&url)
.header("Content-Type", "application/x-www-form-urlencoded")
.form(&form_data)
.send()
.await?;
println!("authenticate response: {}", res.status)
Run Code Online (Sandbox Code Playgroud)
上面的代码块导致编译错误:
`?` couldn't convert the error to `std::io::Error` the trait `
`std::convert::From<reqwest::error::Error>` is not implemented for `std::io::Error`
Run Code Online (Sandbox Code Playgroud)
我不明白为什么我会收到这个错误。我已经使我的代码尽可能接近示例。如果我删除?
和res.status
. 但我需要获取状态res.status
值。更重要的是,我需要了解我遗漏了什么或做错了什么。
我正在使用Hammock框架从Silverlight应用程序到Rest服务进行异步服务调用.在'完成'回调中,我正在更新一个ObservableCollection,它绑定到视图上的组合框.
"OnPropertyChanged"事件处理程序中抛出了"无效的跨线程访问"异常.
这是因为Hammock没有在UI线程上执行回调吗?如果没有,为什么不呢?这似乎是框架应该处理的功能.我错过了什么吗?我确定不想在每个完成的处理程序中自己处理UI线程的调用.
public void LoadMyData()
{
var request = new RestRequest();
request.Path = "MyRestUrlText";
var callback = new RestCallback(
(restRequest, restResponse, userState) =>
{
var visibleData = new ObservableCollection<MyDataType>();
var myData = JsonConvert.DeserializeObject<MyDataType[]> restResponse.Content);
foreach (var item in myData)
visibleData .Add(item);
this.MyBoundCollection = visibleData;
OnPropertyChanged("MyBoundCollection");
});
var asyncResult = _restClient.BeginRequest(request, callback);
}
Run Code Online (Sandbox Code Playgroud)
谢谢
我有一个 UserControl,其中包含两个需要在运行时绑定到它们的不同 UserControl 视图的 ContentControl。此处提到的附加属性解决方案在 Silverlight 中似乎不起作用。或者,我做错了什么。我也发现了这个,但它也没有带来任何快乐。
我通过将其命名为“ActiveItem”来使单个 ContentControl 工作。但是,当然,我不能有两个同名的 ContentControl。
在此先感谢您的帮助,
吉姆
silverlight mvvm contentcontrol silverlight-4.0 caliburn.micro