|
using System.Windows;
using System.Diagnostics;
namespace MediaAssistant.Controls.SplashScreen
{
public class MessageListener : DependencyObject
{
private static MessageListener mInstance;
private MessageListener ( )
{
}
public static MessageListener Instance
{
get
{
if ( mInstance == null )
mInstance = new MessageListener ( );
return mInstance;
}
}
public void ReceiveMessage ( string message )
{
Message = message;
Debug.WriteLine ( Message );
DispatcherHelper.DoEvents ( );
}
public string Message
{
get
{
return ( string ) GetValue ( MessageProperty );
}
set
{
SetValue ( MessageProperty, value );
}
}
public Visibility BusyIconVisibility
{
get
{
return (Visibility)GetValue(BusyIconVisibilityProperty);
}
set
{
SetValue(BusyIconVisibilityProperty, value);
DispatcherHelper.DoEvents();
}
}
public static readonly DependencyProperty BusyIconVisibilityProperty =
DependencyProperty.Register("BusyIconVisibility", typeof(Visibility), typeof(MessageListener), new UIPropertyMetadata(Visibility.Hidden));
public static readonly DependencyProperty MessageProperty =
DependencyProperty.Register ( "Message", typeof ( string ), typeof ( MessageListener ), new UIPropertyMetadata ( null ) );
}
}
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.