在发布我的XBAP应用程序之后,我丢失了所有(或部分) TextBlocks。看起来是这样的:

按钮应该贴上标签,主屏幕上应该有各种各样的TextBlocks。
让事情变得更奇怪:
有什么原因吗?如果您需要更多的信息,请询问!谢谢!
编辑:,我做了一个小项目来重现这个bug。您可以找到它发布的这里。请注意,这个bug似乎只影响到.NET 4.0。
从WPF浏览器应用程序开始,这是我在Page1.xaml中的代码
<Page x:Class="BugDemo.Page1"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" >
<Grid x:Name="LayoutRoot">
<TextBlock FontSize="35" Text="Vanishing Text" />
<Grid.LayoutTransform>
<ScaleTransform />
</Grid.LayoutTransform>
</Grid>
</Page>CodeBehind:
public partial class Page1 : Page
{
public Page1()
{
InitializeComponent();
this.Loaded += AppPage_Loaded;
}
public double Scale
{
get { return ((ScaleTransform)this.LayoutRoot.LayoutTransform).ScaleX; }
set
{
((ScaleTransform)this.LayoutRoot.LayoutTransform).ScaleX = value;
((ScaleTransform)this.LayoutRoot.LayoutTransform).ScaleY = value;
}
}
void AppPage_Loaded(object sender, RoutedEventArgs e)
{
App.Current.MainWindow.SizeChanged += (o, args) => UpdateScale();
UpdateScale();
}
private void UpdateScale()
{
double xscale = (App.Current.MainWindow.ActualWidth) / 300;
double yscale = (App.Current.MainWindow.ActualHeight) / 200;
Scale = Math.Min(xscale, yscale);
}
}发布后,“消失文本”只能在一定程度上被看到。它在调试中很好用。
发布于 2010-11-15 13:38:37
这似乎是IE9.0测试版中的一个bug。回到IE8.0,解决了这个问题。
https://stackoverflow.com/questions/4166114
复制相似问题