WPF FontSize style hanging issue

Shred

Expert Member
Company Rep
Joined
Jul 12, 2006
Messages
1,736
So, I have this issue and I have got to a point where I just can't seem to solve this problem. To cut a long story short, I narrowed down my WPF hanging issue to a simple thing which is a FontSize in a style.

This code below does not work on my desktop, but does on my laptop.

<Window x:Class="WpfApplication1.Window1"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="Window1" Height="300" Width="300">
<Window.Resources>
<ResourceDictionary>
<Style x:Key="s1" TargetType="{x:Type TextBlock}">
<Setter Property="FontSize" Value="10"></Setter>
</Style>
</ResourceDictionary>
</Window.Resources>
<Grid>
<TextBlock Text="adfasdf" Style="{StaticResource s1}"></TextBlock>
</Grid>
</Window>

As you can see, there is nothing fancy at all. And Google does not know the answer either.

Has anyone on this earth had this issue before? Any help would be much appreciated
 

MielieSpoor

Expert Member
Joined
Dec 6, 2006
Messages
1,984
Sorry mate, but it works on my side. I cannot see any issue. Do you have Blend installed on your desktop - if you do, does it work in blend? Are you sure that your VS installation 100% fine and it doesn't have any package load issues?
 

Shred

Expert Member
Company Rep
Joined
Jul 12, 2006
Messages
1,736
Sorry mate, but it works on my side. I cannot see any issue. Do you have Blend installed on your desktop - if you do, does it work in blend? Are you sure that your VS installation 100% fine and it doesn't have any package load issues?

I do have blend, let me try it in there.

I thought it was a VS problem so what I did was completely uninstall VS and ran the .exe with the same result. So it must be an issue with my machine and the framework.
 

MielieSpoor

Expert Member
Joined
Dec 6, 2006
Messages
1,984
Yeah something on your system is not liking something else on the system. Try to uninstall all the components that ship with VS2008 - including the framework.
 

Shred

Expert Member
Company Rep
Joined
Jul 12, 2006
Messages
1,736
Yeah something on your system is not liking something else on the system. Try to uninstall all the components that ship with VS2008 - including the framework.

Ja I will try that, thanks man.
 

Shred

Expert Member
Company Rep
Joined
Jul 12, 2006
Messages
1,736
Just by the way, it works if it is compiled with .NET Framework 4.0 on the same machine :(
 

Shred

Expert Member
Company Rep
Joined
Jul 12, 2006
Messages
1,736
Took theme off, same result.

I am actually using VS 2008 but to give perspective...

In VS2010 when I set the framework version to 3.5 it hangs. Close it down, open it up, set it to 4.0 and run it and it works. Further more, the designer in 2010 renders the window, 2008 not, I am assuming that 2010's WPF designer actually uses 4.0 anyway. I have tried and tried to reinstall the framework, but when I run it on Win 7 it just closes after it extracts the files to temp directory.

Geez this is killing me :(
 

FarligOpptreden

Executive Member
Joined
Mar 5, 2007
Messages
5,396
That was a little confusing... Who asked the question on SO? Did you dequadin, or does Shred incidentally have the same name as you? :p
 

FarligOpptreden

Executive Member
Joined
Mar 5, 2007
Messages
5,396
I asked the question, perhaps we have the same "real" names?

That was my initial thought... Geez - there are waaaaaaaay to many [Shred/dequadin/buddy-of-mine-and-future-colleage]s in the .NET development world! :eek:
 

FarligOpptreden

Executive Member
Joined
Mar 5, 2007
Messages
5,396
...and why not? Any self-respecting developer should be on there by now, methinks. ;)

I agree, even if it's not to ask/answer questions. If I find a solution to something on SO via Google, I normally sign-in and vote the answer up...

I know, I know... I need to register there and get involved. I also mostly find my solutions on there and sometimes know the answer to questions as well...
 

Raithlin

Executive Member
Joined
Jan 4, 2005
Messages
5,049
I know, I know... I need to register there and get involved. I also mostly find my solutions on there and sometimes know the answer to questions as well...

...even more reason to get involved! I pop in every now and then to check up on any questions that I may be able to help with - and I'm finding more answers there of late, too. Like dequadin said, it helps to up-vote the answer (and sometimes the question!) to give back to the community.

Funny enough, I haven't posted a question myself yet, I think. :erm:
 

mister

Executive Member
Joined
Jul 21, 2008
Messages
9,157
So, I have this issue and I have got to a point where I just can't seem to solve this problem. To cut a long story short, I narrowed down my WPF hanging issue to a simple thing which is a FontSize in a style.

This code below does not work on my desktop, but does on my laptop.

<Window x:Class="WpfApplication1.Window1"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="Window1" Height="300" Width="300">
<Window.Resources>
<ResourceDictionary>
<Style x:Key="s1" TargetType="{x:Type TextBlock}">
<Setter Property="FontSize" Value="10"></Setter>
</Style>
</ResourceDictionary>
</Window.Resources>
<Grid>
<TextBlock Text="adfasdf" Style="{StaticResource s1}"></TextBlock>
</Grid>
</Window>

As you can see, there is nothing fancy at all. And Google does not know the answer either.

Has anyone on this earth had this issue before? Any help would be much appreciated

Glad you got it sorted out! I have had endless problems with Visual Studio freezing when using a WPF plugin. It was also a corrupted font cache!
 
Top