Skip to content
Jörg Flechsig edited this page Dec 23, 2016 · 38 revisions

Welcome to the BlurryControls wiki!

The BlurryControls library is meant to give your application a blurry look as it is known from the AeroGlass design.

BlurryControls.dll provides the following functionality

  1. BlurryWindow: you can inherit from BlurryWindow to create a blurry window
  2. BlurryTray: you can inherit from BlurryTray to create a control which appears (by default) in the bottom right corner of your workspace, it is a convinient way to implement a control invoked by a tray icon (comes with an animation)
  3. BlurryDialogWindow: this one can only be in invoked by BlurryMessageBox which provides functionality similar to the conventional MessageBox provided by Microsoft
  4. BlurryImage: a conventional WPF Image with additional functionality to blur it dynamically

There is an example solution! :)

In the solution you will find a project called BlurryWindowInvoker. It provides a short presentation of what the BlurryControls.dll can do.

How to use the controls

BlurryWindow

inherits System.Windows.Window

Missing functionality:

  • resize when TaskBar is not oriented bottom with a multi-monitor setup (works on primary monitor, or aero snap)

code example for common usage:

C#:

var blurryWindow = new BlurryWindow();
blurryWindow .Show();
//alternatively blurryWindow.ShowDialog() to block calling instance

Note: The usual method to invoke is StartupUri="BlurryExampleWindow.xaml" in your App.xaml.cs

WPF:

<windows:BlurryWindow x:Class="SuperCoolExampleNamespace.BlurryExampleWindow"
                      xmlns:windows="clr-namespace:BlurryControls.Windows;assembly=BlurryControls"
                      xmlns:control="clr-namespace:SuperCoolExampleNamespace"
                      Strength="0.75">
    <Grid x:Name="SuperCoolExampleContent">
        <!-- content goes here -->
    
    </Grid>
</windows.BlurryWindow>

Note: When applying a custom brush to the Background property, the Strength will be applied to it. The default value of Strength is 0.75

Additional parameters:

  • IsResizable
  • IsMenuBarVisible
  • Strength
  • CloseOnIconDoubleClick

BlurryTray

code example for common usage:

C#:

var tray = new InvokedTrayWindow();
tray.Show();

Note: You can also use tray.ShowDialog to block interaction with the calling instance as long as the BlurryControl is activated

WPF:

<windows:BlurryTray x:Class="SuperCoolExampleNamespace.BlurryExampleTray"
                      xmlns:windows="clr-namespace:BlurryControls.Windows;assembly=BlurryControls"
                      xmlns:control="clr-namespace:SuperCoolExampleNamespace"
                      Strength="0.75"
                      Duration="5"
                      DeactivationDuration="500">
    <Grid x:Name="SuperCoolExampleContent">
        <!-- content goes here -->
    
    </Grid>
</windows.BlurryTray>

AdditionalParameters:

  • Strength
  • DeactivatesOnLostFocus
  • Duration
  • ActivationDuration
  • DeactivationDuration

BlurryDialogWindow

can only be in invoked by BlurryMessageBox

code example for common usage:

C#:

var mainWindow = Application.Current.MainWindow;
var messageHeaderText = "ExampleDialog";
var messageContentText = $"This is a dialog owned by {mainWindow.Title}";
var result = BlurryMessageBox.Show(mainWindow, messageContentText, 
                 messageHeaderText, BlurryDialogButton.OkCancel, BlurryDialogIcon.Information);

switch (result)
{
    case BlurryDialogResult.Ok:
        Debug.WriteLine($"The result is {BlurryDialogResult.Ok}");
        break;
    case BlurryDialogResult.Cancel:
        Debug.WriteLine($"The result is {BlurryDialogResult.Cancel}");
        break;
    case BlurryDialogResult.None:
        Debug.WriteLine($"The result is {BlurryDialogResult.None}");
        break;
    default:
        throw new ArgumentOutOfRangeException();
}

Additional overloads:

Show(string messageBoxText, double strength = 0.5);
Show(string messageBoxText, string caption, double strength = 0.5);
Show(Window owner, string messageBoxText, double strength = 0.5);
Show(string messageBoxText, string caption, BlurryDialogButton button, double strength = 0.5);
Show(Window owner, string messageBoxText, string caption, double strength = 0.5);
Show(string messageBoxText, string caption, BlurryDialogButton button, BlurryDialogIcon icon, double strength = 0.5);
Show(Window owner, string messageBoxText, string caption, BlurryDialogButton button, double strength = 0.5);
Show(Window owner, string messageBoxText, string caption, BlurryDialogButton button, BlurryDialogIcon icon, double strength = 0.5);

BlurryImage

inherits System.Windows.Controls.Image

code example for common usage:

WPF:

<windows:BlurryImage x:Name="BlurryExampleImage" 
                     Source="../Resources/ExampleImage.jpeg"
                     BlurRadius="50"/>

Note: The BlurRadius property is bindable and can be adjusted dynamically

Additional parameters:

  • BlurRadius
Clone this wiki locally