Это невозможно с Тихо. Поэтому я использовал командную строку:
SET ECLIPSE_HOME=S:/Development/Eclipse 2018-12
SET EQUINOX_VERSION=1.5.200.v20180922-1751
SET CURRENT_PATH=%~dp0
SET SOURCE_REPOSITORY=%CURRENT_PATH%\dropin
SET TARGET_REPOSITORY=%CURRENT_PATH%\
java -jar "%ECLIPSE_HOME%/plugins/org.eclipse.equinox.launcher_%EQUINOX_VERSION%.jar"
-application org.eclipse.equinox.p2.publisher.FeaturesAndBundlesPublisher
-metadataRepository "file:/%TARGET_REPOSITORY%" -artifactRepository "file:/%TARGET_REPOSITORY%"
-source "%SOURCE_REPOSITORY%" -publishArtifacts -append
Однако я не смог создать категории, поэтому хранилище по умолчанию выглядит пустым.
The problem with your approach is that you assume the InkCanvas
creates the StrokeCollection
. It does not - it merely adds and removes items from it. And if the collection isn't available (ie. is null
), the binding will fail and the InkCanvas
won't do anything with it. So:
StrokeCollection
Example code:
public class ViewModel : INotifyPropertyChanged
{
private readonly StrokeCollection _strokes;
public ViewModel()
{
_strokes = new StrokeCollection();
(_strokes as INotifyCollectionChanged).CollectionChanged += delegate
{
//the strokes have changed
};
}
public event PropertyChangedEventHandler PropertyChanged;
public StrokeCollection Signature
{
get
{
return _strokes;
}
}
private void OnPropertyChanged(string propertyName)
{
var handler = PropertyChanged;
if (handler != null)
{
handler(this, new PropertyChangedEventArgs(propertyName));
}
}
}
And XAML:
<InkCanvas Strokes="{Binding Signature}"/>