在Windows Server 2003 WPF问题 [英] WPF issues with Windows Server 2003

查看:188
本文介绍了在Windows Server 2003 WPF问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个WPF应用程序奇怪的问题。我窗口Server 2003的部署下,它和它的行为是不同的比较Win7的。

I'm having strange issues with a WPF application. I've deployed it under Window Server 2003 and its behavior is different compares to Win7.

例如我有这样的XAML的:

For example I have this kind of XAML :

<GroupBox x:Name="groupbox1">
      <GroupBox.Style>
          <Style BasedOn="{StaticResource {x:Type GroupBox}}" TargetType="{x:Type GroupBox}">
             <Style.Triggers>
                <DataTrigger Binding="{Binding IsModel, UpdateSourceTrigger=PropertyChanged}" Value="True">
                                    <Setter Property="Visibility" Value="Collapsed" />
                </DataTrigger>
              </Style.Triggers>
          </Style>
      </GroupBox.Style>

它的工作原理就像一个Win7的魅力,但Windows Server 2003上不工作的时候,我的组框始终可见性属性设置为可见。

It works like a charm on Win7, but on Windows Server 2003 it doesn't work at all and my groupbox has always the Visibility property set to Visible.

像扩展某些控件也显示有所不同。

Some controls like the Expander is also displayed differently.

2003的WS的配置是:

The configuration of WS 2003 is :


  • WS 2003 SP2

  • 的Microsoft .NET Framework 3.5 SP1

如果任何人都可以给我一个提示这个问题这将是一个很大的帮助!

If anyone can give me a hint about this issue it would be a great help !

感谢。

推荐答案

我也工作的Windows 2003 Server计算机上。我没有这个问题。我试着在Kaxaml有点不同code。尝试一下。如果您的问题消失了,这意味着该问题绑定到的DataContext的财产IsModel。

I work also on Windows 2003 Server machine. I don't have this issue. I've tried a bit different code in Kaxaml. Try it. If your issue is gone that means the problem with binding to datacontext's property IsModel.

<Page xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
    <StackPanel>
      <CheckBox x:Name="Check" Content="Check it to hide GroupBox" />
        <GroupBox x:Name="groupbox1" Header="Group">
            <GroupBox.Style>
                <Style BasedOn="{StaticResource {x:Type GroupBox}}" TargetType="{x:Type GroupBox}">
                    <Style.Triggers>
                        <DataTrigger Binding="{Binding ElementName=Check, Path=IsChecked, UpdateSourceTrigger=PropertyChanged}" Value="True">
                            <Setter Property="Visibility" Value="Collapsed"/>
                        </DataTrigger>
                    </Style.Triggers>
                </Style>
            </GroupBox.Style>
            <TextBlock Text="Some GroupBox content" />
        </GroupBox>
    </StackPanel>
</Page>

这篇关于在Windows Server 2003 WPF问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆