using System; using System.Collections.Generic; using System.ComponentModel; using System.ComponentModel.Composition; using System.Linq; using System.Text; using Caliburn.Micro; namespace Pithos.Client.WPF.Shell { [Export(typeof(MiniStatusViewModel)),PartCreationPolicy(CreationPolicy.Shared)] public class MiniStatusViewModel:Screen { public override string DisplayName { get { return "Pithos+ Status"; } set { base.DisplayName = value; } } public string Status { get { return Shell.StatusMessage; } } private ShellViewModel _shell; public ShellViewModel Shell { get { return _shell; } set { _shell = value; _shell.PropertyChanged += OnParentChanged; } } private void OnParentChanged(object sender, PropertyChangedEventArgs e) { if (e.PropertyName=="StatusMessage") NotifyOfPropertyChange(()=>Status); } } }