在我的申请中,我有一个ListBox
项目.该应用程序是用WPF编写的.
如何自动滚动到最后添加的项目?我希望在ScrollViewer
添加新项目时将其移动到列表的末尾.
有什么事ItemsChanged
吗?(我不想使用这个SelectionChanged
活动)
问候,我在db中有一些文本,它如下:
Lorem ipsum dolor坐下来,精致的adipistur elit.Duis tellus nisl,venenatis et pharetra ac,tempor sed sapien.整齐的pellentesque blandit velit,在tempus urna semper坐下来.Duis mollis,libero ut consectetur interdum,massa tellus posuere nisi,eu aliquet elit lacus nec erat.赞美商品.**[a href =' http ://somesite.com']某个网站[/ a]**在新西兰的Suspendisse坐在amet massa molestie gravida feugiat ac sem.Phasellus ac mauris ipsum,vel auctor odio
我的问题是:我怎样才能显示Hyperlink
一个TextBlock
?我不想为此目的使用webBrowser控件.我不想使用此控件之一:http://www.codeproject.com/KB/WPF/htmltextblock.aspx也
我希望我的div的左边框只显示div的一半.我想对我的右边界做同样的事情,但是应该从div的底部到div的中间设置.我怎样才能实现它?
问候,我正在用C#开发一些应用程序.目前我正在处理线程,我有一个问题,我在脑海里.Invoke和BeginInvoke有什么区别?我读了一些帖子,我在这里找到了一些有用的信息:这里
但是,以下代码中的Invoke和BeginInvoke之间有什么区别:
private void ProcessRoutine()
{
for (int nValue = StartFrom; nValue <= EndTo; nValue++)
{
this.Invoke(this.MyDelegate, nValue);
//this.BeginInvoke(this.MyDelegate, nValue);
}
MessageBox.Show("Counting complete!");
}
private void MessageHandler(int progress)
{
lblStatus.Text = lblStatus.Text = "Processing item: " + progress.ToString();
progressBar1.Value = progress;
}
Run Code Online (Sandbox Code Playgroud)
其中MyDelegate是对MessageHandler函数的引用.
我注意到使用BeginInvoke lblStatus.Text没有刷新,使用Invoke刷新标签.另外我知道Invoke等待它的执行完成.我感兴趣的最重要的案例是为什么在这种情况下刷新标签文本会有所不同.
问候,当我尝试为我的工厂设置凭证时,问题是:
ChannelFactory<IWCFSeekService> factory = Factory;
if (factory != null)
{
factory.Credentials.UserName.UserName = CServiceCredentials.Instance.Username;
_Channel = factory.CreateChannel();
}
Run Code Online (Sandbox Code Playgroud)
我得到一个异常,即对象是只读的.当我想设置用户名时会发生这种情况.
问候,
今天在我开始处理我的应用程序之前,我更新了我的WinXP.安装完所有更新后,我的WCF服务停止工作.当我尝试在浏览器中打开service.svc文件时出现以下错误:
Configuration Error
Description: An error occurred during the processing of a configuration file required to service this request. Please review the specific error details below and modify your configuration file appropriately.
Parser Error Message: An error occurred creating the configuration section handler for system.serviceModel/bindings: Could not load type 'System.Security.Authentication.ExtendedProtection.Configuration.ExtendedProtectionPolicyElement' from assembly 'System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'.
Source Error:
Line 131: </behaviors>
Line 132:
Line 133: <bindings>
Line 134: <wsHttpBinding>
Line 135: <binding name="MyWSHttpBinding" maxReceivedMessageSize="2147483647">
Run Code Online (Sandbox Code Playgroud)
我的同事试图在更新之前运行相同的服务,它工作正常.安装更新后,他遇到了同样的问题.有人可以帮帮我吗?
问候,我正在使用jsTree来生成我的分层数据.JsTree生成如下:
$(function() {
$("#industries").tree({
data: {
type: "json",
opts: {
url: "/Admin/GetIndustries/"
}
}
});
});
Run Code Online (Sandbox Code Playgroud)
它的工作原理和jsonresult是这样的:
[{"attributes":[],"data":{"title":"Adwokaci, Notariusze","id":"1a051101-c3fa-48f2-b2e1-c60d1b67ea22"},"children":[{"attributes":[],"data":{"title":"Kancelarie adwokackie","id":"26d6cff1-3c7f-4a2f-bf5a-422e08127b43"
Run Code Online (Sandbox Code Playgroud)
我的问题是:如何在某些隐藏字段中保存所选节点的ID?我做这样的事情:
<script type="text/javascript">
$("#industries").click(function() {
var tree = $.tree.reference("industries");
var t = $.tree.focused(); if (t.selected) t.selected; else alert("Select a node first");
alert(t.id);
});
Run Code Online (Sandbox Code Playgroud)
但它不起作用.我进入警报窗口"未定义".有人可以帮帮我吗?
编辑: 我已经更改了jstree实例,如下所示:
$(function() {
$("#industries").tree({
callback: {
onselect: function(NODE, TREE_OBJ) {
alert(NODE.id);
}
},
data: {
type: "json",
opts: {
url: "/Admin/GetIndustries/"
}
}
});
});
Run Code Online (Sandbox Code Playgroud)
我得到空洞的警觉
我想知道你如何决定何时使用converters
以及何时使用triggers
.我更喜欢在GUI上使用触发器来操作(比如显示/隐藏控件,改变它们的外观等).
前段时间我使用了一个BooleanToVisibilityConverter
用于此目的,但现在,我只是不需要它,我做所有与visibility
使用触发器相关的事情,我甚至开始思考" 由MS团队创建一个目的是什么BooleanToVisibilityConverter
?" .通常,当我有可能尝试使用声明方式编写代码时 - 在本例中 - XAML.
你对此有何看法?
我正在开发一个Intranet asp.net核心Web API应用程序。身份验证的要求是:
现在,我到目前为止:
我正在使用Claims Middlewere来检查用户的Active Directory组,让我们说这样的话:
public class ClaimsTransformer : IClaimsTransformation {
private readonly IAuthorizationService _authorizationService;
public ClaimsTransformer(IAuthorizationService authorizationService)
{
_authorizationService = authorizationService;
}
public Task<ClaimsPrincipal> TransformAsync(ClaimsPrincipal principal)
{
_authorizationService.Authorize(principal as IHmiClaimsPrincipal);
return Task.FromResult(principal);
}}
Run Code Online (Sandbox Code Playgroud)我还在服务配置中指定了特殊策略,例如:
services.AddAuthorization(options => { options.AddPolicy(“ TestPolicy”,策略=> policy.RequireClaim(ClaimTypes.Role,“ TestUser”)); options.AddPolicy(“ TestPolicy2”,策略=> policy.RequireClaim(ClaimTypes.Role,“ SuperUser”)); });
我将 [Authorize]
属性与特定策略结合使用,以便基于策略限制对特定资源的访问
现在的问题是,我应该如何满足REQ3?