Reputation: 271
I've spent the last few months creating a C# WPF program for a client running Windows 7. I've been developing the program on a Windows 10 device and recently sent the client a beta build to be told it wasn't functioning correctly. Please see images below:
Windows 10 is the intended result. However as shown in the photo the icons inside of the MenuItem are their full image size instead of shrinking to fit the menu. Code of Menu:
<Menu Height="21" x:Name="menu1" VerticalAlignment="Top" Panel.ZIndex="3">
<MenuItem Header="_File " >
<MenuItem Header="_Open" x:Name="Open" Click="Open_Click" >
<MenuItem.Icon>
<Image Source="Resources/OpenFolder.png" />
</MenuItem.Icon>
</MenuItem>
</MenuItem>
On Windows 7 the blur effect will not apply to the grid. Code for blur:
BlurEffect myBlurEffect = new BlurEffect {Radius = 10};
HomeGrid.Effect = myBlurEffect;
In addition, there are also numerous buttons which are slightly cut off.
Any help in how to fix these problems would be greatly appreciated, thank you in advance.
Upvotes: 1
Views: 650
Reputation: 271
Hey thanks to the comments a solution has been found & encase anyone has a similar problem...
Problem one was fixed as suggested by using viewboxes and then setting a defined width and height of 15 pixels. The code is now:
<Menu Height="21" x:Name="menu1" VerticalAlignment="Top" Panel.ZIndex="3">
<MenuItem Header="_File " >
<MenuItem Header="_Open" x:Name="Open" Click="Open_Click" >
<MenuItem.Icon>
<Viewbox Width="15" Height="15" HorizontalAlignment="Left">
<Image Source="Resources/OpenFolder.png" />
</Viewbox>
</MenuItem.Icon>
</MenuItem>
</MenuItem>
Problem two was fixed by running a Windows Update. My virtual machine did over 200 Windows updates so I'm unsure which update fixed the problem, but I believe one of the updates to the .net framework updates fixed the blur issue.
Upvotes: 1