小编Yan*_*ran的帖子

如何在ASP.NET Web Api中对Action Filter进行单元测试?

我想在我的服务中添加一个Action Filter来处理向响应消息添加链接数据.我发现我需要模拟HttpActionExecutedContext,但这是一个很难模拟的类,你如何处理Action Filter测试?

.net unit-testing action-filter asp.net-web-api

52
推荐指数
5
解决办法
3万
查看次数

在LightSwitch中,如何删除模态窗口右上角的(x)?或改变它的功能?

我有一个在LightSwitch 2012项目中制作的模态窗口,我一直试图找到一种方法来删除右上角的(x)来关闭它.要么是某种方法还是某种方法我可以编辑以改变它的某些功能以更好地适应我的需要?

c# visual-studio-lightswitch

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

GroupStyle 和 Expander.IsExpanded 绑定的问题

我对 GroupStyle 和 Expander.IsExpanded 绑定有疑问。我的代码基于这个答案:How to save the IsExpanded state in group headers of a listview from @user1。我无法对此答案发表评论,因为我的声誉不够高,所以这就是我提出这个新主题的原因。

在我的 ListView 中,我有以下代码:

<!-- Group Container Style -->
<ListView.GroupStyle>
    <GroupStyle>
        <GroupStyle.ContainerStyle>
            <Style TargetType="{x:Type GroupItem}">
                <Setter Property="Margin" Value="0,0,0,5"/>
                <Setter Property="Template">
                    <Setter.Value>
                        <ControlTemplate TargetType="{x:Type GroupItem}">
                            <Expander IsExpanded="{Binding Path=Items[0].bIsExpandedGroup}">
                                <Expander.Header>
                                    <DockPanel>
                                        <TextBlock FontWeight="Bold"
                                            Style="{StaticResource DefaultTextBlockItemStyle}"
                                            Text="{Binding Path=Name}"
                                            />
                                    </DockPanel>
                                </Expander.Header>
                                <Expander.Content>
                                    <ItemsPresenter />
                                </Expander.Content>
                            </Expander>
                        </ControlTemplate>
                    </Setter.Value>
                </Setter>
            </Style>
        </GroupStyle.ContainerStyle>
    </GroupStyle>
</ListView.GroupStyle>
Run Code Online (Sandbox Code Playgroud)

属性“bIsExpandedGroup”绑定在 DTO_Package 上(绑定到 ListView 的对象)

public class DTO_Package : ViewModelBase
{
    (...) …
Run Code Online (Sandbox Code Playgroud)

c# wpf xaml mvvm

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