小编kod*_*use的帖子

WPF:带有WrapPanel的ListBox,垂直滚动问题

我有一个UserControl(下面的XAML),它有一个ListBox,我想在WrapPanel中显示图像,其中图像显示的数量适合一行,然后换行到下一行等.它工作,除了ListBox增长高于窗口中的可用空间,我没有得到垂直滚动条,即内容被剪切.如果我在ListBox上设置固定高度,滚动条将出现并按预期工作.如何让此列表框增长到可用空间,然后显示垂直滚动条?此控件位于主窗口中Grid内的StackPanel内.如果我将StackPanel包装在ScrollViewer中,我会得到我之后的滚动条,但如果我想在ListBox上方的UserControl中添加更多控件(例如图像大小"缩放"等),这不是一个很好的解决方案不希望他们滚动图像.

谢谢!!:)

<UserControl x:Class="GalleryAdmin.UI.GalleryView"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
    <ListBox Name="itemListBox" BorderThickness="0" ItemsSource="{Binding}" ScrollViewer.HorizontalScrollBarVisibility="Disabled">
        <ListBox.ItemTemplate>
            <DataTemplate>
                <StackPanel Background="LightGray" Margin="5" >
                    <StackPanel Margin="5">
                        <Image Source="{Binding Path=LocalThumbPath}" Height="100" />
                        <TextBlock Text="{Binding Path=Name}" TextAlignment="Center"></TextBlock>
                    </StackPanel>
                </StackPanel>
            </DataTemplate>
        </ListBox.ItemTemplate>
        <ListBox.ItemsPanel>
            <ItemsPanelTemplate>
                <WrapPanel />
            </ItemsPanelTemplate>
        </ListBox.ItemsPanel>
    </ListBox>
Run Code Online (Sandbox Code Playgroud)

wpf listbox wrappanel scrollbar

23
推荐指数
3
解决办法
4万
查看次数

SQL Server性能和完全限定的表名

似乎公平地认为在查询中包含模式所有者会增加db性能,例如:

SELECT x FROM [dbo].FooVS SELECT x FROM Foo.

这应该保存查找,因为SQL Server将在连接上下文中查找属于该用户的Foo表.

今天我被告知,即使您查询在连接字符串中选择的数据库,始终包含数据库名称也会以相同的方式提高性能:

SELECT x FROM MyDatabase.[dbo].Foo
Run Code Online (Sandbox Code Playgroud)

有没有道理呢?这作为编码标准是否有意义?这些(甚至是第一个例子)中的任何一个都能转化为可衡量的收益吗?

我们是在讨论数据库服务器上额外字典查找的几个周期与Web服务器(或其他客户端)上更臃肿的SQL和额外连接吗?

sql-server performance

8
推荐指数
1
解决办法
1万
查看次数

IIS7 + PHP + HTTP POST =挂起?

我通过Windows Web App Gallery在带有IIS7的Windows 7 x64计算机上安装了PHP.一切似乎都很好,一个简单的phpinfo()页面就像你想象的那样.但是,每当我对PHP页面发出POST请求时,请求就会永远挂起.请参阅下面非常简单的测试页面...它甚至没有任何动态内容.

我浪费了太多时间在这上面.有任何想法吗?谢谢你!

page.php文件:

<html>
 <body>
  <form action="page.php" method="post">
   <textarea name="apa"></textarea>
   <input type="submit" value="ok" />
  </form>
 </body>
</html>
Run Code Online (Sandbox Code Playgroud)

处理程序映射:

<handlers>
        <add name="PHP_via_FastCGI" path="*.php" verb="*" modules="FastCgiModule" scriptProcessor="C:\Program Files (x86)\PHP\php-cgi.exe" resourceType="Either" requireAccess="Script" />
</handlers>
Run Code Online (Sandbox Code Playgroud)

php windows iis iis-7 http-post

6
推荐指数
1
解决办法
3323
查看次数

IE兼容模式可以使用多长时间?

不幸的是,我们在工作中有一个庞大的遗留Web应用程序,我们无法摆脱它.它仅适用于IE,完全依赖于"X-UA兼容:IE = EmulateIE8"才能在较新的IE版本中正常工作.

我的问题是,这可能有一天突然停止工作.即,IE12(或13或14)有一天会出来并使该网站无用,因为它不再打扰兼容模式了吗?

如果是这样,管理层不希望听到它,但越早做,越好.

internet-explorer backwards-compatibility roadmap internet-explorer-8 compatibility-mode

6
推荐指数
1
解决办法
1904
查看次数

OpenIdConnectAuthenticationOptions and AcquireTokenByAuthorizationCodeAsync: Invalid JWT token

I'm trying to authorization code, and then hopefully a refresh token, with the OWIN OIDC middleware. However, I'm getting this error: Microsoft.IdentityModel.Clients.ActiveDirectory.AdalServiceException: 'AADSTS50027: Invalid JWT token. AADSTS50027: Invalid JWT token. Token format not valid. Trace ID: 8622dfea-05cd-4080-a52c-ec95a9593800 Correlation ID: 1cf57566-1e02-4856-a4bc-357d5b16ae8a

Note that the authentication part works: I do get the original IdToken back, and the SecurityTokenValidated Notifications event fires. The error above occurs on the "AcquireTokenByAuthorizationCodeAsync" line.

我想做的是将IdentityServer用作Azure AD(上游)和客户端(下游)之间的IdP,当客户端尝试使用下游刷新令牌时,我需要捕获刷新令牌以针对AAD进行验证,因此当AAD用户被锁定或删除时,我不会发出访问令牌。

var authority = "https://login.microsoftonline.com/xxx.onmicrosoft.com/v2.0";
var clientId = "xxx-30f5-47c2-9ddb-b5fcfd583f96";
var redirectUri = …
Run Code Online (Sandbox Code Playgroud)

oauth-2.0 owin azure-active-directory adal openid-connect

3
推荐指数
1
解决办法
2080
查看次数