小编Mic*_*ael的帖子

如何禁用GridView中的单个项目选择

如何禁用GridView中的选择单项?

我有一个GridView,它的ItemsSource绑定到IEnumerable <SampleDataItem>.我希望能够以编程方式不允许选择列表中的某些项目,同时允许选择其他项目.

windows-8 windows-runtime winrt-xaml

6
推荐指数
2
解决办法
5011
查看次数

Fiddler看不到asp.net mvc应用程序之间的HTTP流量

我有一个ASP.NET MVC 4应用程序,需要查询另一个应用程序来处理请求.MVC应用程序通过REST提出请求.我可以看到从浏览器到MVC应用程序的传入HTTP请求,但是我看不到从MVC应用程序到REST应用程序的出站REST调用.

这两个应用程序都在IIS Express中运行.我访问MVC应用程序localhost:42001,REST应用程序使用ASP.NET MVC WebAPI,在localhost:42002监听

如何获取进入localhost:42002的REST请求?

请求正在进入REST应用程序,我也可以设置并命中该代码中的断点.我只是看不到Fiddler的流量.

asp.net asp.net-mvc fiddler

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

Metro XAML - TemplateBinding和SolidColorBrush的问题

这是一个简单的自定义控件来说明我的问题

public sealed class TestControl : Control
{
    public static DependencyProperty TestColorProperty = DependencyProperty.Register("TestColor", typeof(Brush), typeof(TestControl), new PropertyMetadata(new SolidColorBrush(Colors.Blue)));

    public Brush TestColor
    {
        get { return (Brush)GetValue(TestColorProperty); }
        set { SetValue(TestColorProperty, value); }
    }

    public TestControl()
    {
        this.DefaultStyleKey = typeof(TestControl);
    }
}
Run Code Online (Sandbox Code Playgroud)

如您所见,它具有单个Brush依赖项属性,默认值为Blue(PropertyMetaData如上所示设置).

这是我控制的XAML Generic.xaml

<Style TargetType="local:TestControl">
        <Setter Property="TestColor" Value="Red" />
        <Setter Property="Template">
        <Setter.Value>
            <ControlTemplate TargetType="local:TestControl">
                <Border
                    Background="{TemplateBinding TestColor}"
                    BorderBrush="{TemplateBinding BorderBrush}"
                    BorderThickness="{TemplateBinding BorderThickness}">
                        <TextBlock Text="TEST"  />
                </Border>
            </ControlTemplate>
        </Setter.Value>
    </Setter>
</Style>
Run Code Online (Sandbox Code Playgroud)

如您所见,我在设置器中将TestColorBrush依赖项属性设置为Red …

xaml microsoft-metro windows-8 windows-runtime winrt-xaml

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

在SuspensionManager.SessionState中存储字符串以外的内容

示例应用程序包括一个Suspension Manager类,它将会话状态存储在Dictionary中,但从不尝试存储除字符串之外的任何内容.

每当我存储除字符串之外的任何其他内容,然后触发序列化,我得到以下错误

键入'System.RuntimeType',数据协定名称为'RuntimeType:http://schemas.datacontract.org/2004/07/System',不是预期的.考虑使用DataContractResolver或将任何静态未知的类型添加到已知类型列表中 - 例如,通过使用KnownTypeAttribute属性或将它们添加到传递给DataContractSerializer的已知类型列表中.

我是否必须做其他事情才能在SessionState中存储其他类型?

windows-8 windows-runtime

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