ビューにLoggingService
マップされた があります。一度変更されたテキストを表示しています。
これまでのところ問題なく動作しますが、に基づいてテキストの色を変更したいと考えていますLoggingType
。
UpdateTextStyle
私の問題は、以下のメソッドを呼び出すために LoggingService プロパティ変更イベントをサブスクライブする場所が見つからないことです。
private void UpdateTextStyle(ILoggingService logging, string propertyName)
{
var loggingType = logging.GetUserLevelLatestLog().Key;
switch (loggingType)
{
case LoggingTypes.Error:
View.UserInfoLogsTextBlock.Foreground = new SolidColorBrush(Colors.Red);
View.UserInfoLogsTextBlock.FontWeight = FontWeights.Bold;
break;
...
}
}
VM のビューにマップされるプロパティは次のとおりです。
public ILoggingService LoggingService
{
get
{
if (_loggingService == null)
{
_loggingService = Model.LoggingService;
}
return _loggingService;
}
}
前もって感謝します!