我想在我的服务中添加一个Action Filter来处理向响应消息添加链接数据.我发现我需要模拟HttpActionExecutedContext,但这是一个很难模拟的类,你如何处理Action Filter测试?
我有一个在LightSwitch 2012项目中制作的模态窗口,我一直试图找到一种方法来删除右上角的(x)来关闭它.要么是某种方法还是某种方法我可以编辑以改变它的某些功能以更好地适应我的需要?
我对 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)