Closed hbbliyong closed 5 years ago
Sorry dude, I'm french, I only speak english 😉
OK, I brought your question to my friend Google Translate, and regarding INotifyPropertyChanged
, there is no implementation in MrAdvice, which does not offer implementations.
However, I have another project, named MrAdvice.MVVM, which uses MrAdvice and implements INotifyPropertyChanged
, so you can probably see how its done and take the code you need.
Thank you. I see. I'll try. where is the "INotifyPropertyChanged" code,how do i use it?
Lazy boy. The code is here and you only need to apply the NotifyPropertyChanged
attribute to a given property to make it work. Also, your view-model needs to implement the INotifyPropertyChangedViewModel
(which can be found here). The code probably won't build if you only use the two given classes, but you'll be closer to success.
hi,my code
public class CheckAndKeepGplotLaster : Attribute,IMethodAdvice
{
/// <summary>
/// 是否检测墙数据是否是最新的,默认检测
/// </summary>
public bool IsCheckWalls { get; set; } = true;
/// <summary>
/// 是否检测Revit模型是否是最新的,默认检测
/// </summary>
public bool IsCheckRevitModel { get; set; } = true;
private Gplot m_gplot;
public void Advise(MethodAdviceContext context)
{
m_gplot = context.Target as Gplot;
}}
public abstract class Gplot {
public abstract void Show();
}
public abstract class SpaceRelated:Gplot
{
protected SpaceRelated()
{
IsSpace = true;
}
}
public class SpaceNeighborhood : SpaceRelated {
[CheckAndKeepGplotLaster]
public override void Show()
{
}
}
var gplot= GplotFactory.Create(GraphTypeEnum.SpaceNeighborhood);
gplot.Show();
the mradvice is not work
Please help me to help you: can you provide a full sample? If this does not work, it's probably that the assembly is not weaved, but how can I guess that? If the bug is not related to your question, you can also open a new issue, this makes things more clear. So: do you have a simple project with a failure sample? Or can you provide a bit more information, such as the project target (.NET, .NET Core), etc.?
您好,咱们这个有INotifyPropertyChanged接口的封装实现吗?