Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bugfix: New document sometimes cannot be opened.(While another new do… #134

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,10 @@ protected override void OnViewLoaded(object view)
public override bool Equals(object obj)
{
var other = obj as CodeEditorViewModel;
return other != null && string.Compare(_path, other._path) == 0;
// Compare filename if path is null (and other._path is also null)
return other != null && string.Compare(_path, other._path) == 0 &&
(_path != null || (other._path == null && string.Compare(_fileName, other._fileName)==0) );

}

public void Save()
Expand All @@ -129,4 +132,4 @@ private void SetLanguage(ILanguageDefinition languageDefinition)
}
}
}
}
}
12 changes: 12 additions & 0 deletions src/Gemini/Modules/MainMenu/Models/CommandMenuItem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,18 @@ public CommandMenuItem(Command command, StandardMenuItem parent)
_parent = parent;

_listItems = new List<StandardMenuItem>();

_command.PropertyChanged += (s, e) =>
{
if (e.PropertyName == "Visible" || e.PropertyName == "Checked")
{
NotifyOfPropertyChange("Is" + e.PropertyName);
}
else if (e.PropertyName == "Text" || e.PropertyName == "IconSource")
{
NotifyOfPropertyChange(e.PropertyName);
}
};
}

CommandDefinitionBase ICommandUiItem.CommandDefinition
Expand Down