我工作的MVVM
和WPF
应用程序。 我在我所编辑观看图像并保存一个场景。
我已经使用RadCarousel
中使用ContextMenu
上右键单击我使用编辑图像mspaint
。 当我尝试保存编辑后的图片我得到的“ Sharing violation error on path
”。
图像被位于一个共享文件夹。
// XAML代码:
<telerik:RadCarousel x:Name="MarketSeriesCarousel"
HorizontalAlignment="Stretch"
VerticalAlignment="Stretch"
ItemsSource="{Binding Path=MarketSeriesImageList, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged, NotifyOnSourceUpdated=True, NotifyOnTargetUpdated=True}"
SelectedItem="{Binding SelectedMarketSeriesImage, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged, NotifyOnSourceUpdated=True}"
Background="Transparent"
HorizontalScrollBarVisibility="Auto"
ScrollViewer.CanContentScroll="True"
ScrollViewer.VerticalScrollBarVisibility="Auto"
telerik:StyleManager.Theme="Windows8"
Focusable="True"
PropertyChanged="MarketSeriesCarousel_PropertyChanged">
<telerik:RadCarousel.ContextMenu>
<ContextMenu >
<MenuItem Header="Edit" Command="{Binding EditImage}" CommandParameter="{Binding }"/>
<MenuItem Header="MetaData" IsEnabled="False"/>
<MenuItem Header="Delete" Command="{Binding DeleteImage}"/>
</ContextMenu>
</telerik:RadCarousel.ContextMenu>
<telerik:RadCarousel.ItemsPanel>
<ItemsPanelTemplate>
<telerik:RadCarouselPanel Path="{StaticResource path}"
telerik:StyleManager.Theme="Windows8" >
</telerik:RadCarouselPanel>
</ItemsPanelTemplate>
</telerik:RadCarousel.ItemsPanel>
<i:Interaction.Triggers>
<i:EventTrigger EventName="MouseDoubleClick">
<i:InvokeCommandAction Command="{Binding ViewSeriesImage}" />
</i:EventTrigger>
</i:Interaction.Triggers>
</telerik:RadCarousel>
//视图模型代码:
/// <summary>
/// Edit image viewer.
/// </summary>
private void EditImageViewer()
{
try
{
ProcessStartInfo startInfo = new ProcessStartInfo(ImagePath);
startInfo.Verb = "edit";
Process proc = Process.Start(startInfo);
}
catch (Exception ex)
{
// Error handling.
throw new ApplicationException(ex.Message);
}
}
任何可能的方式,我可以做到这一点? 或任何替代方案进行图像编辑。
但我需要的所有功能mspaint
。