Themes - code snippets

User avatar
mcbpete
Posts: 381
Joined: Tue Nov 22, 2011 9:45 pm

Re: Themes - code snippets

Post by mcbpete »

Mmm, my code has got a bit bloated now and I've got a little lost (I started the theme in the pre-WPF days and have kept building on top as and when the codebase has changed). The code for the ParameterWindow is in a file called (funnily enough !) ParameterWindow.xaml and the code is structured pretty differently. When I try increasing the opacity of the LinearGradient Brush is just makes it darker but not transparent - I'm thinking it's kind of working and the overlaid gradient is becoming transparent but the actual dialogue box is opaque and there's a separate control for that.

I tried copying your control.xaml over mine and it didn't actually do anything, so I then tried renaming ParameterWindow.xaml to .xaml.old as clearly the theme was overriding the styles, but it's being called from somewhere (I couldn't find where on any of my other .xamls) so fails if named like that.

I know it's really cheeky but I'm wondering if you could cast your eye over my theme (mainly Parameter.xaml) to see where exactly I'm going wrong. You'll probably groan at my mistakes of coding, but I'm a big of an .xaml beginner :oops:

Here's the theme: http://www.ilovecubus.co.uk/pete/cubus_1468.zip
User avatar
strobotone
Posts: 297
Joined: Wed Nov 23, 2011 2:59 pm
Location: berlin
Contact:

Re: Themes - code snippets

Post by strobotone »

Don´t know if got your problem right.
Just been looking over your files.
In order to use transparency one has to set AllowsTransparency="True" AND WindowStyle="None" for the Window :

<Window
xmlns="http://schemas.microsoft.com/winfx/2006 ... esentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:l="clr-namespace:BuzzGUI.ParameterWindow;assembly=BuzzGUI.ParameterWindow"
xmlns:bgc="clr-namespace:BuzzGUI.Common;assembly=BuzzGUI.Common"
Height="300" Width="410" WindowStyle="None" ShowInTaskbar="False" SizeToContent="Height" AllowsTransparency="True"
UseLayoutRounding="True" TextOptions.TextFormattingMode="Display"
...

then you can use Opacity on the background or othe parts of the window.
But you have to define the border and handle of the window yourself.
User avatar
mcbpete
Posts: 381
Joined: Tue Nov 22, 2011 9:45 pm

Re: Themes - code snippets

Post by mcbpete »

Mmm after all that I found that I preferred the look of the standard Windows titlebar to a custom one so have ditched the transparency feature on my parameter window xaml. Thanks for the info though, if I ever want to switch the look again at least this time I know what to look for - so it is very much appreciated :)
Post Reply